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
) {
70 pCoordinates
[0] = m_iY
;
74 // Get the number of co-ordinates that this device supplies
76 virtual int GetCoordinateCount() {
80 virtual void SetMaxCoordinates(int iN
, myint
* iDasherMax
) {
81 // FIXME - need to cope with the more general case here
83 m_iDasherMaxX
= iDasherMax
[0];
84 m_iDasherMaxY
= iDasherMax
[1];
87 void SetCoordinates(myint iY
, myint iScale
) {
89 m_iY
= (iY
- m_iOffset
) * 4096 / iScale
+ 2048;
92 void KeyDown(int iTime
, int iId
) {
98 bool GetSettings(SModuleSettings
**pSettings
, int *iCount
) {
99 *pSettings
= sSettings
;
100 *iCount
= sizeof(sSettings
) / sizeof(SModuleSettings
);