Sunday, November 25, 2007

Input Manager

Input manager is not the main thing you need but its certainly a thing you should have, and its not so complicated to do, so i created input manager class that will handle questions like:
IsMouseButtonGoingDown/Up? IsMouseBottunUp?
IsKeyGoingDown/Up? IsKeyDown?
the 'going' notation is to indicate that we want to know if specific action is about to be triggered, for example: if we want to know when specific key is pressed, we use IsKeyGoingDown, but if the key already pushed and we want to now when we released him we use IsKeyGoingUp, at last if we want to perform some action as long as the key is down we just use IsKeyDown (same for mouse functions).
the input manager uses directinput8 to communicate with hardware devices such keyboard, mouse, joystick (for now i'm using only keyboard and mouse devices).
i also add support for keyboard layout, which allow me to distinguish between different input languages, so now you can type in other languages besides english.
still, i need to match the right font file in order to see the right characters, but this is just a matter of exporting new font texture.

No comments: