Author Topic: DCS Action Help  (Read 1039 times)

tman41291

  • Newbie
  • *
  • Posts: 1
DCS Action Help
« on: February 19, 2022, 01:47:15 PM »
So I don't know if this is possible but in my head, I want to give this a try. My solo efforts have been unsuccessful lately. Here is what I want to do;

Press a joystick button to act as if I pressed F10 (open map), then when I'm ready to push the same joystick button to act as if I pressed F1 (pilot view).

DCS has two separate commands for these two, so I would need to map two buttons. Well, I want to see if I can just do one. I might eventually add in voice commands, but buttons, for now, would be preferred.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: DCS Action Help
« Reply #1 on: February 19, 2022, 01:52:30 PM »
You can use a variable to keep track of which button was pressed, so a condition can be used to switch between two keypress actions.

E.G.
Code: [Select]
Begin Boolean Compare : [pressAlternateKey] Equals False
    Press M key and hold for 0.01 seconds and release
Else
    Press F1 key and hold for 0.01 seconds and release
End Condition
Set Boolean [pressAlternateKey] to Toggle

Note that this is completely separate from any ingame state. E.G. if you press the button once, and then close the map using other means (E.G. restarting the flight), the next press will still press F1.


If you are not familiar with these concepts, press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer, which contains information on VoiceAttack's features.

These topics may also be of use, in addition to the official documentation:
Control flow (If, Else, ElseIf, Loop, Jump) basics
Variables and tokens summed up