[maemo-developers] N810 & FN key & X
From: Joni Valtanen jvaltane at kapsi.fiDate: Tue Mar 11 15:12:56 EET 2008
- Previous message: N810 & FN key & X
- Next message: N810 & FN key & X
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I only readed xomap code. So I'm not 100% sure about this.
But anyway - How it works with xomap:
1. read fn:s code from evdev (0x1d0)
2. put fn:s code (__u16) to KdEnqueeueKeyboardEvent-functions scan_code
(unsigned char). This looks dangerous and (propably) drops msbyte
away. only 0xd0 stays. How about "and" and "typecast"?
3. key_code = scan_code + KD_MIN_KEYCODE - ki->minScanCode
scan_code=0xd0, KD_MIN_KEYCODE=8, ki->minScanCode is propably 0
result: 0xd8 = 216 which can be found from
/usr/share/X11/xkb/keycodes/evdev as <FN>
...and same with sources
----------------------------
linux-kernel-headers/input.h
----------------------------
....
struct input_event {
struct timeval time;
__u16 type;
__u16 code;
__s32 value;
};
.....
-----------------------
hw/kdrive/linux/evdev.c
-----------------------
....
evdev_device_read(int evdevPort, void *closure)
{
...
struct input_event events[NUM_EVENTS];
...
case EV_KEY:
if (info->type == Keyboard)
KdEnqueueKeyboardEvent(info->device, events[i].code,
!events[i].value);
...
----------------------
hw/kdrive/src/kinput.c
----------------------
KdEnqueueKeyboardEvent(KdKeyboardInfo *ki,
unsigned char scan_code,
unsigned char is_up)
{
unsigned char key_code;
KeyClassPtr keyc = NULL;
KeybdCtrl *ctrl = NULL;
int type, nEvents, i;
...
key_code = scan_code + KD_MIN_KEYCODE - ki->minScanCode;
...
----------------------
hw/kdrive/src/kdrive.h
----------------------
...
#define KD_MIN_KEYCODE 8
...
- Joni
On Tue, 11 Mar 2008, Tuomas Kulve wrote:
>
> Hi
>
> The FN key on N810 keyboard seems to send (the standard FN) keycode 464
> which is a bit tricky as X doesn't support keycodes over 255 (afaik).
>
> HAL should be able to remap the keycodes using the EVIOCSKEYCODE with
> the ioctl but I get EINVAL on n810 and n800 when I try to use it. On my
> PC it works without errors.
>
> I wonder how's this done in Maemo's Xomap?
>
> --
> Tuomas
>
>
>
- Previous message: N810 & FN key & X
- Next message: N810 & FN key & X
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
