fredag 28 augusti 2009

I can't believe I am writing about Actions again

...but here goes.
I have spend some time rebuilding the action system for the gazilionth time but now I have ended up with something I can live with for a couple of months. I think. Anyway, it basically works like any UI system you have come across - you have a bunch of actions and you bind keys to it. What I added this time is the ability to bind hotkeys, like CTRL+S. For now I store the modifiers (CTRL, ALT, etc) and their states in an 8-bit int along with the keycode (total of 16 bits). This limits the number of modifiers to 8 and is really meant to be used only with the standard keyboard modifiers. I know I may have to change it in the future to allow other input devices like game pads to have modifiers. For now the modifiers are all hardcoded keyboard ones and that's pretty much unacceptable. For example I know many of you (and I) use Mouse Click + Scroll in some applications. So why build this in the first place? Well, I needed the basic functionality and it's still very easy to expand and/or change.

The major change for this update is really that I have added to types of events, DigitalInputEvent and AnalogInputEvent to remove any bias towards keyboards or mice. Basically to add a new device type (say a wii-mote) you inherit the InputDevice class and specify what goes into the events. The digital ones are meant for buttons and keys. The analog is basically anything else, mostly related to movement I guess.
All for now.

Inga kommentarer: