00001 00002 //Luke Lenhart, 2008 00003 //See /docs/License.txt for details on how this code may be used. 00004 00005 #pragma once 00006 #include "../base/Types.h" 00007 #include "Unified.h" 00008 #include <vector> 00009 00010 namespace INPUT 00011 { 00013 namespace MOUSE 00014 { 00015 const uint8 LEFT_BUTTON=1; 00016 const uint8 RIGHT_BUTTON=2; 00017 const uint8 MIDDLE_BUTTON=3; 00018 const uint8 EXTENDED_BUTTON0=4; 00019 const uint8 EXTENDED_BUTTON1=5; 00020 const uint8 EXTENDED_BUTTON2=6; 00021 const uint8 EXTENDED_BUTTON3=7; 00022 const uint8 EXTENDED_BUTTON4=8; 00023 const uint8 EXTENDED_BUTTON5=9; 00024 const uint8 EXTENDED_BUTTON6=10; 00025 const uint8 EXTENDED_BUTTON7=11; 00026 const uint8 EXTENDED_BUTTON8=12; 00027 const uint8 EXTENDED_BUTTON9=13; 00028 00030 inline UnifiedButton GetUnifiedButton(uint8 button) 00031 { 00032 return UnifiedButton(MOUSE_DEVICE, button); 00033 } 00034 00036 const std::string& GetFriendlyName(uint8 button); 00037 00039 bool IsButtonDown(uint8 button); 00040 00042 const std::vector<uint8>& GetCurrentlyPressedButtons(); 00043 00045 const std::vector<uint8>& GetNewlyPressedButtons(); 00046 00048 int GetWheelDirection(); 00049 00051 struct MousePixelPosition 00052 { 00053 sint16 X; 00054 sint16 Y; 00055 00056 inline bool operator==(const MousePixelPosition &o) const 00057 { return X==o.X && Y==o.Y; } 00058 inline bool operator!=(const MousePixelPosition &o) const 00059 { return !(*this==o); } 00060 }; 00061 00063 struct MouseScaledPosition 00064 { 00065 float X; 00066 float Y; 00067 00068 inline bool operator==(const MouseScaledPosition &o) const 00069 { return X==o.X && Y==o.Y; } 00070 inline bool operator!=(const MouseScaledPosition &o) const 00071 { return !(*this==o); } 00072 }; 00073 00075 MouseScaledPosition GetScaledPosition(); 00076 00078 const std::vector<MouseScaledPosition>& GetScaledTrail(); 00079 00081 MousePixelPosition GetPixelPosition(); 00082 00084 const std::vector<MousePixelPosition>& GetPixelTrail(); 00085 00086 //TODO: Mouse mode (os control in absolute mode, or we capture and provide relative mode data) (we are always absolute for now) 00087 //TODO: Cursor image control 00088 } 00089 }