MPMA Framework 0.4
Mouse.h
Go to the documentation of this file.
00001 
00002 //Luke Lenhart, 2008
00003 //See /docs/License.txt for details on how this code may be used.
00004 
00005 #pragma once
00006 
00007 #include "../base/Setup.h"
00008 
00009 #ifdef MPMA_COMPILE_INPUT
00010 
00011 #include "../base/Types.h"
00012 #include "Unified.h"
00013 
00014 #include <vector>
00015 
00016 namespace INPUT
00017 {
00019     namespace MOUSE
00020     {
00021         const uint8 LEFT_BUTTON=1; 
00022         const uint8 RIGHT_BUTTON=2; 
00023         const uint8 MIDDLE_BUTTON=3; 
00024         const uint8 EXTENDED_BUTTON0=4; 
00025         const uint8 EXTENDED_BUTTON1=5; 
00026         const uint8 EXTENDED_BUTTON2=6; 
00027         const uint8 EXTENDED_BUTTON3=7; 
00028         const uint8 EXTENDED_BUTTON4=8; 
00029         const uint8 EXTENDED_BUTTON5=9; 
00030         const uint8 EXTENDED_BUTTON6=10; 
00031         const uint8 EXTENDED_BUTTON7=11; 
00032         const uint8 EXTENDED_BUTTON8=12; 
00033         const uint8 EXTENDED_BUTTON9=13; 
00034         const uint8 WHEEL_UP=14; 
00035         const uint8 WHEEL_DOWN=15; 
00036 
00038         const std::string& GetFriendlyName(uint8 button);
00039 
00041         const std::string& GetPersistentIdentifier(uint8 key);
00042 
00044         uint8 FindButton(const std::string &persistentIdentifier);
00045 
00047         bool IsButtonDown(uint8 button);
00048 
00050         bool IsButtonNewlyPressed(uint8 button);
00051 
00053         const std::vector<uint8>& GetCurrentlyPressedButtons();
00054 
00056         const std::vector<uint8>& GetNewlyPressedButtons();
00057 
00059         int GetWheelDirection();
00060 
00062         struct MousePixelPosition
00063         {
00064             sint16 X;
00065             sint16 Y;
00066 
00067             inline bool operator==(const MousePixelPosition &o) const 
00068                 { return X==o.X && Y==o.Y; }
00069             inline bool operator!=(const MousePixelPosition &o) const 
00070                 { return !(*this==o); }
00071         };
00072 
00074         struct MouseScaledPosition
00075         {
00076             float X;
00077             float Y;
00078 
00079             inline bool operator==(const MouseScaledPosition &o) const 
00080                 { return X==o.X && Y==o.Y; }
00081             inline bool operator!=(const MouseScaledPosition &o) const 
00082                 { return !(*this==o); }
00083         };
00084 
00086         MouseScaledPosition GetScaledPosition();
00087 
00089         const std::vector<MouseScaledPosition>& GetScaledTrail();
00090 
00092         MousePixelPosition GetPixelPosition();
00093 
00095         const std::vector<MousePixelPosition>& GetPixelTrail();
00096 
00097         //TODO: Mouse mode (os control in absolute mode, or we capture and provide relative mode data) (we are always absolute for now)
00098         //TODO: Cursor image control
00099     }
00100 }
00101 
00102 #endif //#ifdef MPMA_COMPILE_INPUT
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends