diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-05-18 12:20:19 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-05-27 15:26:57 +1000 |
commit | e9d96e87acbd79b22837ac4b225ceb0bd0e1942e (patch) | |
tree | 0eb4390246abd3cba3f25ccb21effcbcdd3280c8 /src/evdev.h | |
parent | Export product/vendor ID through a property. (diff) | |
download | xf86-input-evdev-e9d96e87acbd79b22837ac4b225ceb0bd0e1942e.tar.gz xf86-input-evdev-e9d96e87acbd79b22837ac4b225ceb0bd0e1942e.tar.bz2 xf86-input-evdev-e9d96e87acbd79b22837ac4b225ceb0bd0e1942e.zip |
Add a property to toggle function key mode
On some keyboards, the multimedia function keys are overlaid with the F
keys. This property enables clients to switch the primary mode of these F
keys between function keys and multimedia keys.
Some keyboards provide an Fn key to toggle between the modes. This is
hardware-specific and may or may not work on any given keyboard device.
The current imlementation is only hooked up to apple keyboards.
The kernel provides a tweak to enable/disable.
/sys/module/hid_apple/parameters/fnmode
0 .. keyboard sends Fx keys, Fn disabled
1 .. keyboard sends multimedia keys, Fn toggles to function keys
2 .. keyboard sends function keys, Fn toggles to multimedia keys
If fnmode is on 0, we force it to 2.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Diffstat (limited to 'src/evdev.h')
-rw-r--r-- | src/evdev.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/evdev.h b/src/evdev.h index 1741e59..ff50d0a 100644 --- a/src/evdev.h +++ b/src/evdev.h @@ -85,6 +85,13 @@ /* Number of longs needed to hold the given number of bits */ #define NLONGS(x) (((x) + LONG_BITS - 1) / LONG_BITS) +/* Function key mode */ +enum fkeymode { + FKEYMODE_UNKNOWN = 0, + FKEYMODE_FKEYS, /* function keys send function keys */ + FKEYMODE_MMKEYS, /* function keys send multimedia keys */ +}; + /* axis specific data for wheel emulation */ typedef struct { int up_button; @@ -197,6 +204,8 @@ typedef struct { /* Event queue used to defer keyboard/button events until EV_SYN time. */ int num_queue; EventQueueRec queue[EVDEV_MAXQUEUE]; + + enum fkeymode fkeymode; } EvdevRec, *EvdevPtr; /* Event posting functions */ @@ -243,4 +252,5 @@ void EvdevMBEmuInitProperty(DeviceIntPtr); void Evdev3BEmuInitProperty(DeviceIntPtr); void EvdevWheelEmuInitProperty(DeviceIntPtr); void EvdevDragLockInitProperty(DeviceIntPtr); +void EvdevAppleInitProperty(DeviceIntPtr); #endif |