linux-mips
[Top] [All Lists]

Re: DECstation keyboard mappings and XFree

To: Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: DECstation keyboard mappings and XFree
From: James Simmons <jsimmons@transvirtual.com>
Date: Mon, 11 Feb 2002 11:26:10 -0800 (PST)
Cc: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>, Karsten Merker <karsten@excalibur.cologne.de>, Linux/MIPS Development <linux-mips@oss.sgi.com>
In-reply-to: <Pine.GSO.4.21.0202111604400.13432-100000@vervain.sonytel.be>
Sender: owner-linux-mips@oss.sgi.com
> >  Then the kernel needs to be fixed -- raw scancodes should be passed as is
> > and the translation should be done in kbd_translate().  I'm adding it to
> > my to-do list (to be resolved soon, hopefully, together with the annoying
> > indefinite timeout when no keyboard is attached). 
> 
> The keyboard mid-layer assumes keycodes are in the range 1-127 (with some 
> minor
> hack 0 can be made to work, cfr. Amiga keboards). Bit 7 is used to
> differentiate between up and down events. This means you cannot get keyboards
> with more than 128 keys to work (e.g. some specialized keyboards for old
> workstations).
> 
> Perhaps it's different in the new input layer. I don't know.

With the input layer the below is translated to what the console system
wants. 

struct input_event {
        struct timeval time;
        unsigned short type;
        unsigned short code;
        unsigned int value;
};

The type field tells us if it is a key or mouse movement etc. 

The code field is the value of the key. For example if you press the A key
you would get KEY_A. Now buttons and keys are considered the same thing.
Because of this their is a range for keys and a range for buttons. At
present you can have up to 255 types of keys. For buttons and keys you can
have 0x1ff buttons.

Here the value field represents the states the key press can be in:

0: The key has been released.

1: The key has been pressed.

2: The key has been pressed again.




<Prev in Thread] Current Thread [Next in Thread>