aboutsummaryrefslogtreecommitdiffstats
path: root/keyboards/georgi/sten.h
diff options
context:
space:
mode:
authorJeremy Bernhardt <jeremythegeek@gmail.com>2019-05-17 14:02:22 -0600
committerDrashna Jaelre <drashna@live.com>2019-05-17 13:02:22 -0700
commitd0c9ad6433d6ed30e8076fd26c8551f579cb08c8 (patch)
tree87d2613ede768cce431b54b78f2274310f520388 /keyboards/georgi/sten.h
parent7a0174f871792c62fdd1b737f2dc9db753695245 (diff)
downloadfirmware-d0c9ad6433d6ed30e8076fd26c8551f579cb08c8.tar.gz
firmware-d0c9ad6433d6ed30e8076fd26c8551f579cb08c8.tar.bz2
firmware-d0c9ad6433d6ed30e8076fd26c8551f579cb08c8.zip
[Keyboard] Georgi improvements (#5899)
* Georgi improvements * The writing was in the -Wall
Diffstat (limited to 'keyboards/georgi/sten.h')
-rw-r--r--keyboards/georgi/sten.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/keyboards/georgi/sten.h b/keyboards/georgi/sten.h
index 5a9771d9a..e94f10fc2 100644
--- a/keyboards/georgi/sten.h
+++ b/keyboards/georgi/sten.h
@@ -13,6 +13,9 @@
extern size_t keymapsCount; // Total keymaps
extern uint32_t cChord; // Current Chord
+extern uint32_t stenoLayers[]; // Chords that simulate QMK layers
+extern size_t stenoLayerCount; // Number of simulated layers
+uint32_t refChord; // Reference chord for PC macro
// Function defs
void processChord(bool useFakeSteno);
@@ -30,6 +33,11 @@ void CLICK_MOUSE(uint8_t);
// Keymap helper
#define P(chord, act) if (cChord == (chord)) { if (!lookup) {act;} return chord;}
+#define PC(chord, act) if (cChord == (chord)) { if (!lookup) {act;} return chord;} \
+ for(int i = 0; i < stenoLayerCount; i++) { \
+ refChord = stenoLayers[i] | chord; \
+ if (cChord == (refChord)) { if (!lookup) {act;} return refChord;}; \
+}
// Shift to internal representation
// i.e) S(teno)R(ight)F