make astyle

pull/389/head
Jesse Vincent 8 years ago
parent df8f89924c
commit 80e27ef57a
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -21,35 +21,35 @@
using namespace KaleidoscopePlugins::Ranges; using namespace KaleidoscopePlugins::Ranges;
namespace KaleidoscopePlugins { namespace KaleidoscopePlugins {
// --- state --- // --- state ---
char Syster::symbol[SYSTER_MAX_SYMBOL_LENGTH + 1]; char Syster::symbol[SYSTER_MAX_SYMBOL_LENGTH + 1];
uint8_t Syster::symbolPos; uint8_t Syster::symbolPos;
bool Syster::isActive; bool Syster::isActive;
// --- helpers --- // --- helpers ---
#define isSyster(k) (k == SYSTER) #define isSyster(k) (k == SYSTER)
// --- api --- // --- api ---
Syster::Syster (void) { Syster::Syster (void) {
} }
void void
Syster::begin (void) { Syster::begin (void) {
event_handler_hook_use (this->eventHandlerHook); event_handler_hook_use (this->eventHandlerHook);
} }
void void
Syster::reset (void) { Syster::reset (void) {
symbolPos = 0; symbolPos = 0;
symbol[0] = 0; symbol[0] = 0;
isActive = false; isActive = false;
} }
// --- hooks --- // --- hooks ---
Key Key
Syster::eventHandlerHook (Key mappedKey, byte row, byte col, uint8_t keyState) { Syster::eventHandlerHook (Key mappedKey, byte row, byte col, uint8_t keyState) {
if (!isActive) { if (!isActive) {
if (!isSyster (mappedKey)) if (!isSyster (mappedKey))
return mappedKey; return mappedKey;
@ -101,7 +101,7 @@ namespace KaleidoscopePlugins {
} }
return mappedKey; return mappedKey;
} }
}; };
__attribute__((weak)) __attribute__((weak))

@ -26,7 +26,7 @@
#define SYSTER (Key){ .raw = KaleidoscopePlugins::Ranges::SYSTER } #define SYSTER (Key){ .raw = KaleidoscopePlugins::Ranges::SYSTER }
namespace KaleidoscopePlugins { namespace KaleidoscopePlugins {
class Syster : public KaleidoscopePlugin { class Syster : public KaleidoscopePlugin {
public: public:
typedef enum { typedef enum {
StartAction, StartAction,
@ -45,7 +45,7 @@ namespace KaleidoscopePlugins {
static bool isActive; static bool isActive;
static Key eventHandlerHook (Key mappedKey, byte row, byte col, uint8_t keyState); static Key eventHandlerHook (Key mappedKey, byte row, byte col, uint8_t keyState);
}; };
}; };
const char keyToChar (Key key); const char keyToChar (Key key);

Loading…
Cancel
Save