Trying to figure out how to set a shift + Hold in the radial menus

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

vertigo262
Posts: 15
Joined: Thu Feb 15, 2018 10:23 pm

Trying to figure out how to set a shift + Hold in the radial menus

Post by vertigo262 » Thu Feb 15, 2018 10:33 pm

Is there a way to add the ability to hold Shift as if you were holding the shift button in the radial menus?

I tried in the macro's but wasn't possible

jwick
Moderator
Moderator
Posts: 2531
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Trying to figure out how to set a shift + Hold in the radial menus

Post by jwick » Fri Feb 16, 2018 9:56 am

I don't understand. You want to open a radial menu (presumably by pressing a 3D mouse button), then have a slice that presses a shift key, but doesn't release it? And after executing that slice the RM goes away?

vertigo262
Posts: 15
Joined: Thu Feb 15, 2018 10:23 pm

Re: Trying to figure out how to set a shift + Hold in the radial menus

Post by vertigo262 » Fri Feb 16, 2018 4:09 pm

For example,

I have a SpaceMouse with only 2 buttons. So, if I had more buttons, I'd assign a Shift or control to a button which you would just hold with your finger. But because 2 buttons aren't enough. I need to put the Hold Shift in a Radial Menu

The radial Menu's weren't built to hold like a button and then release when your thumb or finder is off them. So, pushing a button will execute a command one time. Isn't meant to hold and release when your finger is off the button.

So their needs to be a switch. For example, Shift on/Shift off

Example, in 3D Coat, when I want to invert the clay sculpt, it's faster to hold shift, or CTRL for smoothing. But only have 2 buttons.

So, I tried to create a Macro. But the Macro doesn't allow for holding a button down. It puts in a button release by design

<KeyPress></KeyPress>
<KeyRelease></KeyRelease>
<KeyPress></KeyPress>
<KeyRelease></KeyRelease>


Although, now after looking at the xml, I am going to try to manually remove

<KeyPress></KeyPress>
<KeyRelease></KeyRelease>


So I would have to make 2 macro's a Shift on, and a Shift off

So I was wondering if there was an easier way to do this? or see if what I am going to try to do right now will work. But I would think that their would be the ability to hold a button like Shift in the radial menu.

Also, just a side note: Would be nice if you could label your commands in the Radial Menu. Especially the one with 8 menus, gets confusing when they are unlabeled icons

mhoopes
Posts: 67
Joined: Thu Dec 07, 2006 10:48 am
Location: Campbell, CA

Re: Trying to figure out how to set a shift + Hold in the radial menus

Post by mhoopes » Tue Feb 27, 2018 8:48 am

I can't think of a macro that turns on shift hold.

Here's the closest thing I can think of (without jumping down the AutoHotkey rabbit hole): Launch the on-screen keyboard with a macro (Alt + F12), then click on Shift to go into shift hold mode.
Michael Hoopes

jwick
Moderator
Moderator
Posts: 2531
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Trying to figure out how to set a shift + Hold in the radial menus

Post by jwick » Tue Feb 27, 2018 9:07 am

You can try removing the <KeyRelease> in a ShiftPress macro (and put it into a ShiftRelease macro). It will just press the key. It will probably work for the modifier keys. The system will autorepeat the other keys on you if they are held down too long.

OTOH, if the focus changes to a new application, I am going to release all the keys that are pressed. It makes for a bad day to have keys stuck down in Windows. Especially something like an Alt key. The power button becomes your only way out.

To see what is being sent to the system, turn on the log file (3Dx systray icon). If you stream the log file (download baretail.exe) you can watch in real-time what is being sent. The log file is at %localappdata%\3Dconnexion\3DxWare\3DxService.log.

I don't recall getting a request for having the radial menu work more like a real button (press in a slice and hold it down, synchronized with the mouse button). It's an interesting idea (option).

mhoopes
Posts: 67
Joined: Thu Dec 07, 2006 10:48 am
Location: Campbell, CA

Re: Trying to figure out how to set a shift + Hold in the radial menus

Post by mhoopes » Tue Feb 27, 2018 11:02 am

Ctrl Hold is a frequent operation for me in Creo Parametric. It's useful for multiple selections while navigating with a 3D Mouse, such as selecting surfaces for application of Appearances.

I tried to make a Ctrl Hold macro, using the On-Screen Keyboard to enter [press Ctrl]. It looked like it worked, but when I saved the macro, it reverted to [press Ctrl][release Ctrl] in the GUI, and <MacroEntry><ID>Ctrl Hold</ID><KeyStroke><Key>E0</Key></KeyStroke></MacroEntry> in ProE.xml.

I also tried to program the Alt button for [release Shift][release Ctrl]. When I returned to the Edit menu, the macro was blank.

