diff --git a/README.md b/README.md index a0f82910..466609c4 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,9 @@ properties (see below). * `Key_mouseScrollUp`, `Key_mouseScrollDn`: Scroll the mouse wheel up or down, respectively. - +* `Key_mouseScrollL`, `Key_mouseScrollR`: Scroll the mouse wheel left or right, + respectively. + ### Buttons Buttons are even simpler than movement: there is no movement speed, nor diff --git a/src/Kaleidoscope-MouseKeys.cpp b/src/Kaleidoscope-MouseKeys.cpp index a417f667..4455dde4 100644 --- a/src/Kaleidoscope-MouseKeys.cpp +++ b/src/Kaleidoscope-MouseKeys.cpp @@ -29,6 +29,10 @@ void MouseKeys_::scrollWheel(uint8_t keyCode) { kaleidoscope::hid::moveMouse(0, 0, wheelSpeed); else if (keyCode & KEY_MOUSE_DOWN) kaleidoscope::hid::moveMouse(0, 0, -wheelSpeed); + else if (keyCode & KEY_MOUSE_LEFT) + kaleidoscope::hid::moveMouse(0, 0, 0, -wheelSpeed); + else if (keyCode & KEY_MOUSE_RIGHT) + kaleidoscope::hid::moveMouse(0, 0, 0, wheelSpeed); } void MouseKeys_::loopHook(bool postClear) { diff --git a/src/MouseKeyDefs.h b/src/MouseKeyDefs.h index 9f5bdbc9..2a10af25 100644 --- a/src/MouseKeyDefs.h +++ b/src/MouseKeyDefs.h @@ -36,8 +36,8 @@ #define Key_mouseDnR (Key) { KEY_MOUSE_DOWN | KEY_MOUSE_RIGHT, KEY_FLAGS|SYNTHETIC|IS_MOUSE_KEY } #define Key_mouseScrollUp (Key) { KEY_MOUSE_WHEEL | KEY_MOUSE_UP, KEY_FLAGS|SYNTHETIC|IS_MOUSE_KEY } #define Key_mouseScrollDn (Key) { KEY_MOUSE_WHEEL | KEY_MOUSE_DOWN, KEY_FLAGS|SYNTHETIC|IS_MOUSE_KEY } -#define Key_mouseScrollL -#define Key_mouseScrollR +#define Key_mouseScrollL (Key) { KEY_MOUSE_WHEEL | KEY_MOUSE_LEFT, KEY_FLAGS|SYNTHETIC|IS_MOUSE_KEY } +#define Key_mouseScrollR (Key) { KEY_MOUSE_WHEEL | KEY_MOUSE_RIGHT, KEY_FLAGS|SYNTHETIC|IS_MOUSE_KEY } #define Key_mouseBtnL (Key) { KEY_MOUSE_BUTTON | KEY_MOUSE_BTN_L, KEY_FLAGS | SYNTHETIC | IS_MOUSE_KEY } #define Key_mouseBtnM (Key) { KEY_MOUSE_BUTTON | KEY_MOUSE_BTN_M, KEY_FLAGS | SYNTHETIC | IS_MOUSE_KEY } #define Key_mouseBtnR (Key) { KEY_MOUSE_BUTTON | KEY_MOUSE_BTN_R, KEY_FLAGS | SYNTHETIC | IS_MOUSE_KEY }