The Hybred Input Abstraction Layer (HIAL). Creates generic input events from any supported Keyboard or Mouse device and sends these events to listeners. Some listeners are also included which can transform these input events (either syncronous or asyncronous) into a queue of events, a set of currently pressed keys/mouse buttons, or an array of key/mouse button states which can then be parsed when required.
It is possible for example, for a polled LWJGL keyboard to fire events (even asyncronously if you create a seperate thread to update the device) like
AWT events or for asyncronous AWT events to change the state of a key array which can then be iterated like using the isKeyDown method of LWJGL's
Keyboard. Other output options are a set of currently pressed keys/mouse buttons which can be iterated. Some listeners also have the concept of "sticky" keys.
Sticky keys are keys whose state remains pressed until manually cleared (usually when the input is processed). Sticky keys allow a hybred situation where
a mix of keys which must be caught are, and keys which are ok to miss are not. Example of a sticky key might be a "fire" button on a tank -- even if the key
is pressed very quickly, the tank should still fire. A non-sticky key could be an arrow key -- if the turn arrow key is pressed very quickly, the tank
shoudl not turn.
Almost all event related methods (those which are normally invoked several times a second) and indeed most other methods as well have an asymptotic complexity of O(1) (constant time performance) and create no new objects (so no excess garbage). The only exception to this is the KeySetListener which returns a new Iterator with a list of currently pressed keys, although the speed and excess garbage cost of this operation is minimal.