1 #ifndef __mouse_input_h__
2 #define __mouse_input_h__
4 #include "../Common/Common.h"
5 #include "../DasherCore/DasherInput.h"
6 #include "../DasherCore/DasherTypes.h"
10 using namespace Dasher
;
12 class CDasherMouseInput
: public CDasherInput
{
14 CDasherMouseInput(CEventHandler
* pEventHandler
, CSettingsStore
* pSettingsStore
)
15 : CDasherInput(pEventHandler
, pSettingsStore
, 0, 0, _("Mouse Input")) {
21 // Fill pCoordinates with iN coordinate values, return 0 if the
22 // values were in screen coordinates or 1 if the values were in
23 // Dasher coordinates.
25 virtual int GetCoordinates(int iN
, myint
* pCoordinates
) {
27 pCoordinates
[0] = m_iX
;
28 pCoordinates
[1] = m_iY
;
33 // Get the number of co-ordinates that this device supplies
35 virtual int GetCoordinateCount() {
39 void SetCoordinates(myint _iX
, myint _iY
) {
50 static SModuleSettings sSettings
[] = {
51 {LP_YSCALE
, T_LONG
, 10, 2000, 1, 1, "Pixels covering Y range:"}
54 class CDasher1DMouseInput
:public CDasherInput
{
56 CDasher1DMouseInput(CEventHandler
* pEventHandler
, CSettingsStore
* pSettingsStore
)
57 : CDasherInput(pEventHandler
, pSettingsStore
, 2, 0, _("One Dimensional Mouse Input")) {
65 // Fill pCoordinates with iN coordinate values, return 0 if the
66 // values were in screen coordinates or 1 if the values were in
67 // Dasher coordinates.
69 virtual int GetCoordinates(int iN
, myint
* pCoordinates
) {
71 pCoordinates
[0] = m_iY
- m_iOffset
;// * m_iDasherMaxY / 1024; // FIXME - hard coded screen resolution!!!!!!!!!!
73 // std::cout << m_iY << " " << pCoordinates[0] << std::endl;
78 // Get the number of co-ordinates that this device supplies
80 virtual int GetCoordinateCount() {
84 virtual void SetMaxCoordinates(int iN
, myint
* iDasherMax
) {
86 // FIXME - need to cope with the more general case here
88 m_iDasherMaxX
= iDasherMax
[0];
89 m_iDasherMaxY
= iDasherMax
[1];
92 void SetCoordinates(myint _iX
, myint _iY
) {
97 void KeyDown(int iTime
, int iId
) {
99 m_iOffset
= m_iY
- 2048;
103 bool GetSettings(SModuleSettings
**pSettings
, int *iCount
) {
104 *pSettings
= sSettings
;
105 *iCount
= sizeof(sSettings
) / sizeof(SModuleSettings
);