Author Topic: Up, Down, Left, Right Keyboard Arrows  (Read 1914 times)

ernie-r

  • Newbie
  • *
  • Posts: 2
Up, Down, Left, Right Keyboard Arrows
« on: April 10, 2020, 12:24:44 PM »
Hi, I have the mouse move [Move;stop] mouse [left;right;up;down;] command working sweet, but wondered if I could achieve the same with the Up, Down, Left, Right keyboard arrow keys that could act as [walk/step] person [forward,Left,Right,back]. Helping lady with degenerative spatisia play games for the very first time using primarily voice only (Myst Classic to ease her into it); classic click and move working great, want to include the free roam mode too.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Up, Down, Left, Right Keyboard Arrows
« Reply #1 on: April 10, 2020, 12:39:43 PM »
You can have keys held down indefinitely (I.E. you don't need a loop like you would when moving the mouse cursor) using the "Press Key(s)" option of the keypress action, then use the "Release Key(s)" option when you want to stop

In most applications, a release does not necessarily need to follow a press, and a press can apply to the same key without a release in between, so you can do something like
Code: [Select]
Begin Text Compare : [{CMD}] Contains 'forward'
    Release Down key
    Release Left key
    Release Right key
    Press down Up key
Else If Text Compare : [{CMD}] Contains 'back'
    Release Up key
    Release Left key
    Release Right key
    Press down Down key
Else If Text Compare : [{CMD}] Contains 'left'
    Release Right key
    Press down Left key
Else If Text Compare : [{CMD}] Contains 'right'
    Release Left key
    Press down Right key
Else
    Release Up key
    Release Down key
    Release Left key
    Release Right key
End Condition

ernie-r

  • Newbie
  • *
  • Posts: 2
Re: Up, Down, Left, Right Keyboard Arrows
« Reply #2 on: April 12, 2020, 03:50:45 AM »
Awesome, thank you. Has also stretched my mind somewhat to work in other multiple moving/action cmds using fewer cmds too.  8)