Index: [thread] [date] [subject] [author]
  From: Marcus Sundberg <mackan@stacken.kth.se>
  To  : ggi-develop@eskimo.com
  Date: Wed, 26 May 1999 20:16:05 +0000

Re: Keys & leds & bell & input driver stuffs

John Weismiller wrote:
> 
> Hello all,
> 
> I'm progressing pretty well on the lk201/lk401 keyboard driver, but I have
> some questions on the basics of gii.
> 
> First, what is the best way to encode the labels with the modifiers to
> form the sym field of the key event?  A presume that the best approach
> would be to use a table?  Perhaps one table for each label with the shift
> modifier down, one for caps, and one for control?

It depends on how serious you want to do it, but a table is really only
useful for the keycode --> label mapping. Constructing the "sym" and
"modifiers" are best done with ifs and switch statements, because 
there are so many different combinations. A basic keyboard driver
should at least handle shift, caps, control and numlock properly.
(More complex stuff include handling the mapping of different symbols
to Alt+<key>, dead key handling, compose handling, and AltGR handling,
but as those are highly dependant on what keymap you are using they
are probably best handled by the keytrans filter.)

Another alternative which you might want to consider is mapping the
keycodes into Linux keycodes, and using code from input-linux-kbd
to do proper mapping. It has the advantage that the user will get
the same keymap that he has in Linux without addidional configuration,
but the disadvantage of not being usable on non-linux platforms.

You can find some useful code, and also get an idea of how the sym
field works, in the input/linux_kbd/linkey.c and input/x/xec.c

> Next, my keyboard has some neato features, such as keyclick, bell, leds,
> etc, all of which X supports.  Does XGGI implement these?  Can these be
> done via an input driver on libgii?  I guess that some sort of event must
> be sent to the input driver?  A command event perhaps?

Andy already answered this, I just want to add that leds can and
should be handled internally by the keyboard driver.

//Marcus
-- 
-------------------------------+------------------------------------
        Marcus Sundberg        | http://www.stacken.kth.se/~mackan/
 Royal Institute of Technology |       Phone: +46 707 295404
       Stockholm, Sweden       |   E-Mail: mackan@stacken.kth.se

Index: [thread] [date] [subject] [author]