Are there alternate commands I can enter in the xml file for discrete key press and release functions?
Michael Hoopes

mhoopes
Posts: 67
Joined: Thu Dec 07, 2006 10:48 am
Location: Campbell, CA

Re: Trying to figure out how to set a shift + Hold in the radial menus

Post by mhoopes » Tue Feb 27, 2018 11:27 am

Substituting <KeyPress></KeyPress> for <KeyStroke></KeyStroke> in the xml file doesn't appear to work for me. Am I doing something wrong?
Michael Hoopes

jwick
Moderator
Moderator
Posts: 2531
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Trying to figure out how to set a shift + Hold in the radial menus

Post by jwick » Wed Feb 28, 2018 3:49 am

Caveat Emptor and all that.
It works, but you are on your own. Hopefully I consistently release those keys when you switch apps (it seems to).

This is a user cfg for Explorer (for 3DxWinCore 17.5.5). I've created two macros, Shift_Press and Shift_Release and assigned them to Radial Menu slices (N & E). If you activate the Shift_Press macro it will press but not release your Shift key. The Shift key will stay down until you activate the Shift_Release macro (or switch to a different application).

You could also assign those macros to device buttons for that matter (a Shift Lock). Wouldn't be nice if you could have an Action that toggled between two Actions on a single button? Then you could press a button to Shift Lock, and press it again to release the Shift Lock.

My process to create these included using the GUI and editing with notepad++ (XML extension installed). The GUI is good at doing some things, like recording keystrokes, but many operations are beyond its scope. The keystrokes are language-specific. It is important to record them on the system you intend to use them on.

In the GUI I recorded a single key macro in the GUI. This gave me the Shift key's HID key code (E1) needed for the KeyPress/Release entries.
Then I created a multi-key macro in the GUI ("abc") so I could get the KeyPress/KeyRelease sequence syntax written into the cfg file.
Then I created a Radial Menu in the GUI and assigned something to one of the slices.
Finally I edited the cfg file with notepad++ to rename the abc macro for Shift_Press and made another copy for Shift_Release. I then replaced all the Sequence contents with one KeyPress (KeyRelease) and changed the Key value to E1 (Shift).

I changed the Radial Menu assignments to call Shift_Press/Shift_Release on MenuButton_1/2. You could do that in the GUI. Once you have the correct macros created you can do whatever you want with them.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<AppCfg Default="false" xmlns="" CfgFormatVersion="1.2" ThisFileVersion="1.7">
  <AppInfo>
    <Signature>
      <Name>STR_EXPLORER</Name>
    </Signature>
    <Options />
  </AppInfo>
  <CfgProperties>
    <InheritsFrom>STR_EXPLORER</InheritsFrom>
  </CfgProperties>
  <Settings />
  <Devices>
    <Device>
      <Name>SpaceMouse Enterprise</Name>
      <VendorID>256f</VendorID>
      <ProductID>c633</ProductID>
      <InheritsFrom>Standard 3D Mouse</InheritsFrom>
      <ButtonBank Default="true">
        <Name>STR_DEFAULT_BUTTONBANK</Name>
        <ID>Default</ID>
        <Button>
          <Input>
            <ActionID>HIDButton_16</ActionID>
          </Input>
          <Output>
            <ActionID>RadialMenu_MenuRM_0773db46-1a7b-40ad-903a-328f80d8bd9f</ActionID>
          </Output>
        </Button>
      </ButtonBank>
    </Device>
  </Devices>
  <AuthorInfo>
    <DriverVersion>17.5.5.14756</DriverVersion>
    <LastChange>
      <Tool>3DxSmartUI.exe</Tool>
      <Version>1.2.18050.14680</Version>
      <Date>2/28/2018 10:16:24 AM UTC</Date>
      <User>jwick</User>
    </LastChange>
  </AuthorInfo>
  <MacroTable>
    <MacroEntry>
      <ID>Shift_Press</ID>
      <Sequence>
        <KeyPress>E1</KeyPress>
      </Sequence>
    </MacroEntry>
    <MacroEntry>
      <ID>Shift_Release</ID>
      <Sequence>
        <KeyRelease>E1</KeyRelease>
      </Sequence>
    </MacroEntry>
  </MacroTable>
  <Menus>
    <Executable>3DxPieMenus.exe</Executable>
    <Menu Type="Radial">
      <Name>test</Name>
      <ID>MenuRM_0773db46-1a7b-40ad-903a-328f80d8bd9f</ID>
      <GesturesEnabled>true</GesturesEnabled>
      <Style>FourButton</Style>
      <Button>
        <Input>
          <ActionID>MenuButton_1</ActionID>
        </Input>
        <Output>
          <ActionID>Shift_Press</ActionID>
        </Output>
      </Button>
      <Button>
        <Input>
          <ActionID>MenuButton_2</ActionID>
        </Input>
        <Output>
          <ActionID>Shift_Release</ActionID>
        </Output>
      </Button>
      <Button>
        <Input>
          <ActionID>MenuButton_3</ActionID>
        </Input>
        <Output>
          <ActionID>
          </ActionID>
        </Output>
      </Button>
      <Button>
        <Input>
          <ActionID>MenuButton_4</ActionID>
        </Input>
        <Output>
          <ActionID>
          </ActionID>
        </Output>
      </Button>
      <Button>
        <Input>
          <ActionID>MenuButton_5</ActionID>
        </Input>
        <Output>
          <ActionID>
          </ActionID>
        </Output>
      </Button>
      <Button>
        <Input>
          <ActionID>MenuButton_6</ActionID>
        </Input>
        <Output>
          <ActionID>
          </ActionID>
        </Output>
      </Button>
      <Button>
        <Input>
          <ActionID>MenuButton_7</ActionID>
        </Input>
        <Output>
          <ActionID>
          </ActionID>
        </Output>
      </Button>
      <Button>
        <Input>
          <ActionID>MenuButton_8</ActionID>
        </Input>
        <Output>
          <ActionID>
          </ActionID>
        </Output>
      </Button>
    </Menu>
  </Menus>
  <ButtonActions>
    <ButtonAction Type="Menu">
      <ID>RadialMenu_MenuRM_0773db46-1a7b-40ad-903a-328f80d8bd9f</ID>
      <Name>test</Name>
      <MenuID>MenuRM_0773db46-1a7b-40ad-903a-328f80d8bd9f</MenuID>
    </ButtonAction>
  </ButtonActions>
