Author Topic: How do I use RSHIFT + JOYSTICK button possible?  (Read 1863 times)

TOViper

  • Guest
How do I use RSHIFT + JOYSTICK button possible?
« on: November 11, 2019, 01:02:11 PM »
Hi,

want to assign RSHIFT + Joystick Button 3 to a command.

The "Edit a Command" box list the following options:

"When I say:"
"When I press keys:"
"When I press button:"
"When I press mouse:"

They are logical OR conditions, not AND conditions, so how do I do?

Thanks for any hints and kind regards,
TOViper

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4761
  • RTFM
Re: How do I use RSHIFT + JOYSTICK button possible?
« Reply #1 on: November 11, 2019, 02:35:18 PM »
You can have a command trigger using the right shift key, then check whether the joystick button is also pressed.

E.G.
Code: [Select]
Start Loop While :  Keyboard Key 'Right Shift' Is Pressed
    Begin Device State Check :  Joystick 1 Button 3 Is Pressed
        Write [Blue] 'Button has been pressed' to log
    End Condition - Exit when condition met
End Loop

TOViper

  • Guest
Re: How do I use RSHIFT + JOYSTICK button possible?
« Reply #2 on: November 11, 2019, 02:37:01 PM »
I will give it a try, thanks for your quick answer!  8)

TOViper

  • Guest
Re: How do I use RSHIFT + JOYSTICK button possible?
« Reply #3 on: November 13, 2019, 05:14:19 PM »
You can have a command trigger using the right shift key, then check whether the joystick button is also pressed.

E.G.
Code: [Select]
Start Loop While :  Keyboard Key 'Right Shift' Is Pressed
    Begin Device State Check :  Joystick 1 Button 3 Is Pressed
        Write [Blue] 'Button has been pressed' to log
    End Condition - Exit when condition met
End Loop


How do I do this, e.g. where do I put the code to?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4761
  • RTFM
Re: How do I use RSHIFT + JOYSTICK button possible?
« Reply #4 on: November 13, 2019, 06:17:19 PM »
You need to add the appropriate actions to a VoiceAttack command, just as you would otherwise.

The example consists of a "Loop Start" action (with its matching "Loop End" action, which is added automatically with the former), containing a "Begin a Conditional (If Statement) Block" action (also with its matching "End a Conditional Block", again added automatically).

The "Write a Value to the Event Log" action within the condition is to illustrate where the actions you want to execute if the condition is met (I.E. Right Shift and Joystick 1 Button 3 are pressed simultaneously) should go.
« Last Edit: November 13, 2019, 09:11:25 PM by Pfeil »