From d0c9ad6433d6ed30e8076fd26c8551f579cb08c8 Mon Sep 17 00:00:00 2001 From: Jeremy Bernhardt Date: Fri, 17 May 2019 14:02:22 -0600 Subject: [Keyboard] Georgi improvements (#5899) * Georgi improvements * The writing was in the -Wall --- keyboards/georgi/sten.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'keyboards/georgi/sten.h') diff --git a/keyboards/georgi/sten.h b/keyboards/georgi/sten.h index 5a9771d9a0..e94f10fc28 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 -- cgit v1.2.3