"make astyle" - no functionality changes

pull/102/head
Jesse Vincent 8 years ago
parent 285818c88e
commit f3b786dade

@ -22,41 +22,41 @@
#include "Macros.h"
const Key keymaps[][ROWS][COLS] PROGMEM = {
[0] = KEYMAP_STACKED
(
Key_NoKey, Key_1, Key_2, Key_3, Key_4, Key_5, Key_NoKey,
Key_Backtick, Key_Q, Key_W, Key_E, Key_R, Key_T, Key_Tab,
Key_PageUp, Key_A, Key_S, Key_D, Key_F, Key_G,
Key_PageDn, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Esc,
Key_LCtrl, Key_Backspace, Key_LGUI, Key_LShift,
M(M_APPSWITCH),
Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_skip,
Key_Enter, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals,
Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote,
Key_skip, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus,
Key_RShift, Key_RAlt, Key_Space, Key_RCtrl,
M(M_APPCANCEL)
),
[0] = KEYMAP_STACKED
(
Key_NoKey, Key_1, Key_2, Key_3, Key_4, Key_5, Key_NoKey,
Key_Backtick, Key_Q, Key_W, Key_E, Key_R, Key_T, Key_Tab,
Key_PageUp, Key_A, Key_S, Key_D, Key_F, Key_G,
Key_PageDn, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Esc,
Key_LCtrl, Key_Backspace, Key_LGUI, Key_LShift,
M(M_APPSWITCH),
Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_skip,
Key_Enter, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals,
Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote,
Key_skip, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus,
Key_RShift, Key_RAlt, Key_Space, Key_RCtrl,
M(M_APPCANCEL)
),
};
const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) {
switch (macroIndex) {
case M_APPSWITCH:
return macroAppSwitch (keyState);
case M_APPCANCEL:
return macroAppCancel (keyState);
}
return MACRO_NONE;
switch (macroIndex) {
case M_APPSWITCH:
return macroAppSwitch (keyState);
case M_APPCANCEL:
return macroAppCancel (keyState);
}
return MACRO_NONE;
}
void setup () {
Keyboardio.setup (KEYMAP_SIZE);
Keyboardio.use (&HostOS, &Macros, NULL);
Keyboardio.setup (KEYMAP_SIZE);
Keyboardio.use (&HostOS, &Macros, NULL);
}
void loop () {
Keyboardio.loop ();
Keyboardio.loop ();
}

@ -28,30 +28,30 @@ using namespace Akela::HostOS;
static bool appSwitchActive = false;
const macro_t *macroAppSwitch (uint8_t keyState) {
Key mod = Key_LAlt;
if (HostOS.os () == OSX)
mod = Key_LGUI;
// Key was just pressed, or is being held
if (key_is_pressed(keyState)) {
return MACRO(Dr(mod), D(Tab), END);
}
// Key was just released
if (key_toggled_off(keyState)) {
return MACRO(U(Tab), Dr(mod), END);
}
// Key is not pressed, and was not just released.
// if appSwitchActive is true, we continue holding Alt.
if (appSwitchActive) {
return MACRO(Dr(mod), END);
}
// otherwise we do nothing
return MACRO_NONE;
Key mod = Key_LAlt;
if (HostOS.os () == OSX)
mod = Key_LGUI;
// Key was just pressed, or is being held
if (key_is_pressed(keyState)) {
return MACRO(Dr(mod), D(Tab), END);
}
// Key was just released
if (key_toggled_off(keyState)) {
return MACRO(U(Tab), Dr(mod), END);
}
// Key is not pressed, and was not just released.
// if appSwitchActive is true, we continue holding Alt.
if (appSwitchActive) {
return MACRO(Dr(mod), END);
}
// otherwise we do nothing
return MACRO_NONE;
}
const macro_t *macroAppCancel (uint8_t keyState) {
if (key_toggled_on (keyState))
appSwitchActive = false;
return MACRO_NONE;
if (key_toggled_on (keyState))
appSwitchActive = false;
return MACRO_NONE;
}

@ -22,8 +22,8 @@
#include <Keyboardio-Macros.h>
enum {
M_APPSWITCH,
M_APPCANCEL,
M_APPSWITCH,
M_APPCANCEL,
};
const macro_t *macroAppSwitch (uint8_t keyState);

