I have created an input abstraction API.
It provides interfaces to hardware to remove dependancies on any one input API (currently AWT and LWJGL implementations are provided out of the box). It also allows input to be converted from one processing style to another (hence the "hybrid"). For example, you can use LWJGL-like keyboard state array query polling with AWT.
The time penalty for using this API as opposed to AWT or LWJGL directly is near zero (this is due to all critical methods being O(1) complexity and with zero garbage generation)*.
I created it for two reasons. Firstly is to provide an abstraction layer from the hardware devices. I need this now that Xith3D supports LWJGL
, and it also future proofs my code as I may again wish to switch input API's. The second is to provide handy processing of keyboard inputs with the concept of "sticky" keys. Prior to developing HIAL, I used a custom solution (which I previously wrote an article about
). HIAL provides this concept and expands it to alternative input processing (like key state arrays) which are faster again.
As a result of some tireless hours spent documenting: The API even has complete javadocs!
You can read more about it, look at examples, view the javadoc and download the code here: http://input.jtank.net.
I have released it under a BSD-like license.
* Conditions apply, one method does not follow this rule (but you don't have to use it).