make astyle

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/389/head
Gergely Nagy 7 years ago
parent 559bfa0881
commit b7415039cb

@ -32,28 +32,28 @@ const Key keymaps[][ROWS][COLS] PROGMEM = {
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_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_RightShift, Key_RightAlt, Key_Spacebar, Key_RightControl,
Key_Keymap1),
[1] = KEYMAP_STACKED
( XXX ,XXX ,XXX ,XXX ,XXX ,XXX ,S(N6)
,XXX ,S(N1) ,S(N2) ,S(N3) ,S(N4) ,S(N5) ,S(ST1)
,S(FN) ,S(S1) ,S(TL) ,S(PL) ,S(HL) ,S(ST1)
,S(PWR) ,S(S2) ,S(KL) ,S(WL) ,S(RL) ,S(ST2) ,S(ST2)
(XXX, XXX, XXX, XXX, XXX, XXX, S(N6),
XXX, S(N1), S(N2), S(N3), S(N4), S(N5), S(ST1),
S(FN), S(S1), S(TL), S(PL), S(HL), S(ST1),
S(PWR), S(S2), S(KL), S(WL), S(RL), S(ST2), S(ST2),
,S(RE1) ,XXX ,S(A) ,S(O)
,___
S(RE1), XXX, S(A), S(O),
___,
,S(N7) ,XXX ,XXX ,XXX ,XXX ,XXX ,XXX
,S(ST3) ,S(N8) ,S(N9) ,S(NA) ,S(NB) ,S(NC) ,XXX
,S(ST3) ,S(FR) ,S(PR) ,S(LR) ,S(TR) ,S(DR)
,S(ST4) ,S(ST4) ,S(RR) ,S(BR) ,S(GR) ,S(SR) ,S(ZR)
S(N7), XXX, XXX, XXX, XXX, XXX, XXX,
S(ST3), S(N8), S(N9), S(NA), S(NB), S(NC), XXX,
S(ST3), S(FR), S(PR), S(LR), S(TR), S(DR),
S(ST4), S(ST4), S(RR), S(BR), S(GR), S(SR), S(ZR),
,S(E) ,S(U) ,XXX ,S(RE2)
,___),
S(E), S(U), XXX, S(RE2),
___),
};
void setup() {

@ -21,35 +21,35 @@
namespace kaleidoscope {
namespace steno {
uint8_t GeminiPR::keys_held_;
uint8_t GeminiPR::state_[6];
uint8_t GeminiPR::keys_held_;
uint8_t GeminiPR::state_[6];
void GeminiPR::begin(void) {
Kaleidoscope.useEventHandlerHook(eventHandlerHook);
}
void GeminiPR::begin(void) {
Kaleidoscope.useEventHandlerHook(eventHandlerHook);
}
Key GeminiPR::eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t key_state) {
if (mapped_key < geminipr::START ||
mapped_key > geminipr::END)
return mapped_key;
Key GeminiPR::eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t key_state) {
if (mapped_key < geminipr::START ||
mapped_key > geminipr::END)
return mapped_key;
if (keyToggledOn(key_state)) {
uint8_t key = mapped_key.raw - geminipr::START;
++keys_held_;
if (keyToggledOn(key_state)) {
uint8_t key = mapped_key.raw - geminipr::START;
++keys_held_;
state_[key / 7] |= 1 << (6 - (key % 7));
} else if (keyToggledOff(key_state)) {
--keys_held_;
state_[key / 7] |= 1 << (6 - (key % 7));
} else if (keyToggledOff(key_state)) {
--keys_held_;
if (keys_held_ == 0) {
state_[0] |= 0x80;
Serial.write(state_, sizeof(state_));
memset(state_, 0, sizeof(state_));
}
if (keys_held_ == 0) {
state_[0] |= 0x80;
Serial.write(state_, sizeof(state_));
memset(state_, 0, sizeof(state_));
}
return Key_NoKey;
}
return Key_NoKey;
}
}
}

@ -25,72 +25,72 @@
namespace kaleidoscope {
namespace steno {
class GeminiPR : public KaleidoscopePlugin {
public:
GeminiPR(void) {};
class GeminiPR : public KaleidoscopePlugin {
public:
GeminiPR(void) {};
void begin(void);
void begin(void);
private:
static uint8_t keys_held_;
static uint8_t state_[6];
private:
static uint8_t keys_held_;
static uint8_t state_[6];
static Key eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t key_state);
};
static Key eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t key_state);
};
namespace geminipr {
enum {
START = kaleidoscope::ranges::STENO_START,
FN = START,
NUM,
N1 = NUM,
N2,
N3,
N4,
N5,
N6,
SL,
S1 = SL,
S2,
TL,
KL,
PL,
WL,
HL,
RL,
A,
O,
STR,
ST1 = STR,
ST2,
RES1,
RE1 = RES1,
RES2,
RE2 = RES2,
PWR,
ST3,
ST4,
E,
U,
FR,
RR,
PR,
BR,
LR,
GR,
TR,
SR,
DR,
N7,
N8,
N9,
NA,
NB,
NC,
ZR,
END = ZR,
};
}
namespace geminipr {
enum {
START = kaleidoscope::ranges::STENO_START,
FN = START,
NUM,
N1 = NUM,
N2,
N3,
N4,
N5,
N6,
SL,
S1 = SL,
S2,
TL,
KL,
PL,
WL,
HL,
RL,
A,
O,
STR,
ST1 = STR,
ST2,
RES1,
RE1 = RES1,
RES2,
RE2 = RES2,
PWR,
ST3,
ST4,
E,
U,
FR,
RR,
PR,
BR,
LR,
GR,
TR,
SR,
DR,
N7,
N8,
N9,
NA,
NB,
NC,
ZR,
END = ZR,
};
}
}
}

Loading…
Cancel
Save