Run IWYU & format code for MouseKeys

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/1126/head
Michael Richters 2 years ago
parent 5f5b715f8e
commit 150edb5fc3
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -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) {

@ -22,7 +22,6 @@
#include "kaleidoscope/event_handler_result.h" // for EventHandlerResult #include "kaleidoscope/event_handler_result.h" // for EventHandlerResult
#include "kaleidoscope/key_defs.h" // for Key #include "kaleidoscope/key_defs.h" // for Key
#include "kaleidoscope/plugin.h" // for Plugin #include "kaleidoscope/plugin.h" // for Plugin
// ============================================================================= // =============================================================================
// Deprecated MousKeys code // Deprecated MousKeys code
#include "kaleidoscope_internal/deprecations.h" // for DEPRECATED #include "kaleidoscope_internal/deprecations.h" // for DEPRECATED
@ -66,7 +65,6 @@ namespace kaleidoscope {
namespace plugin { namespace plugin {
class MouseKeys : public kaleidoscope::Plugin { class MouseKeys : public kaleidoscope::Plugin {
public: public:
#ifndef NDEPRECATED #ifndef NDEPRECATED
DEPRECATED(MOUSEKEYS_SPEED) DEPRECATED(MOUSEKEYS_SPEED)
static uint8_t speed; static uint8_t speed;

@ -16,7 +16,7 @@
#include "kaleidoscope/plugin/mousekeys/MouseWrapper.h" #include "kaleidoscope/plugin/mousekeys/MouseWrapper.h"
#include <stdint.h> // for uint16_t, uint8_t, int8_t #include <stdint.h> // for uint16_t, uint8_t
#include "kaleidoscope/Runtime.h" // for Runtime, Runtime_ #include "kaleidoscope/Runtime.h" // for Runtime, Runtime_
#include "kaleidoscope/device/device.h" // for Base<>::HID, VirtualProps:... #include "kaleidoscope/device/device.h" // for Base<>::HID, VirtualProps:...

@ -16,9 +16,9 @@
#pragma once #pragma once
#include <stdint.h> // for uint8_t, uint16_t #include <stdint.h> // for uint16_t, uint8_t
#include "kaleidoscope/plugin/mousekeys/MouseWarpModes.h" #include "kaleidoscope/plugin/mousekeys/MouseWarpModes.h" // for MOUSE_WARP_GRID_2X2
// Mouse acceleration // Mouse acceleration

Loading…
Cancel
Save