This is the mail archive of the
cygwin-xfree@cygwin.com
mailing list for the Cygwin XFree86 project.
Behavior of Keyboard
- To: XFree86/Cygwin Mailing list <cygwin-xfree at sources dot redhat dot com>
- Subject: Behavior of Keyboard
- From: Alexander Gottwald <Alexander dot Gottwald at informatik dot tu-chemnitz dot de>
- Date: Sun, 1 Apr 2001 10:47:56 +0200 (MEST)
Hi,
In the next days I want to change the handling of keypresses when
the server gets focus or loses focus and wanted to ask what behavior
is expected from the server.
Losing focus:
- All pressed keys generate a KeyRelease Message
Getting Focus
- All pressed keys generate a KeyPress Message
or keeping track of changes between lose focus and get focus and
generate the KeyRelease/KeyPress only if something has changed.
eg. Pressing the 'a' and 'b' key and switching tasks, releasing 'a',
switching back to XWin and release 'b' would generate the following event:
a) KeyPress 'a'
KeyPress 'b'
Lose Focus
KeyRelease 'a'
KeyRelease 'b'
...
Get Focus
KeyPress 'b'
...
KeyRelease 'b'
b) KeyPress 'a'
KeyPress 'b'
Lose Focus
...
GetFocus
KeyRelease 'a'
...
KeyRelease 'b'
The most important is, that we a) has as much KeyReleases as KeyPresses and
b) don't have X thinking a key is still pressed but it's not.
Is it necesary to keep track of the windows num-, caps- and scroll
lock or is it better to keep it's own state (as for instance VMWare
does) and setting the states temporary and restoring the windows state
on losing focus?
Bye
ago
--
Alexander.Gottwald@informatik.tu-chemnitz.de
http://www.gotti.org
+49 3725 3498080