</AppCfg>

mhoopes
Posts: 67
Joined: Thu Dec 07, 2006 10:48 am
Location: Campbell, CA

Re: Trying to figure out how to set a shift + Hold in the radial menus

Post by mhoopes » Wed Feb 28, 2018 7:25 am

Thanks for the code snippet! There are quite a few commands and syntax I'm not familiar with. Do you guys have a reference for those that I can peruse?

I successfully employed the <Sequence><KeyPress> macros, and assigned them to the Shift and Ctrl buttons, respectively. They automatically release if I click into another application.
However, I wanted to assign Alt to a multiple KeyRelease sequence, but that didn't work for me. Is there a syntax issue with the following?

<MacroEntry><ID>Shift/Ctrl Release</ID><Sequence><KeyRelease>E1</KeyRelease><KeyRelease>E0</KeyRelease></Sequence></MacroEntry>
Michael Hoopes

jwick
Moderator
Moderator
Posts: 2531
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Trying to figure out how to set a shift + Hold in the radial menus

Post by jwick » Wed Feb 28, 2018 7:40 am

I see a couple of things:

1) "Shift/Ctrl". The XML parser may not like that slash. But if the GUI wrote it, it is probably ok.

2) You are only releasing the buttons in that macro. Didn't you want to press them? Did you want to do the Alt key?

You can't release keys that are not pressed on a keyboard. I deleted this detail from the earlier post. All keyboards have their own state. You can't press a button on one kb and release it on another. It will still be pressed on the first keyboard (as far as Windows is concerned). This is a Windows thing. You will notice the same thing if you have an external kb attached to a notebook.

You can see what is happening by turning on logging.

mhoopes
Posts: 67
Joined: Thu Dec 07, 2006 10:48 am
Location: Campbell, CA

Re: Trying to figure out how to set a shift + Hold in the radial menus

Post by mhoopes » Wed Feb 28, 2018 8:27 am

Thanks - the GUI did allow the slash. I modified it to a _ in xml, but that didn't make a difference. At any rate, the combo KeyRelease macro isn't essential, since clicking outside of Creo accomplishes it. I think a dedicated Press/Release toggle, as you suggested above, would be ideal.

I looked at the %localappdata%\3Dconnexion\3DxWare\3DxService.log in baretail for Shift Hold, then my Ctrl_Shift Release. FYI: I inserted a 125 ms pause between the two KeyReleases.

