Developers following my twitter feed may already know that in the past few days, I’ve been working on a new component for the Nuclex Framework: Nuclex.Input. This component aims to solve all problems I ever had with input devices in XNA :)
It’s a very simple library that provides input device classes
similar to the ones in XNA (Keyboard,
Mouse,
GamePad),
but instead of 4 game pads, there are 8 (with indexes 5-8 for
DirectInput-based controllers). All input devices
provide events (like KeyPressed
and
CharacterEntered
on the keyboard or
MouseWheelRotated
on the mouse, for example).
Here’s a quick run down of the features:
-
Well-behaving keyboard text input
- Honors keyboard layout and system locale
- Supports XBox 360 chat pads
- Very easy to use: just subscribe to an event
-
Support for standard PC game controllers
- Works with any DirectInput-compatible controller
-
Mouse movement with sub-pixel accuracy(postponed)Finally put those expensive high-dpi mice to use ;-)
-
Allows event-based input handling
- Fully type-safe: events instead of message objects
- Only compares states if events have subscribers
- Mouse and keyboard don’t have to compare states at all
-
Zero garbage: doesn’t feed the garbage collector
- During usage, the library produces zero garbage
Curious? Click on “Read More” to view some code samples!
Read More