#pragma once #include #include "Mode.h" #define STEP_SIZE 3 #define MOVE_KEYS (KEY_2 | KEY_4 | KEY_6 | KEY_8 | KEY_3 | KEY_9) #define CLICK_KEYS (KEY_1 | KEY_7) class ModeMouse : public Mode { public: MouseMode() { m_setStep = false; m_step = 2; } void reset() {} Mode * update(unsigned int keys) { if (keys & KEY_STAR) return Mode::modes[0]; if (keys & KEY_HASH) { if (!m_setStep) { m_setStep = true; m_step = 1; } else { m_step *= 2; } return NULL; } m_setStep = false; if (keys & MOVE_KEYS) move(keys); else if (keys & CLICK_KEYS) click(keys); return NULL; } void move(unsigned int keys) { /* movement */ if (keys & KEY_2) { for (int i=0; i