Search code examples
c#winapikeyboard-shortcutspinvokehotkeys

RegisterHotkey Fn Modifier?


I know you can use CTRL, ALT, SHIFT, etc. modifiers for RegisterHotKey, but what about the Fn key?

I used to have some bloatware on my laptop that changed brightness when Fn+Up/Down was pressed. I removed all the bloatware, and I want to write a program that does the same thing.

Any help is appreciated!


Solution

  • Fn key is modifier but not software like ALT, SHIFT, etc. which are processed by operation system. Fn is hardware key modifier so it changes keycode keyboard sends to operation system.

    For example is 37 and Fn + is 36 so when you need to handle Fn + press you need to react on 36 keycode.

    PS. On some keyboards Fn key send keycode so it can be handled seperatly, but usualy they don't.