@ -55,7 +55,7 @@ void setup() {
Keyboardio.setup(KEYMAP_SIZE);
Keyboardio.use(&TestMode,
&LEDControl, &LEDOff,
&LEDControl, &LEDOff,
&solidRed, &solidOrange, &solidYellow, &solidGreen, &solidBlue, &solidIndigo, &solidViolet,
&LEDBreatheEffect, &LEDRainbowEffect, &LEDChaseEffect, &NumLock,

@ -26,16 +26,16 @@ Keyboardio_::loop(void) {
KeyboardHardware.scan_matrix();
for (byte i = 0; loopHooks[i] != NULL && i < HOOK_MAX; i++) {
custom_loop_t hook = loopHooks[i];
(*hook)(false);
custom_loop_t hook = loopHooks[i];
(*hook)(false);
}
Keyboard.sendReport();
Keyboard.releaseAll();
for (byte i = 0; loopHooks[i] != NULL && i < HOOK_MAX; i++) {
custom_loop_t hook = loopHooks[i];
(*hook)(true);
custom_loop_t hook = loopHooks[i];
(*hook)(true);
}
}
@ -47,7 +47,7 @@ Keyboardio_::use(KeyboardioPlugin *plugin, ...) {
plugin->begin();
va_start(ap, plugin);
while ((p = va_arg(ap, KeyboardioPlugin*)) != NULL) {
p->begin();
p->begin();
};
va_end(ap);
}

@ -10,18 +10,43 @@ typedef union Key_ {
};
uint16_t raw;
inline bool operator==(uint16_t rhs) { return this->raw == rhs; };
inline bool operator==(const Key_ rhs) { return this->raw == rhs.raw; };
inline Key_& operator=(uint16_t raw) { this->raw = raw; return *this; };
inline bool operator!=(const Key_& rhs) { return !(*this == rhs); };
inline bool operator>=(uint16_t raw) { return this->raw >= raw; };
inline bool operator<=(uint16_t raw) { return this->raw <= raw; };
inline bool operator>(uint16_t raw) { return this->raw > raw; };
inline bool operator<(uint16_t raw) { return this->raw < raw; };
inline bool operator>=(const Key_& other) { return this->raw >= other.raw; };
inline bool operator<=(const Key_& other) { return this->raw <= other.raw; };
inline bool operator>(const Key_& other) { return this->raw > other.raw; };
inline bool operator<(const Key_& other) { return this->raw < other.raw; };
inline bool operator==(uint16_t rhs) {
return this->raw == rhs;
};
inline bool operator==(const Key_ rhs) {
return this->raw == rhs.raw;
};
inline Key_& operator=(uint16_t raw) {
this->raw = raw;
return *this;
};
inline bool operator!=(const Key_& rhs) {
return !(*this == rhs);
};
inline bool operator>=(uint16_t raw) {
return this->raw >= raw;
};
inline bool operator<=(uint16_t raw) {
return this->raw <= raw;
};
inline bool operator>(uint16_t raw) {
return this->raw > raw;
};
inline bool operator<(uint16_t raw) {
return this->raw < raw;
};
inline bool operator>=(const Key_& other) {
return this->raw >= other.raw;
};
inline bool operator<=(const Key_& other) {
return this->raw <= other.raw;
};
inline bool operator>(const Key_& other) {
return this->raw > other.raw;
};
inline bool operator<(const Key_& other) {
return this->raw < other.raw;
};
} Key;

@ -91,6 +91,6 @@ void handle_key_event(Key mappedKey, byte row, byte col, uint8_t keyState) {
}
mappedKey = Layer.eventHandler(mappedKey, row, col, keyState);
if (mappedKey.raw == Key_NoKey.raw)
return;
return;
handle_key_event_default(mappedKey, row, col, keyState);
}

@ -56,7 +56,7 @@ Key Layer_::lookup(byte row, byte col) {
mappedKey.raw = Key_Transparent.raw;
while (mappedKey.raw == Key_Transparent.raw &&
layer >= DefaultLayer) {
layer >= DefaultLayer) {
if (Layer.isOn (layer))
mappedKey.raw = pgm_read_word(&(keymaps[layer][row][col]));
layer--;

@ -1,7 +1,7 @@
#pragma once
class KeyboardioPlugin {
public:
virtual void begin(void) = 0;
public:
virtual void begin(void) = 0;
};

Loading…
Cancel
Save