Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Simulating arrow key presses #330

Open
milesromeno opened this issue Jan 6, 2024 · 1 comment
Open

Simulating arrow key presses #330

milesromeno opened this issue Jan 6, 2024 · 1 comment

Comments

@milesromeno
Copy link

milesromeno commented Jan 6, 2024

In my .skhdrc I am attempting to bind lcmd + jikl to emulate arrow keys. I use the keywords up,left,down,right following keywords (modifiers and literals) #1

lcmd - i : up
lcmd - j : left
lcmd - k : down
lcmd - l : right

I save and run skhd -V, but I am getting the error Unknown command

hotkey :: #131 {
	mod: 'lcmd'
	key: 'i' (0x22)
	cmd: 'up'
}
hotkey :: #132 {
	mod: 'lcmd'
	key: 'j' (0x26)
	cmd: 'left'
}
hotkey :: #133 {
	mod: 'lcmd'
	key: 'k' (0x28)
	cmd: 'down'
}
hotkey :: #134 {
	mod: 'lcmd'
	key: 'l' (0x25)
	cmd: 'right'
}
skhd: watching files for changes:
	/Users/MYUSER/.skhdrc
fish: Unknown command: left
fish: 
left
^~~^
fish: Unknown command: up
fish: 
up
^^
fish: Unknown command: down
fish: 
down
^~~^
fish: Unknown command: right
fish: 
right
^~~~^

Is skhd capable of simulating arrow key presses? If so, how can I correct my config?

@milesromeno milesromeno changed the title Simulating arrow keys fails Simulating arrow key presses Jan 6, 2024
@governorgoat
Copy link

The hint is Unknown command... If you want to simulate keypresses you can use skhd directly with the -k flag

hotkey :: #131 {
	mod: 'lcmd'
	key: 'i' (0x22)
	cmd: 'skhd -k "up"'
}
hotkey :: #132 {
	mod: 'lcmd'
	key: 'j' (0x26)
	cmd: 'skhd -k "left"'
}
hotkey :: #133 {
	mod: 'lcmd'
	key: 'k' (0x28)
	cmd: 'skhd -k "down"'
}
hotkey :: #134 {
	mod: 'lcmd'
	key: 'l' (0x25)
	cmd: 'skhd -k "right"'
}

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants