[Lcdproc] Keystroke creation in hd44780-lcd2usb
Peter Marschall
peter@adpm.de
Thu Oct 4 13:02:01 2007
Hi Markus,
On Saturday, 29. September 2007, Markus Dolze wrote:
> recently I added input key processing to the hd44780-lcd2usb subdriver.
> Yesterday I found that my change has a side effect: I can create three
> different keystrokes with only two keys!
>
> Looking at how input is handled by LCDd I found this processing chain
> (here for hd44780-winamp):
>
> server/main:do_mainloop
> server/input:handle_input
> server/drivers:drivers_get_key
> server/drivers/hd44780:get_key
> server/drivers/hd44780:scankeypad (<= may be overriden by subdriver)
> server/drivers/hd44780-winamp:readkeypad (<= must be implemented in
> subdriver if scankeypad is not changed)
>
> In this example readkeypad() creates a bitmask of the pressed keys. This
> bitmask is filtered by scankeypad() so that only one key can be pressed
> at a time.
>
> For the lcd2usb subdriver I have overwritten the scankeypad() function
> returning the bitmask of the pressed keys without any further filtering.
> Therefore I can have three scancodes (only key 1 or key 2 pressed or
> both at the same time).
>
> This means that menues can be used with only two keys, if the third
> scancode is used as menukey! This is not possible with the winamp or
> 4bit wiring. As the lcd2usb device is equipped with two keys by default
> (more keys could be added if the firmware is changed), I would like to
> stay with this (I will add a hint to the documentation).
>
> Does this fit into lcdproc's model of operation?
I think this fits very well into LCDproc's operation model.
In my opinion LCDproc should not care about how a scancode
is generated physically.
I think this should be left to the driver resp. hardware.
Does this work with the current lcd2usb driver code or is there a further
patch necessary ?
If you have a documentation snippet I'd be happy to add it.
Thanks
Peter
--
Peter Marschall
peter@adpm.de