Page 1 of 1
Add "FN Button" to simulated keys list
Posted: Wed Aug 28, 2013 3:00 am
by konfuzius
http://upload.wikimedia.org/wikipedia/c ... fn_key.png
FN + F1 = touchpad buttons off
FN + F2 = LCD off
FN + F5/F6 = Volume +/-
FN + F8/F9 = Brightness +/-
FN + F11 = WiFi
FN + F12 = BT
FN + Ins = Scrolllock
FN + Del = Numlock
...
F0, FN, Fn, Apps are not FN, unfortunately o_O
Re: Add "FN Button" to simulated keys list
Posted: Wed Aug 28, 2013 1:47 pm
by phil
I wish it was that easy - because my laptop has a similar key. However, as far as I am aware (and I could be wrong) that key does not send the usual scancode. You can already use ANY scancode/virtual key code in sim keys, but if the key does not generate such a code, then the windows API will not recognise it.
I will have to do some more investigation on this one so I will add it to the to-do list, but in the meantime if you can find a scancode/virtual keycode (maybe someone at AutoHotkey may know) then you can already send it in simulated keystrokes.
Thanks,
Phil
Re: Add "FN Button" to simulated keys list
Posted: Wed Aug 28, 2013 7:43 pm
by konfuzius
What I found
Fn is not a normal keyboard key, such as the modifiers Ctrl, Shift and AltGr. For a standard modifier key, the microcontroller inside the keyboard sends a scancode for the modifier itself, which is then interpreted by the operating system and combined with other simultaneous key-presses. The Fn key is a form of meta-modifier key, in that it causes the operating system to see altered scancodes when other keys on the keyboard are pressed. This allows the keyboard to directly emulate a full-sized keyboard, so the operating system can use standard keymaps designed for a full-sized keyboard. However, because the operating system has no notion of the Fn key, the key can not normally be remapped in software, unlike all other standard keyboard keys.
Ahhh-ha.
But.
http://www.daonlyfreez.net/tutorials/3p/Veil/fnkey.htm
https://code.google.com/p/uawks/downloads/list fnmapper.ahk inside
Re: Add "FN Button" to simulated keys list
Posted: Wed Aug 28, 2013 7:49 pm
by phil
Right, and from the first link you posted....
The Fn key works a bit different. When you press and hold the Fn key, it'll change the scan codes of (some of) the other keys on the keyboard.
So its not as simple as all that, and the sendinput API clearly wont allow just to send a FN key. Which pretty much means without a significant change to XMBC, its not going to be easy to add this support.
Maybe its just a case of setting another bit in the simkey sequences, but turing it on and off - well maybe it can be done, and I will look, but its going to be a change, and not currently possible in XMBC.
Thanks,
Phil
Re: Add "FN Button" to simulated keys list
Posted: Thu Aug 29, 2013 1:23 am
by phil
OK I've been doing some more research. It seems that the SendInput API can not send the Fn key (as I suspected). The Fn key is a hard wired key that modifies the scan codes of other keys on the keyboard. So your best bet is to work out what scancodes are sent when the Fn key + other key is pressed.
However, on my laptop, the keys pressed with Fn held down do not even come through (are not recognised by windows). This may be because the key is hooked at a lower level by the software supplied with the laptop and remapped in there.
Sorry about that, but there is very little information to go by that I can find with google. The links you sent all seem to be related to remapping keys sent with Fn pressed rather that actually sending a Fn+key combo?.
Thanks,
Phil