gxinput.h 896 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef GXINPUT_H
  2. #define GXINPUT_H
  3. #include <dinput.h>
  4. #include "gxdevice.h"
  5. class gxRuntime;
  6. class gxInput{
  7. public:
  8. gxRuntime *runtime;
  9. IDirectInput7 *dirInput;
  10. gxInput( gxRuntime *runtime,IDirectInput7 *di );
  11. ~gxInput();
  12. void reset();
  13. bool acquire();
  14. void unacquire();
  15. void wm_keydown( int key );
  16. void wm_keyup( int key );
  17. void wm_mousedown( int key );
  18. void wm_mouseup( int key );
  19. void wm_mousemove( int x,int y );
  20. void wm_mousewheel( int dz );
  21. private:
  22. /***** GX INTERFACE *****/
  23. public:
  24. enum{
  25. ASC_HOME=1,ASC_END=2,ASC_INSERT=3,ASC_DELETE=4,
  26. ASC_PAGEUP=5,ASC_PAGEDOWN=6,
  27. ASC_UP=28,ASC_DOWN=29,ASC_RIGHT=30,ASC_LEFT=31
  28. };
  29. void moveMouse( int x,int y );
  30. gxDevice *getMouse()const;
  31. gxDevice *getKeyboard()const;
  32. gxDevice *getJoystick( int port )const;
  33. int getJoystickType( int port )const;
  34. int numJoysticks()const;
  35. int toAscii( int key )const;
  36. };
  37. #endif