00000004 7:0:22.368: Creating buttonEvent HIDButton_25 pressed=1 from device \\?\HID#VID_046D&PID_C62B#7&3B12D6AB&0&0000#{4D1E55B2-F16F-11CF-88CB-001111000030}
00000020 7:0:22.368: KMJTrans:UdTransSendEvent: KMJEvent.type=2, origActionID=HIDButton_25, origValue=1
00000020 7:0:22.369: KMJTrans: keypress usageid = 0xe1, modifiers=0x0
00000080 7:0:22.369: SendKeyPress: pressing usageID 0xe1 ()
00000040 7:0:22.380: UdCtlOpen: MWM transport not allowed for xtop.exe
00000004 7:0:22.464: Creating buttonEvent HIDButton_25 pressed=0 from device \\?\HID#VID_046D&PID_C62B#7&3B12D6AB&0&0000#{4D1E55B2-F16F-11CF-88CB-001111000030}
00000004 7:0:28.152: Creating buttonEvent HIDButton_24 pressed=1 from device \\?\HID#VID_046D&PID_C62B#7&3B12D6AB&0&0000#{4D1E55B2-F16F-11CF-88CB-001111000030}
00000020 7:0:28.152: KMJTrans:UdTransSendEvent: KMJEvent.type=2, origActionID=HIDButton_24, origValue=1
00000020 7:0:28.152: KMJTrans: keyrelease usageid = 0xe1, modifiers=0x0
00000020 7:0:28.153: KMJTrans: pause = 125
00000004 7:0:28.265: Creating buttonEvent HIDButton_24 pressed=0 from device \\?\HID#VID_046D&PID_C62B#7&3B12D6AB&0&0000#{4D1E55B2-F16F-11CF-88CB-001111000030}
00000020 7:0:28.279: KMJTrans: keyrelease usageid = 0xe0, modifiers=0x0
Michael Hoopes

jwick
Moderator
Moderator
Posts: 2531
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Trying to figure out how to set a shift + Hold in the radial menus

Post by jwick » Wed Feb 28, 2018 9:16 am

And? Does it work? Does it do what you want?

I see from the log file that you pressed the Shift key on your SpaceMouse Pro.
This evidently was a press-only macro because it was not released when you released the SMP's shift key.

Then you pressed the Alt key on the SMP.
It released the shift key, waited 125ms and "released" the Ctrl key (it may have not been pressed on this keyboard, so that may have been a no-op).
(Kudos on the Pause. Pauses are often an important thing to insert. The GUI will record them for you if you need it to.)
Then you released the Alt key.

At that point, the world ended.

mhoopes
Posts: 67
Joined: Thu Dec 07, 2006 10:48 am
Location: Campbell, CA

Re: Trying to figure out how to set a shift + Hold in the radial menus

Post by mhoopes » Wed Feb 28, 2018 10:16 am

The Shift Hold and Ctrl Hold macros work for me. The Ctrl_Shift Release macro doesn't release either of them, though it is good to see that the sequence is sending the characters as expected. I added the delay to see if that was an issue, as it often is in multiple-character keyboard macros.

I then scaled it back to the following: <MacroEntry><ID>Ctrl Release</ID><Sequence><KeyRelease>E0</KeyRelease></Sequence></MacroEntry>
That didn't work, either.

This worked: <MacroEntry><ID>Ctrl_Shift_Release</ID><KeyStroke></KeyStroke></MacroEntry>

So, KeyPress works for me, but KeyRelease does not. So far, app switch or any KeyStroke (including null) seems to reliably release a held Ctrl or Shift.
Michael Hoopes

jwick
Moderator
Moderator
Posts: 2531
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Trying to figure out how to set a shift + Hold in the radial menus

Post by jwick » Thu Mar 01, 2018 1:30 am

What application are you testing this with? I'll try to reproduce it if I have that app.

Exactly what is your scenario? Remember that you can't mix keyboards. I assume you are not attempting this from a radial menu yet.

There are some applications that don't read key events in the standard way. Some popular CAD applications come to mind.

The system keyboard focus is important here. If you send the release when the keyboard focus is in a different window, it may not get sent to the window you intended it to go to. You see from the log file that the driver is sending the events, but it is just sending them to the system (you are pressing/releasing keys on a virtual keyboard). The system has its own idea about where it is going to send those events. That's all a black box.

Try your macros with Explorer to see if it is a system issue or specific to an application.

mhoopes
Posts: 67
Joined: Thu Dec 07, 2006 10:48 am
Location: Campbell, CA

Re: Trying to figure out how to set a shift + Hold in the radial menus

Post by mhoopes » Thu Mar 01, 2018 7:43 am

Creo Parametric 2.0 (M250). You're correct, I haven't used a discrete KeyPress or KeyRelease in a radial menu, yet.

I just tried the following macros for %userprofile%\AppData\Roaming\3Dconnexion\3DxWare\Cfg\Explorer.xml:
<MacroTable>
<MacroEntry><ID>Shift Hold</ID><Sequence><KeyPress>E1</KeyPress></Sequence></MacroEntry>
<MacroEntry><ID>Ctrl Hold</ID><Sequence><KeyPress>E0</KeyPress></Sequence></MacroEntry>
<MacroEntry><ID>Ctrl_Release</ID><Sequence><KeyRelease>E0</KeyRelease></Sequence></MacroEntry>
</MacroTable>

Shift Hold and Ctrl Hold work, but Ctrl_Release doesn't release E0 in Explorer for me, either.
Michael Hoopes

Post Reply