Author Topic: How tosave a key press in a variable to use this variable in another command ?  (Read 1331 times)

KAPAX

  • Newbie
  • *
  • Posts: 7
Hello,

I want to define several command with key pressed (no release) :
Example :
cmd1 : Press down numpad decimal key

cmd2: Press down numpad decimal key
          Press down numpad 8

cmd3: Press down numpad decimal key
          Press down numpad 2

In another command I want to release the key down. Depending of the keys currently down.
That is why I want to know if it is possible to know in this new command which keys are down ? So that i do only one common function to release keys down.
e.g:
cmd_release : release {VAR:thiskey}

If this is not possible, can release all numpad keys even if they are not pressed ?
Hope have been clear enough.

Happy 2020.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4787
  • RTFM
A key release does not necessarily need to follow a key press, I.E. you can use release actions without making sure the keys they affect are actually pressed. Most applications will not react to that (unless you have one that is explicitly listening for a release).

E.G.
Code: [Select]
Release NumPad Decimal key
Release NumPad 8 key
Release NumPad 2 key

If you do prefer to check first, you can use the "Device State" tab of the "Begin a Conditional (If Statement) Block" action, E.G.
Code: [Select]
Begin Device State Check :  Keyboard Key 'Numeric .' Is Pressed
    Release NumPad Decimal key
End Condition
Begin Device State Check :  Keyboard Key 'Numeric 8' Is Pressed
    Release NumPad 8 key
End Condition
Begin Device State Check :  Keyboard Key 'Numeric 2' Is Pressed
    Release NumPad 2 key
End Condition

KAPAX

  • Newbie
  • *
  • Posts: 7
Ok done as said (release all concerned key - even if not pressed down beofore).
Thanks for helping.

One question : how can I write to log a integer or small integer variable. I can do it with txt variable but cannot figure out how to with other variables ?

OK found for INT :  {INT:hangarNumber} . Have to find for small integer.

Happy 2020