XNA Input Event Generator Component


As you must know, the input system in XNA GS is based on IF statements. This is simple but when your game/project grows, it turns the source chaotic and maybe for each frame you may need to test the same key/button several times in different objects.

So, we made a very useful component to solve this problem. Whis this you can separate input code from update code and only the classes that subscribe some type of events, will be notified.

This component supports three types of events:
- Button/Key Pressed
- Button/Key Released
- Button/Key On Hold - This hold has a default time of 1 second, you can change it.

GamePad, Keyboard and Mouse are supported.
Analog controllers, like thumbsticks and triggers have different types of events. For each new value, a new event is triggered. So when you move your thumbstick, several events are raised.

You can improve everything and extend this component, if you do it, send it to our email, please! ;)

New Version Released -> Change Log:
Version 1.2 - 05 July 2009
FIXED - GamePad negative values don't generate events
FIXED - XBOX 360 don't copile
ADDED - XBOX360 Solution
Version 1.1.2 - 04 April 2009
FIXED - NullPointerException
Version 1.1 - 03 April 2009
FIXED - Bug in detecting gamepad release buttons event
CHANGED - Now Key/Button Pressed event, is continuously raised while key/button is down.


Make A Comment


Anonymous said...

Are you offering this example as open source by chance?

3D Gaming and Programming said...

Yes, you're free to use and modify the code we posted. If you happen to improve something please send it to us! ;)

Anonymous said...

The young mother was seen sporting a classic hermes handbag , complete with her little doggy! On a shopping trip, the singer paired her black replica Hermes handbags with a sheer, purple dress. Even after a little fender bender, all that was noticeable was Spears’ discount Hermes handbags in the center of the paparazzo’s shots.
Herbal lida daidaihua has side effects too and if daidaihua contains ingredients that you know you can’t tolerate or interact with other medication you are on, simply don’t use lida slimming . Also keep to the recommended slimming capsule dose. The herbal slimming capsules market place is not regulated, which means there are many actors on the stage whose lida sole purpose is to make short term money and nothing else.
And choosing replica Chanel handbags do not mean you are compromising the quality. Chanel handbag also have excellent quality as well as the Chanel .
The main Tiffany co store often engage in special deals with third party retail shops so that the latter will sell only official Tiffany sets . These special deals may include discount silver sets pieces which can be passed on to the retails shop’s customers. This is the brand’s way of encouraging its retail partners to stay away from Tiffany charms products.

boy labyog said...

Emensuits is the new but top seller web site in terms of Suit supply.For example zoot suit and all kinds of suit.

Post a Comment