aericktoes

Splitography Gemini PR Keymap

Mar 2nd, 2021
684
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Copyright 2017 REPLACE_WITH_YOUR_NAME
  2.  *
  3.  * This program is free software: you can redistribute it and/or modify
  4.  * it under the terms of the GNU General Public License as published by
  5.  * the Free Software Foundation, either version 2 of the License, or
  6.  * (at your option) any later version.
  7.  *
  8.  * This program is distributed in the hope that it will be useful,
  9.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.  * GNU General Public License for more details.
  12.  *
  13.  * You should have received a copy of the GNU General Public License
  14.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  15.  */
  16.  
  17. // This is the canonical layout file for the Quantum project. If you want to add another keyboard,
  18. // this is the style you want to emulate.
  19. //
  20. // To flash steno firmware
  21. // ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  22. //   Reset keyboard or press hw reset button on base (hole)
  23. //
  24. //   cd qmk_firmware/keyboards/steno
  25. //   sudo make KEYMAP=sdothum dfu
  26. //
  27. //   sudo make clean          (good practice before flashing)
  28. //   sudo make KEYMAP=<...>   (to compile check)
  29. //
  30. // Package requirements (for arch linux)
  31. // ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  32. //   avr-gcc-atmel
  33. //   avr-libc-atmel
  34. //   dfu-programmer
  35. //
  36. // Code
  37. // ▔▔▔▔
  38. //   This source is shamelessly based on the "default" steno layout
  39. //
  40. //   #ifdef/#endif block structures are not indented, as syntax highlighting
  41. //   in vim is sufficient for identification
  42. //
  43. //   c++ commenting style is used throughout
  44.  
  45. #include "config.h"
  46. #include "splitography.h"
  47. #include "action_layer.h"
  48. #include "keymap_steno.h"
  49. #include "eeconfig.h"
  50.  
  51. extern keymap_config_t keymap_config;
  52.  
  53. enum splitography_layers {
  54.   _QWERTY = 0
  55.  ,_GEMINI
  56.  ,_PLOVER
  57.  ,_BLUE
  58.  ,_ORANGE
  59.  ,_GREEN
  60.  ,_NUM
  61.  ,_END_LAYERS
  62. };
  63.  
  64. enum splitography_keycodes {
  65.   QWERTY = SAFE_RANGE
  66.  ,QWERTY1
  67.  ,QWERTY2
  68.  ,GEMINI
  69.  ,PLOVER
  70.  ,BLUE
  71.  ,ORANGE
  72. };
  73.  
  74. // keycodes
  75. #define ___x___ KC_TRNS
  76. #ifdef _______
  77. #undef _______
  78. #endif
  79. #define _______ KC_NO
  80.  
  81. #define ST_BOLT QK_STENO_BOLT
  82.  
  83. #define COPY    LCTL(KC_C)
  84. #define CUT     LCTL(KC_X)
  85. #define PASTE   LCTL(KC_V)
  86. #define UNDO    LCTL(KC_Z)
  87. #define TG_NUM  TG(_NUM)
  88.  
  89. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  90.  
  91. // ...................................................................... Qwerty
  92. //
  93. // http://www.keyboard-layout-editor.com/#/gists/1b04ce6be0cee6e5d2998b2a8efb8b09
  94.  
  95.   // ,-----------------------------------------------------------------------------------.
  96.   // |  Esc |   Q  |   W  |   E  |   R  |   T  |   Y  |   U  |   I  |   O  |   P  | Bksp |
  97.   // -------|------+------+------+------+------+------+------+------+------+-------------|
  98.   // |  Alt |   A  |   S  |   D  |   F  |   G  |   H  |   J  |   K  |   L  |   ;  | Enter|
  99.   // -------|------+------+------+------+------+------+------+------+------+-------------|
  100.   // | Shift|   Z  |   X  |   C  |   V  |   B  |   N  |   M  |   ,  |   .  |   /  |  GUI |
  101.   // |------+------+------+------+------+------+------+------+------+------+------+------|
  102.   // |                           |Orange| Blue | Space| Ctrl |                           |
  103.   // `-----------------------------------------------------------------------------------'
  104.  
  105.   [_QWERTY] = {
  106.     {KC_ESC,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_BSPC},
  107.     {KC_LALT, KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_ENT },
  108.     {KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_LGUI},
  109.     {_______, _______, _______, _______, ORANGE,  BLUE,    KC_SPC,  KC_LCTL, _______, _______, _______, _______},
  110.   },
  111.  
  112. // .................................................................. Blue Layer
  113. //_______,
  114. // http://www.keyboard-layout-editor.com/#/gists/054b8bc0e31971bb962ea1c781232e0b
  115.  
  116.   // .-----------------------------------------------------------------------------------.
  117.   // |   `  |   1  |   2  |   3  |   4  |   5  |   6  |   7  |   8  |   9  |   0  |      |
  118.   // |-----------------------------------------------------------------------------------|
  119.   // |  Alt | Stop | Prev | Play | Next | +Vol |      |      |      |   [  |   ]  |   '  |
  120.   // |-----------------------------------------------------------------------------------|
  121.   // | Shift| Undo |  Cut | Copy | Paste| -Vol | Mute |      |      |   -  |   =  |  GUI |
  122.   // |-----------------------------------------------------------------------------------|
  123.   // |                           |Orange|  f() |  Del | Ctrl |                           |
  124.   // '-----------------------------------------------------------------------------------'
  125.  
  126.   [_BLUE] = {
  127.     {KC_GRV,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    _______},
  128.     {KC_LALT, KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLU, _______, _______, _______, KC_LBRC, KC_RBRC, KC_QUOT},
  129.     {KC_LSFT, UNDO,    CUT,     COPY,    PASTE,   KC_VOLD, KC_MUTE, _______, _______, KC_MINS, KC_EQL,  KC_LGUI},
  130.     {_______, _______, _______, _______, ORANGE,  ___x___, KC_DEL,  KC_LCTL, _______, _______, _______, _______},
  131.   },
  132.  
  133. // ................................................................ Orange Layer
  134. //
  135. // http://www.keyboard-layout-editor.com/#/gists/83ccc7c3faa78b1f67f6fef65063a248
  136.  
  137.   // .-----------------------------------------------------------------------------------.
  138.   // |Plover|  F1  |  F2  |  F3  |  F4  |      |  App | PrScr|ScrLck| Pause|      |      |
  139.   // |-----------------------------------------------------------------------------------|
  140.   // |  Alt |  F5  |  F6  |  F7  |  F8  |      |      |Insert| Home | PgUp |      |      |
  141.   // |-----------------------------------------------------------------------------------|
  142.   // | Shift|  F9  |  F10 |  F11 |  F12 |      |      |  Del |  End | PgDn |   \  |  GUI |
  143.   // |-----------------------------------------------------------------------------------|
  144.   // |                           |  f() | Blue |  Tab | Ctrl |                           |
  145.   // '-----------------------------------------------------------------------------------'
  146.  
  147.   [_ORANGE] = {
  148.     {PLOVER,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   _______, KC_APP,  KC_PSCR, KC_SLCK, KC_PAUS, _______, _______},
  149.     {KC_LALT, KC_F5,   KC_F6,   KC_F7,   KC_F8,   _______, _______, KC_INS,  KC_HOME, KC_PGUP, _______, _______},
  150.     {KC_LSFT, KC_F9,   KC_F10,  KC_F11,  KC_F12,  _______, _______, KC_DEL,  KC_END,  KC_PGDN, KC_BSLS, KC_LGUI},
  151.     {_______, _______, _______, _______, ___x___, BLUE,    KC_TAB,  KC_LCTL, _______, _______, _______, _______},
  152.   },
  153.  
  154. // ................................................................. Green Layer
  155. //
  156. // http://www.keyboard-layout-editor.com/#/gists/bc7902f1eada4d7d34d3445aa1eccdab
  157.  
  158.   // .-----------------------------------------------------------------------------------.
  159.   // |TxBolt|      |      |      |      |Scroll|   /  |   7  |   8  |   9  |   -  |      |
  160.   // |-----------------------------------------------------------------------------------|
  161.   // |  Alt | Home |  Up  |  End | PgUp | Caps |   *  |   4  |   5  |   6  |   +  | Enter|
  162.   // |-----------------------------------------------------------------------------------|
  163.   // | Shift| Left | Down | Right| PgDn |  Num |   0  |   1  |   2  |   3  |      |  GUI |
  164.   // |-----------------------------------------------------------------------------------|
  165.   // |                           |  f() |  f() |  --  | Ctrl |                           |
  166.   // '-----------------------------------------------------------------------------------'
  167.  
  168.   [_GREEN] = {
  169.     {GEMINI,  _______, _______, _______, _______, KC_SLCK, KC_PSLS, KC_P7,   KC_P8,   KC_P9,   KC_MINS, _______},
  170.     {KC_LALT, KC_HOME, KC_UP,   KC_END,  KC_PGUP, KC_CAPS, KC_PAST, KC_P4,   KC_P5,   KC_P6,   KC_PPLS, KC_ENT },
  171.     {KC_LSFT, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, TG_NUM,  KC_P0,   KC_P1,   KC_P2,   KC_P3,   _______, KC_LGUI},
  172.     {_______, _______, _______, _______, ___x___, ___x___, _______, KC_LCTL, _______, _______, _______, _______},
  173.   },
  174.  
  175. // ................................................................... Num Layer
  176. //
  177. // http://www.keyboard-layout-editor.com/#/gists/bc7902f1eada4d7d34d3445aa1eccdab
  178.  
  179.   // .-----------------------------------------------------------------------------------.
  180.   // |      |      |      |      |      |      |   /  |   7  |   8  |   9  |   -  |      |
  181.   // |-----------------------------------------------------------------------------------|
  182.   // |  Alt | Home |  Up  |  End | PgUp |      |   *  |   4  |   5  |   6  |   +  | Enter|
  183.   // |-----------------------------------------------------------------------------------|
  184.   // | Shift| Left | Down | Right| PgDn |  f() |   0  |   1  |   2  |   3  |      |  GUI |
  185.   // |-----------------------------------------------------------------------------------|
  186.   // |                           |  --  |  --  |  --  | Ctrl |                           |
  187.   // '-----------------------------------------------------------------------------------'
  188.  
  189.   [_NUM] = {
  190.     {_______, _______, _______, _______, _______, _______, KC_PSLS, KC_P7,   KC_P8,   KC_P9,   KC_PMNS, _______},
  191.     {KC_LALT, KC_HOME, KC_UP,   KC_END,  KC_PGUP, _______, KC_PAST, KC_P4,   KC_P5,   KC_P6,   KC_PPLS, KC_ENT },
  192.     {KC_LSFT, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, QWERTY,  KC_P0,   KC_P1,   KC_P2,   KC_P3,   _______, KC_LGUI},
  193.     {_______, _______, _______, _______, _______, _______, _______, KC_LCTL, _______, _______, _______, _______},
  194.   },
  195.  
  196. // ...................................................................... Plover
  197. //
  198. // http://www.keyboard-layout-editor.com/#/gists/27b8f8649393a8ba4071ba946a9306f4
  199.  
  200.   // ,-----------------------------------------------------------------------------------.
  201.   // |   1  |   1  |   1  |   1  |   1  |   1  |   1  |   1  |   1  |   1  |   1  |   1  |
  202.   // +-------------+------+------+------+------+------+------+------+------+------+------|
  203.   // |Qwerty|   S  |   T  |   P  |   H  |   *  |   *  |   F  |   P  |   L  |   T  |   D  |
  204.   // +------|------+------+------+------+------+------+------+------+------+------+------|
  205.   // |Qwerty|   S  |   K  |   W  |   R  |   *  |   *  |   R  |   B  |   G  |   S  |   Z  |
  206.   // +------+------+------+------+------+------+------+------+------+------+------+------|
  207.   // |                           |   A  |   O  |   E  |   U  |                           |
  208.   // `-----------------------------------------------------------------------------------'
  209.  
  210.   [_PLOVER] = {
  211.     {KC_1,    KC_1,    KC_1,    KC_1,    KC_1,    KC_1,    KC_1,    KC_1,    KC_1,    KC_1,    KC_1,    KC_1   },
  212.     {QWERTY1, KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_LBRC},
  213.     {QWERTY2, KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT},
  214.     {_______, _______, _______, _______, KC_C,    KC_V,    KC_N,    KC_M,    _______, _______, _______, _______},
  215.   },
  216.  
  217. // ...................................................................... Gemini
  218. //
  219. // http://www.keyboard-layout-editor.com/#/gists/27b8f8649393a8ba4071ba946a9306f4
  220.  
  221.   // ,-----------------------------------------------------------------------------------.
  222.   // |   #  |   #  |   #  |   #  |   #  |   #  |   #  |   #  |   #  |   #  |   #  |   #  |
  223.   // |------+------+------+------+------+-------------+------+------+------+------+------|
  224.   // |Qwerty|   S  |   T  |   P  |   H  |   *  |   *  |   F  |   P  |   L  |   T  |   D  |
  225.   // |------+------+------+------+------+------|------+------+------+------+------+------|
  226.   // |Qwerty|   S  |   K  |   W  |   R  |   *  |   *  |   R  |   B  |   G  |   S  |   Z  |
  227.   // |------+------+------+------+------+------+------+------+------+------+------+------|
  228.   // |                           |   A  |   O  |   E  |   U  |                           |
  229.   // `-----------------------------------------------------------------------------------'
  230.  
  231.  
  232.   [_GEMINI] = {
  233.     {STN_N1,  STN_N2,  STN_N3,  STN_N4,  STN_N5,  STN_N6,  STN_N7,  STN_N8,  STN_N9,  STN_NA,  STN_NB,  STN_NC },
  234.     {QWERTY1, STN_S1,  STN_TL,  STN_PL,  STN_HL,  STN_ST1, STN_ST3, STN_FR,  STN_PR,  STN_LR,  STN_TR,  STN_DR },
  235.     {QWERTY2, STN_S2,  STN_KL,  STN_WL,  STN_RL,  STN_ST2, STN_ST4, STN_RR,  STN_BR,  STN_GR,  STN_SR,  STN_ZR },
  236.     {_______, _______, _______, _______, STN_A,   STN_O,   STN_E,   STN_U,   _______, _______, _______, _______},
  237.   },
  238.  
  239. };
  240.  
  241. // ..................................................................... Keymaps
  242.  
  243. void clear_layers(void)
  244. {
  245.   uint8_t layer;
  246.   for (layer = 0; layer < _END_LAYERS; layer++) {
  247.     layer_off(layer);
  248.   }
  249. }
  250.  
  251. #define QWERTY_1  1
  252. #define QWERTY_2  2
  253. #define QWERTY_12 3
  254. static uint8_t qwerty_n = 0;
  255.  
  256. void qwerty(void)
  257. {
  258.   qwerty_n = 0;
  259.   clear_layers();
  260.   set_single_persistent_default_layer(_QWERTY);
  261. }
  262.  
  263. void plover(keyrecord_t *record)
  264. {
  265.   if (record->event.pressed) {
  266.     clear_layers();
  267.     layer_on(_PLOVER);
  268.     if (!eeconfig_is_enabled()) {
  269.       eeconfig_init();
  270.     }
  271.     keymap_config.raw  = eeconfig_read_keymap();
  272.     keymap_config.nkro = 1;
  273.     eeconfig_update_keymap(keymap_config.raw);
  274.   }
  275. }
  276.  
  277. void txbolt(void)
  278. {
  279.   clear_layers();
  280.   layer_on(_GEMINI);
  281. }
  282.  
  283. // ........................................................... User Keycode Trap
  284.  
  285. bool process_record_user(uint16_t keycode, keyrecord_t *record)
  286. {
  287.   switch (keycode) {
  288.     case QWERTY:
  289.       if (record->event.pressed) {
  290.         qwerty();
  291.       }
  292.       return false;
  293.     case QWERTY1:
  294.       if (record->event.pressed) {
  295.         qwerty_n = qwerty_n | QWERTY_1;
  296.         if (qwerty_n == QWERTY_12) {
  297.           qwerty();
  298.         }
  299.       } else {
  300.         qwerty_n = qwerty_n & ~QWERTY_1;
  301.       }
  302.       return false;
  303.     case QWERTY2:
  304.       if (record->event.pressed) {
  305.         qwerty_n = qwerty_n | QWERTY_2;
  306.         if (qwerty_n == QWERTY_12) {
  307.           qwerty();
  308.         }
  309.       } else {
  310.         qwerty_n = qwerty_n & ~QWERTY_2;
  311.       }
  312.       return false;
  313.     case BLUE:
  314.       if (record->event.pressed) {
  315.         layer_on        (_BLUE);
  316.         update_tri_layer(_BLUE, _ORANGE, _GREEN);
  317.       } else {
  318.         layer_off       (_BLUE);
  319.         update_tri_layer(_BLUE, _ORANGE, _GREEN);
  320.       }
  321.       return false;
  322.     case ORANGE:
  323.       if (record->event.pressed) {
  324.         layer_on        (_ORANGE);
  325.         update_tri_layer(_BLUE, _ORANGE, _GREEN);
  326.       } else {
  327.         layer_off       (_ORANGE);
  328.         update_tri_layer(_BLUE, _ORANGE, _GREEN);
  329.       }
  330.       return false;
  331.     case PLOVER:
  332.       plover(record);
  333.       return false;
  334.     case GEMINI:
  335.       if (record->event.pressed) {
  336.         txbolt();
  337.       }
  338.       return false;
  339.   }
  340.   return true;
  341. }
  342.  
  343. // initialize steno protocol
  344. void matrix_init_user(void)
  345. {
  346.   steno_set_mode(STENO_MODE_BOLT);
  347. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×