- All Implemented Interfaces:
- PollingDevice, RawDevice, AWTEventListener, KeyListener, EventListener
public class DeviceKeyboard
extends Object
implements RawDevice, KeyListener, AWTEventListener, PollingDevice
This driver mainly consists of a workaround for the keyboard auto-repeat:
Windows:
The auto-repeat on windows triggers repeating key-pressed events, and also
key-typed events which we ignore. So the only thing to do is to check the
last state of the key and only handle a key-pressed if the key was not
pressed before. This happens in poll().
Linux:
The auto-repeat on linux triggers repeating key-released/key-pressed events,
so we enqueue the occuring events and merge them if possible: When a
key-released event occurs, we check if there is a matching key-pressed event
in the queue - if yes ignore both events. Happens in handleEvent(..).
MacOS:
Seems to work!
Solaris etc.:
TODO!
Now this class also listens to mouse events and always checks if the status of
shift/ctrl/alt/algt_graph/meta has changed without a corresponding event.
- Author:
- Steffen Weissmann