aboutsummaryrefslogtreecommitdiffstats
path: root/keyboards/butterstick/sten.h
diff options
context:
space:
mode:
authorWilliam Chang <william@factual.com>2019-11-20 22:17:07 -0800
committerWilliam Chang <william@factual.com>2019-11-20 22:17:07 -0800
commite7f4d56592b3975c38af329e77b4efd9108495e8 (patch)
tree0a416bccbf70bfdbdb9ffcdb3bf136b47378c014 /keyboards/butterstick/sten.h
parent71493b2f9bbd5f3d18373c518fa14ccafcbf48fc (diff)
parent8416a94ad27b3ff058576f09f35f0704a8b39ff3 (diff)
downloadfirmware-e7f4d56592b3975c38af329e77b4efd9108495e8.tar.gz
firmware-e7f4d56592b3975c38af329e77b4efd9108495e8.tar.bz2
firmware-e7f4d56592b3975c38af329e77b4efd9108495e8.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'keyboards/butterstick/sten.h')
-rw-r--r--keyboards/butterstick/sten.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/keyboards/butterstick/sten.h b/keyboards/butterstick/sten.h
index 5a9771d9a..84635a554 100644
--- a/keyboards/butterstick/sten.h
+++ b/keyboards/butterstick/sten.h
@@ -13,11 +13,14 @@
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);
-uint32_t processQwerty(bool lookup);
-uint32_t processFakeSteno(bool lookup);
+uint32_t processQwerty(bool lookup);
+uint32_t processFakeSteno(bool lookup);
void saveState(uint32_t cChord);
void restoreState(void);
@@ -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