summaryrefslogtreecommitdiffstats
path: root/source/Concept/Framework/modules/input/mouse_sensor.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/Concept/Framework/modules/input/mouse_sensor.h')
-rwxr-xr-xsource/Concept/Framework/modules/input/mouse_sensor.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/source/Concept/Framework/modules/input/mouse_sensor.h b/source/Concept/Framework/modules/input/mouse_sensor.h
index 460e387..b3d1b1a 100755
--- a/source/Concept/Framework/modules/input/mouse_sensor.h
+++ b/source/Concept/Framework/modules/input/mouse_sensor.h
@@ -24,6 +24,8 @@ public:
this->configReset = 0;
this->configAwake = 0;
this->newImage = false;
+ this->positionX = 0;
+ this->positionY = 0;
}
Mouse_Sensor(uint32 sensorId)
@@ -47,6 +49,8 @@ public:
this->registerDeltaY = 0x02;
this->configReset = 0x80;
this->configAwake = 0x01;
+ this->positionX = -3.88f * TICKS_PER_CM;
+ this->positionY = -3.88f * TICKS_PER_CM;
break;
case IO_SENSOR_MOUSE_RIGHT:
this->hardwarePort = &PORTC;
@@ -61,6 +65,8 @@ public:
this->registerDeltaY = 0x02;
this->configReset = 0x80;
this->configAwake = 0x01;
+ this->positionX = -3.88f * TICKS_PER_CM;
+ this->positionY = 3.88f * TICKS_PER_CM;
break;
default:
this->hardwarePort = NULL;
@@ -101,8 +107,10 @@ protected:
uint8 registerDeltaY;
uint8 configReset;
uint8 configAwake;
+ //Information
+ float positionX;
+ float positionY;
-public:
void WriteByte(uint8 newByte)
{
*hardwareDDR |= pinSDA;//Set SDA output
@@ -180,6 +188,8 @@ public:
return pixel;
}
+
+public:
uint8 GetSqual()
{
return Read(registerSqual);
@@ -194,6 +204,16 @@ public:
{
return (int8)(Read(registerDeltaY));
}
+
+ float GetPositionX()
+ {
+ return positionX;
+ }
+
+ float GetPositionY()
+ {
+ return positionY;
+ }
};
#endif