On Sat, 2005-10-22 at 21:13 -0500, Travis H. wrote:
> Strange they don't have *scan*codes, but probably not a problem.

Thanks for your reply.

Unfortunately it does seem to be a problem that there are no scancodes,
since as far as I can tell, the following is going on.

Pressing a key on a USB keyboard does not directly generate a scancode,
rather the kernel generates a keycode from the USB event.  Then, some
of the keycodes are translated back to emulated raw mode scan codes,
specifically for applications such as X, which want to read raw mode
scancodes.

The keys in question produce keycodes above 256, and so do not have
emulated raw mode scan codes,  so X sees no scancode, and does not
produce a X keycode.

I managed to get it working by using the evdev driver, which takes reads
the USB event stream, rather than the emulated raw mode scan codes:
https://bugs.freedesktop.org/show_bug.cgi?id=968

However, since the keys in question were generating event codes above
256, I had to kludge the driver by adding an extra set of special cases
for the range of keycodes (Otherwise the xf86 key events produced were
escape, and the number keys).  Here they produce keys F13 upwards.  I
changed evdev.c as follows:

154a155,169
>           case BTN_0:
>           case BTN_1:
>           case BTN_2:
>           case BTN_3:
>           case BTN_4:
>           case BTN_5:
>           case BTN_6:
>           case BTN_7:
>           case BTN_8:
>           case BTN_9:
>                 xf86PostKeyboardEvent(pInfo->dev,
>                                       ev.code - BTN_MISC + KEY_F13 +
>                                     MIN_KEYCODE, value);
>             break;
>


(I also tried using the evdev protocol for the xorg kbd driver,  but
this also throws away keycodes above 256.)

I'm sure there is a bug I should file on this somewhere,  but (other
than IBM for producing such a non-standard keyboard), I'm not sure
exactly where.


Jonathan
-- 
[EMAIL PROTECTED]                         http://www.mit.edu/~keeling
Phone: +1 617 253 3896



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to