home *** CD-ROM | disk | FTP | other *** search
/ Game.EXE 2002 June / Game.EXE_06_2002.iso / Alawar / Lib / InputForGameExe / InputDeviceWindowsMouse.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2002-04-26  |  742 b   |  31 lines

  1. #include "InputDeviceWindowsMouse.h"
  2. #include "InputManagerPtr.h"
  3.  
  4. void InputDeviceWindowsMouse::mouse_up(int key)
  5. {
  6.     String name = (key == 0) ? "Left Button" : "Right Button";
  7.     InputManagerPtr()->add_key_event( InputKeyEvent( get_name(), name, InputKeyEvent::RELEASE ) );
  8. }
  9.  
  10. void InputDeviceWindowsMouse::mouse_down(int key)
  11. {
  12.     String name = (key == 0) ? "Left Button" : "Right Button";
  13.     InputManagerPtr()->add_key_event( InputKeyEvent( get_name(), name, InputKeyEvent::PRESS ) );
  14. }
  15.  
  16. void InputDeviceWindowsMouse::mouse_move(int x, int y)
  17. {
  18.     mouse_x = x;
  19.     mouse_y = y;
  20. }
  21.  
  22. String InputDeviceWindowsMouse::get_type()const
  23. {
  24.     return "Mouse";
  25. }
  26.  
  27. String InputDeviceWindowsMouse::get_name()const
  28. {
  29.     return "Mouse";
  30. }
  31.