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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×