|
|
@ -29,7 +29,7 @@
|
|
|
|
#include "kaleidoscope/key_defs.h" // for Key, SYNTHETIC
|
|
|
|
#include "kaleidoscope/key_defs.h" // for Key, SYNTHETIC
|
|
|
|
#include "kaleidoscope/keyswitch_state.h" // for keyToggledOn
|
|
|
|
#include "kaleidoscope/keyswitch_state.h" // for keyToggledOn
|
|
|
|
#include "kaleidoscope/plugin/mousekeys/MouseKeyDefs.h" // for KEY_MOUSE_BUTTON, KEY_MOUS...
|
|
|
|
#include "kaleidoscope/plugin/mousekeys/MouseKeyDefs.h" // for KEY_MOUSE_BUTTON, KEY_MOUS...
|
|
|
|
#include "kaleidoscope/plugin/mousekeys/MouseWrapper.h" // for MouseWrapper, wrapper, WAR...
|
|
|
|
#include "kaleidoscope/plugin/mousekeys/MouseWrapper.h" // for MouseWrapper, WARP_DOWN
|
|
|
|
|
|
|
|
|
|
|
|
namespace kaleidoscope {
|
|
|
|
namespace kaleidoscope {
|
|
|
|
namespace plugin {
|
|
|
|
namespace plugin {
|
|
|
@ -226,6 +226,7 @@ void MouseKeys::sendMouseWarpReport(const KeyEvent &event) const {
|
|
|
|
void MouseKeys::sendMouseMoveReport() const {
|
|
|
|
void MouseKeys::sendMouseMoveReport() const {
|
|
|
|
int8_t dx = 0;
|
|
|
|
int8_t dx = 0;
|
|
|
|
int8_t dy = 0;
|
|
|
|
int8_t dy = 0;
|
|
|
|
|
|
|
|
|
|
|
|
uint8_t direction = directions_ & cursor_mask_;
|
|
|
|
uint8_t direction = directions_ & cursor_mask_;
|
|
|
|
|
|
|
|
|
|
|
|
if (direction != 0) {
|
|
|
|
if (direction != 0) {
|
|
|
@ -271,6 +272,7 @@ uint8_t accelFactor(uint8_t accel_step) {
|
|
|
|
return 1 + (y >> 7);
|
|
|
|
return 1 + (y >> 7);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
uint16_t remaining_steps = 256 - accel_step;
|
|
|
|
uint16_t remaining_steps = 256 - accel_step;
|
|
|
|
|
|
|
|
|
|
|
|
uint16_t y = remaining_steps * remaining_steps;
|
|
|
|
uint16_t y = remaining_steps * remaining_steps;
|
|
|
|
return 255 - (y >> 7);
|
|
|
|
return 255 - (y >> 7);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -346,6 +348,7 @@ uint8_t MouseKeys::cursorDelta() const {
|
|
|
|
void MouseKeys::sendMouseWheelReport() const {
|
|
|
|
void MouseKeys::sendMouseWheelReport() const {
|
|
|
|
int8_t dh = 0;
|
|
|
|
int8_t dh = 0;
|
|
|
|
int8_t dv = 0;
|
|
|
|
int8_t dv = 0;
|
|
|
|
|
|
|
|
|
|
|
|
uint8_t direction = directions_ >> wheel_offset_;
|
|
|
|
uint8_t direction = directions_ >> wheel_offset_;
|
|
|
|
|
|
|
|
|
|
|
|
if (direction != 0) {
|
|
|
|
if (direction != 0) {
|
|
|
|