Author Topic: Variable Keypress and Function (F1-F24) keys  (Read 599 times)

Vi3D

  • Newbie
  • *
  • Posts: 1
Variable Keypress and Function (F1-F24) keys
« on: September 06, 2024, 09:41:50 PM »
Hello. I'm trying to set up a profile to cover various basic radio commands in DCS World. I'm having trouble using the Variable keypress function alongside the F keys however.

For instance, here is a command meant to select one of the various ATC options in one of the maps:

Voice command: Radio ATC [1..10]

Code: [Select]
Press ] } key and hold for 0,1 seconds and release
Press F5 key and hold for 0,1 seconds and release
Set text [KeyPress] to 'F{CMDSEGMENT:1}'
Write [Blue] 'KeyPress = {TXT:KeyPress}' to log
Press variable key(s) [KeyPress] and hold for 0,1 seconds and release

My intention was that the spoken number would be turned into one of the F1 to F10 keys and pressed on the last command, but it seems nothing happens. The write command does show that KeyPress got assigned as the correct thing in text, but it seems to just be treated as a text string during the final Press command, so nothing happens.

Thanks in advance for any help.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2827
Re: Variable Keypress and Function (F1-F24) keys
« Reply #1 on: September 06, 2024, 10:49:28 PM »
The F keys require square brackets.

Try changing this line:

Set text [KeyPress] to 'F{CMDSEGMENT:1}'

to

Set text [KeyPress] to '[F{CMDSEGMENT:1}]'


Hope that helps!