Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Keybinding with F* does not work anymore #9

Closed
crisidev opened this issue Sep 24, 2017 · 9 comments
Closed

Keybinding with F* does not work anymore #9

crisidev opened this issue Sep 24, 2017 · 9 comments

Comments

@crisidev
Copy link

Hello,
after the cleanup you did, all my keybinding using F* are not working anymore. I usually move through desktops with cmd + f[1-8] and they stopped working when I switched from stable 0.0.8 to HEAD.

I think there has been a regression. 0.0.8 works fine.

If I start HEAD version, the keystrokes are printed on the terminal. It seems skhd is not able to grab the keybinding when f* is involved.

If I change the keybinding to use numbers, like cmd + [1-8], everything works properly also with HEAD version.

@koekeishiya
Copy link
Owner

koekeishiya commented Sep 24, 2017

This is likely related to #8, and not the cleanup that came after.

@koekeishiya
Copy link
Owner

Confirmed this is related to the fn key. By default on MBP, the function keys are gated by the fn modifier. Thus, to bind a function key, you need to do the following: fn - f1 : say hello
This was not needed in previous versions, as the fn flag was not checked.

The sample bind above works fine. Now having to press fn every time to use a function key is annoying, so I assume you have enabled the "Use F1, F2, etc. keys as standard function keys" option in Keyboard settings. This option causes the system to silently add the fn flag to automatically generate the function key event. The binds must thus be registered in skhd with the fn modifier.

If you want alt - f1 : something, you need to register it in skhd as alt + fn - f1 : something.
I'm not sure if we could read the value of this setting during runtime and automatically add the flag at parsetime.

@crisidev
Copy link
Author

Ah, cool, fair enough. I'll update and change my configs as soon as I have some time.

@koekeishiya
Copy link
Owner

See #10 for proposed solution.

@crisidev
Copy link
Author

I can confirm, everything works fine adding the "fn" modifier.

@koekeishiya
Copy link
Owner

The latest version automatically supplies the fn flag for key-literals that have this set implicitly.

@crisidev
Copy link
Author

crisidev commented Oct 1, 2017

Does it also work if I have the fn modifier set in my config or should I remove it?

@koekeishiya
Copy link
Owner

That will work just fine as well.

@crisidev
Copy link
Author

crisidev commented Oct 1, 2017

Cool! Thanks

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

No branches or pull requests

2 participants