Jump to content
Noffica

Simulate arrow keystrokes

Recommended Posts

I would like to know if there is a way to simulate the left arrow and right arrow keys using other keystrokes.

 

Unfortunately, I was unable to fashion a working workflow from 

 

Edited by Noffica

Share this post


Link to post

To simulate a left or right arrow key press you can use the Dispatch Key Combo action inside the Output > Dispatch Key Combo menu.

 

Alternatively, you can use AppleScript, for example:

-- To execute a left arrow key press
tell application "System Events" to key code 123

-- To execute a right arrow key press
tell application "System Events" to key code 124

You can have a look here for some reference on key code: https://eastmanreference.com/complete-list-of-applescript-key-codes

Edited by GuiB

Share this post


Link to post

So, a Dispatch Key Combo connected to a Run NSApple Script containing the above code? What if I want the '1' num pad key to trigger the left arrow keystroke?

Share this post


Link to post
1 hour ago, Noffica said:

So, a Dispatch Key Combo connected to a Run NSApple Script containing the above code?

 

No. One or the other. They do the same thing.

 

1 hour ago, Noffica said:

What if I want the '1' num pad key to trigger the left arrow keystroke?

 

Alfred won't let you create a Hotkey for that key, so you'll have to use a different app and the AppleScript if you want to bind to a numpad key without a modifier.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...