This driver mainly consists of a workaround for the keyboard auto-repeat:
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().
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(..).
Seems to work!
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.
Basically the actual constructor.
reads the config (from the RawDeviceConfig) and the viewer to set up a Device using Info of the config map. Note that in e.g. DeviceJinputController, the viwer is not even needed.
Perform polling for the device in this method.
This means for e.g. a controller: check all the states of the components and every time a change
has been found, add a ToolEvent to the ToolEventQueue that is shared with the ToolSystem.