(Fwd) Re: [Lcdproc] Handling key up events
Joris Robijn
joris@robijn.net
Mon Jun 2 21:23:03 2008
Sorry, I used wrong sender address.
------- Forwarded message follows -------
Subject: Re: [Lcdproc] Handling key up events
To: "Eric H. Johnson" <ejohnson@camalytics.com>
Date sent: Mon, 2 Jun 2008 18:00:32 +0200 (CEST)
Copies to: lcdproc@lists.omnipotent.net
Hello Eric,
Indeed, this feature has been discussed before. For a single client
situation the problem is not very difficult. Earlier proposed was
the same code as the "normal" key code, but then with a tilde ~
prepended (just like a destructor in C++). It is possible that there
is a patch somewhere that implements this behaviour.
At some point I (I think) realized that this would be a problem with
multiple clients. The client switch may occur at any time, including the
time that a key is pressed. Then the first client does not see the key
release code and thinks the key is still pressed, and the second client
suddenly receives a release code for a key that was not pressed...
These problems are solvable, under the condition that the server
understands about key release codes.
> This patch is fairly simple, first I added support for the auto-repeat
> function. The MO default mode will periodically (0.5 seconds, IIRC) resend
> the key so long as the key is being held. Setting the auto repeat mode to
> '1' results in a key returned on key press and key release. The released key
> will be the lower case version (add 0x20) of character returned on a key
> press. For example, key press returns 'C' and key release returns 'c'.
I think this is not generic enough. It cannot be performed on slightly
special chars like spaces or dots. Adding a sequence (like Up) is
already somewhat more generic.
I'm sure you can find a nice solution.
Joris
------- End of forwarded message ---------
Joris Robijn <joris@robijn.net>
Mobile: +31 6 288 41 964