4

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!

Neysor
  • 3,893
  • 11
  • 34
  • 66
user1318657
  • 73
  • 1
  • 4
  • Yes. See http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx, http://msdn.microsoft.com/en-us/library/windows/desktop/ms646309(v=vs.85).aspx – Mitch Wheat Apr 07 '12 at 06:03
  • Try this related question http://stackoverflow.com/questions/2777796/how-to-catch-the-fn-keys-on-laptop – RRUZ Apr 07 '12 at 06:19
  • The Virtual Keycodes don't include anything for Fn keys. – user1318657 Apr 07 '12 at 21:53

1 Answers1

7

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.

Neysor
  • 3,893
  • 11
  • 34
  • 66
Pavel Krymets
  • 6,253
  • 1
  • 22
  • 35