astyle with current project style guidelines

pull/365/head
Jesse Vincent 8 years ago
parent fbe4c44179
commit 8786adbc84
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -89,18 +89,17 @@ Key MouseKeys_::eventHandlerHook(Key mappedKey, byte row, byte col, uint8_t keyS
} }
if (key_is_pressed(keyState)) { if (key_is_pressed(keyState)) {
if (mappedKey.keyCode & KEY_MOUSE_WHEEL) { if (mappedKey.keyCode & KEY_MOUSE_WHEEL) {
scrollWheel (mappedKey.keyCode); scrollWheel(mappedKey.keyCode);
} } else
else
mouseMoveIntent |= mappedKey.keyCode; mouseMoveIntent |= mappedKey.keyCode;
} }
} else if (key_toggled_on(keyState)) { } else if (key_toggled_on(keyState)) {
if (mappedKey.keyCode & KEY_MOUSE_WARP && mappedKey.flags & IS_MOUSE_KEY) { if (mappedKey.keyCode & KEY_MOUSE_WARP && mappedKey.flags & IS_MOUSE_KEY) {
// we don't pass in the left and up values because those are the // we don't pass in the left and up values because those are the
// default, "no-op" conditionals // default, "no-op" conditionals
MouseWrapper.warp( ((mappedKey.keyCode & KEY_MOUSE_WARP_END) ? WARP_END : 0x00) | MouseWrapper.warp(((mappedKey.keyCode & KEY_MOUSE_WARP_END) ? WARP_END : 0x00) |
((mappedKey.keyCode & KEY_MOUSE_DOWN) ? WARP_DOWN : 0x00) | ((mappedKey.keyCode & KEY_MOUSE_DOWN) ? WARP_DOWN : 0x00) |
((mappedKey.keyCode & KEY_MOUSE_RIGHT) ? WARP_RIGHT : 0x00) ); ((mappedKey.keyCode & KEY_MOUSE_RIGHT) ? WARP_RIGHT : 0x00));
} }
} }
@ -111,7 +110,7 @@ MouseKeys_::MouseKeys_(void) {
} }
void void
MouseKeys_::begin (void) { MouseKeys_::begin(void) {
event_handler_hook_use(eventHandlerHook); event_handler_hook_use(eventHandlerHook);
loop_hook_use(loopHook); loop_hook_use(loopHook);
} }

@ -5,7 +5,7 @@
class MouseKeys_ : public KaleidoscopePlugin { class MouseKeys_ : public KaleidoscopePlugin {
public: public:
MouseKeys_ (void); MouseKeys_(void);
virtual void begin(void) final; virtual void begin(void) final;

@ -79,7 +79,7 @@ void MouseWrapper_::warp(uint8_t warp_cmd) {
uint8_t MouseWrapper_::acceleration(uint8_t cycles) { uint8_t MouseWrapper_::acceleration(uint8_t cycles) {
uint8_t i = cycles; uint8_t i = cycles;
if( i & 0x80) { if (i & 0x80) {
i = 255 - i; i = 255 - i;
} }
@ -88,7 +88,7 @@ uint8_t MouseWrapper_::acceleration(uint8_t cycles) {
uint8_t ii = (i*i) >> 8; uint8_t ii = (i*i) >> 8;
uint8_t iii = (ii*i) >> 8; uint8_t iii = (ii*i) >> 8;
i = (( (3 * (uint16_t)(ii)) - ( 2 * (uint16_t)(iii))) / 2) + ACCELERATION_FLOOR; i = (((3 * (uint16_t)(ii)) - (2 * (uint16_t)(iii))) / 2) + ACCELERATION_FLOOR;
if (i > ACCELERATION_CEIL) { if (i > ACCELERATION_CEIL) {
i = ACCELERATION_CEIL; i = ACCELERATION_CEIL;
@ -100,7 +100,7 @@ uint8_t MouseWrapper_::acceleration(uint8_t cycles) {
void MouseWrapper_::move(int8_t x, int8_t y) { void MouseWrapper_::move(int8_t x, int8_t y) {
int16_t moveX =0; int16_t moveX =0;
int16_t moveY = 0; int16_t moveY = 0;
if (x != 0 ) { if (x != 0) {
moveX = (x * acceleration(accelStep)); moveX = (x * acceleration(accelStep));
} }
if (y != 0) { if (y != 0) {

Loading…
Cancel
Save