Execute macro on button press not Release

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
tickytocky
Posts: 2
Joined: Sun Apr 21, 2024 3:44 am

Execute macro on button press not Release

Post by tickytocky »

Hello

I have a SpaceMouse Compact and I'm struggling to find a way to have a modifier+key macro to execute on button press rather than button release.

For example if you assign a keyboard key via the gui the events execute as you'd expect with execution on button press, repeat on button hold and end on button release. I want to achieve the same behaviour but with a modifier+keytroke or modifier+mouseclick so that I'm not interfering with other shortcuts and hotkeys.

Any pointers truly appreciated but if this is not possible please let me know and put me out of my misery!

The following code fires the propper events on press and release so is it possible to include a modifier or execute a string of keys where the last key can be held down?

Code: Select all

<ButtonBank Default="true">
        <Name>STR_DEFAULT_BUTTONBANK</Name>
        <ID>Default</ID>
        <Button>
          <Input>
            <ActionID>HIDButton_2</ActionID>
          </Input>
          <Output>
            <ActionID>KB_Delete</ActionID>
          </Output>
        </Button>
      </ButtonBank>
This basic macro setup below works but only fires on button release. Can it be setup so it fires on button press?

Code: Select all

<ButtonActions>
    <ButtonAction Type="Sequence">
      <ID>Macro_0115ff0f-75db-4e2b-b674-eb997adcf3c8</ID>
      <Name>SpaceMouse1</Name>
      <Sequence>
        <ActionID>CTRL+SHIFT+4</ActionID>
      </Sequence>
    </ButtonAction>
  </ButtonActions>

  <MacroTable>
    <MacroEntry>
      <ID>CTRL+SHIFT+4</ID>
      <KeyStroke>
        <Modifiers>
          <Modifier>Control</Modifier>
          <Modifier>Shift</Modifier>
        </Modifiers>
        <Key>21</Key>
      </KeyStroke>
    </MacroEntry>
  </MacroTable>
  
tickytocky
Posts: 2
Joined: Sun Apr 21, 2024 3:44 am

Re: Execute macro on button press not Release

Post by tickytocky »

Ok a little progress. This almost works perfectly as long as KB_Custom is called directly from ButtonBank and not via ButtonActions as per the GUI macro setup.

Can the KeyPress tags be modified to control timing or to limit repeat presses when the button is held down?

Code: Select all

<MacroTable>
		<MacroEntry>
			<ID>KB_Custom</ID>
				<Sequence>
					<KeyPress>E1</KeyPress>
					<KeyPress>27</KeyPress>
					<!-- remove <KeyRelease>27</KeyRelease> -->
					<!-- remove <KeyRelease>E1</KeyRelease> -->
				</Sequence>
		</MacroEntry>
</MacroTable>
Post Reply