keymap.c 85 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779
  1. /*
  2. * License (GPL):
  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. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. * Authors: This QMK keymap file is a combination of the default
  14. * keymap, led code original copied/edited from ../jetpacktuxedo, some
  15. * copy/paste from QMK documentation code examples (etc).
  16. * Remainder: © 2019, 2020, 2021 by Jos Boersema
  17. */
  18. // --------------------------------------v---------------------------------------
  19. // Configuration:
  20. // --------------------------------------v---------------------------------------
  21. #include "./user_config.h" // Edit this file to set user preference compile options.
  22. // --------------------------------------^---------------------------------------
  23. /* Configurable keymap for Minivan layouts 44, 45, 46 keys.
  24. * May work for 12×12×12×[11-12] keys as well.
  25. * Configuration in ./user_config.h
  26. */
  27. /* Overview of the code
  28. *
  29. * The base layers are in separate files;
  30. * process_record_user(), unicode macros are defined in unicode_macros.c;
  31. * accented characters are defined in unicode_weurope.h
  32. *
  33. * Unicode macros facilitate recomputing for re-computing the Dvorak with changed letters
  34. * ('descramble'), and exist because space ran out for * XP(…).
  35. *
  36. * The led color code might be a bit hairy, due to speed/count middle led overlapping layer color.
  37. *
  38. * Preprocessor indentation: # always in column one, #includes and #defines
  39. * are most to the left unless nested, except in the user configuration
  40. * block where room is left for a ‛//’. Logical stuff (#if etc) is
  41. * indented from column two, and then in each nesting goes 4 more spaces
  42. * to the right, so in between the normal code indentations. There should
  43. * be a newline above and below logical statements. This makes preprocessor
  44. * statements stand out, while giving more information in each statement.
  45. * C indentation: trying to follow QMK standard.
  46. *
  47. */
  48. #include QMK_KEYBOARD_H
  49. // Bit masks for the Base layers, to set them as Default, in order to make transparency look back to the right one.
  50. #define _DEF_BASE_MASK 0x1 // Some functions take a bit-mask, where layer 0 (zero) is called 0x1 instead.
  51. #define _ALT_BASE_MASK 0x2 // Some functions take a bit-mask, where layer 0 (zero) is called 0x1 instead.
  52. // Below #defines the internal order of the layers.
  53. // Notice this order in layer_state_set_user as well, regarding the led indicators.
  54. enum {
  55. _DEF_BASE, // Default BASE layer (layer at startup). Typically the letters.
  56. # ifndef MINIFAN_SINGLE_LAYOUT
  57. _ALT_BASE, // Alternative BASE layer.
  58. # endif
  59. _DEF_NSY, // numbers and symbols
  60. # ifndef MINIFAN_SINGLE_LAYOUT
  61. _ALT_NSY, // Alternate version of _DEF_NSY
  62. # endif
  63. _MOV, // movement arrows and mouse
  64. _RAR, // keys RARely used, Unicode config, Power keys, Media keys, alternate mode switch, speed/size count, …
  65. # ifndef REMOVE_PAD
  66. _PAD, // Numbers pad. These are different versions of the same numbers, that is ‛1’ (_NSY) ≠ ‛1’ (_PAD).
  67. # endif
  68. # ifndef REMOVE_ACC // Removes this layer entirely, if set.
  69. _ACC, // Accented letters
  70. # endif
  71. # ifndef REMOVE_DRA // Removes this layer entirely, if set.
  72. _DRA, // Unusual symbols and whatever else
  73. # endif
  74. # ifndef REMOVE_BON // Removes this layer entirely, if set.
  75. _BON, // Bonus layer with more Unicode symbols
  76. # endif
  77. _FUN, // function keys, layer switcher, given highest order precedence just in case
  78. } ;
  79. // The default and alternate base layers needs to have a low order
  80. // number, so that the other layers can be accessed on top of it.
  81. // Default Layer is set, according to active Base pair.
  82. // What BASE layer is active.
  83. enum {
  84. _NORMAL_, // BASE layer is _DEF_BASE
  85. _FULL_, // BASE layer is _ALT_BASE
  86. # ifdef DVORAK_DESCRAMBLE // not used with other keymaps
  87. _HALF_, // BASE layer is _ALT_BASE For DVORAK_DESCRAMBLE keymap: does *not* re-compute letters in Unicode
  88. // This is for different Unicode encodings than “Control+U+HEX” (Linux). It will go through what is set on _RAR
  89. # endif
  90. };
  91. // The mechanism is about what layer to return to, once needing to go back to the letters layer (BASE).
  92. # ifndef STARTUP_ALTERNATE // Startup with in default BASE, normal mode.
  93. short alternate = _NORMAL_;
  94. # else // Startup with alternate BASE active
  95. short alternate = _FULL_; //
  96. # endif
  97. //* Shift detection
  98. bool shift_ison = 0; // keep track of the state of shift (Capslock is ignored). There may be more elegant code for this in
  99. // QMK (a function seems to do it?), but this is simple and keeps the issue isolated to this file.
  100. # define TRUE 1
  101. # define FALSE 0
  102. bool _fun_stay = FALSE; // for making _FUN layer not return to BASE after pressing an F-key
  103. bool leds_on; // toggle leds on/off
  104. # ifdef LEDS_OFF_BASE_DEF
  105. bool led_middle_on = TRUE; // Set to off later, if startup setting is off.
  106. # endif
  107. bool isolate_trigger = FALSE; // detects if _FUN layer move was pressed, and no other key (no normal use of Shift).
  108. bool capslock; // keeps track of capslock state
  109. bool numlock; // keeps track of numlock state
  110. layer_state_t state_recall; // We are calling the function set_led_colors_ from this file as well.
  111. // speed measuring
  112. bool speed_measure = SPEED_INIT_VALUE; // feature activated or not on startup
  113. uint32_t speed_counttime; // counts the time
  114. short speed_countdown = SPEED_COUNTDOWN; // countdown to next computation/effects
  115. int speed; // we store typing result (keys/second) to make reporting less stressful on user, as it doesn't run away after typing
  116. // the value is recorded 10 times higher, to allow another digit of precision, needed to calculate Words-Per-Minute
  117. long int speed_batches = 0; // This counts how many batches of SPEED_COUNTDOWN have been added to wordcount_speed_add
  118. long int speed_add = 0; // This just adds the speed computed for every batch of SPEED_COUNTDOWN, also times 10 for precision
  119. // character and word counting, attempting to count the final text being written
  120. bool sizecount_measure = COUNT_INIT_VALUE; // feature activated or not on startup
  121. long int sizecount_blanks = 0; // This counts spaces/enters as a means of counting words, with manual substraction key
  122. long int sizecount_chars = 0; // This counts characters, substraction for delete/backspace
  123. bool sizecount_word; // remember if the last character was whitespace, so a second does not count a word
  124. bool sizecount_menu = FALSE; // menu mode for configuring sizecount led color & alert system for maximum size.
  125. long int sizecount_max = 0; // the maximum system for count, alert user about relative size/limit
  126. bool sizecount_max_type; // is size counting by word or by character
  127. #define SIZECOUNT_WORD 0 // The type of text size counting: words
  128. #define SIZECOUNT_CHAR 1 // " : characters
  129. /* This file contains mostly the Unicode and special macros.
  130. It contains the function: process_record_user(...)
  131. It has been isolated because the source file got long.
  132. */
  133. #include "./unicode_macros.c"
  134. // Pre-existing function, run when the keyboard starts up.
  135. void keyboard_post_init_user (void) {
  136. # ifdef RGBLIGHT_ENABLE
  137. // Set side leds on/off startup
  138. # ifdef STARTUP_SIDE_LEDS_OFF
  139. leds_on = FALSE;
  140. # else
  141. leds_on = TRUE;
  142. # endif
  143. // Set up RGB effects on _only_ the first LED
  144. rgblight_set_effect_range (1, 1); // Takes a range: 1st arg is start, 2nd how many
  145. rgblight_sethsv_noeeprom (HSV_WHITE); // Startup color of keyboard.
  146. // Set LED effects to breathing mode
  147. rgblight_mode_noeeprom (RGBLIGHT_EFFECT_BREATHING + 2);
  148. // Init the first and last LEDs to a static color.
  149. setrgb (0, 0, 0, (LED_TYPE *)&led[0]); // Led[0] is led 0
  150. setrgb (0, 0, 0, (LED_TYPE *)&led[2]); // 2nd led
  151. // The logic seems to be to establish the effect first, and then toggle it on/off.
  152. # ifdef STARTUP_MID_LED_OFF
  153. rgblight_disable (); //
  154. # ifdef LEDS_OFF_BASE_DEF // This messes with led effect on/off, so we need to track the state of this setting now.
  155. led_middle_on = FALSE;
  156. # endif
  157. # endif
  158. isolate_rgblight_set ();
  159. # endif //RGBLIGHT_ENABLE
  160. // Set startup layer
  161. # ifdef STARTUP_ALTERNATE
  162. layer_move (_ALT_BASE);
  163. # else
  164. layer_move (_DEF_BASE);
  165. # endif
  166. _fun_stay = TRUE; // startup with F-keys not returning to Base after stroke (_FUN)
  167. }
  168. // Writes a number as if typed on keyboard. Typically to show a speed/text size measurement.
  169. // If last argument is TRUE it prints a dot ‛.’ before the last digit
  170. int write_number (long int input, short divide10) {
  171. long int step10;
  172. short digit;
  173. short start = FALSE;
  174. short printed = 0;
  175. char output[2];
  176. output[1] = '\0';
  177. if (0 > input) { // number is negative
  178. send_string ("-"); // minus
  179. printed++;
  180. input *= -1; // turn positive
  181. }
  182. for (step10 = 1000000000; 0 != step10; step10 /= 10) { // assuming 32 bit, ± 10⁹
  183. digit = input / step10;
  184. input = input % step10;
  185. if (!start) { // remove leading zeros
  186. if ((0 != digit) || (1 == step10)) start = TRUE; // If all zeros, always print last zero.
  187. }
  188. if (divide10 && (1 == step10)) { // print with a dot before the last digit
  189. send_string (".");
  190. printed++;
  191. }
  192. if (start) { // print
  193. output[0] = '0' + digit;
  194. send_string (output);
  195. printed++;
  196. }
  197. }
  198. return printed;
  199. }
  200. // This function prevents the middle led from being altered by layer
  201. // switching (showing the layer color, that is), when another
  202. // functionality takes precedent over the middle led.
  203. void middle_led_control (short hsv_h, short hsv_s, short hsv_v ) {
  204. # ifdef RGBLIGHT_ENABLE
  205. if (FALSE == speed_measure) { // only touch middle led if no speed measuring going on
  206. if ( ! ((TRUE == sizecount_measure) && (0 != sizecount_max)) ) { // only touch middle led if no text size
  207. // counting set to a maximum is going on.
  208. rgblight_sethsv_noeeprom (hsv_h, hsv_s, hsv_v); // set it
  209. }
  210. }
  211. # endif
  212. }
  213. // Set middle led color for speed system. Needed in various places.
  214. void speed_led (int speed) {
  215. # ifdef RGBLIGHT_ENABLE
  216. speed /= 10; // argument is in 10 times its value
  217. if ( ! ((TRUE == sizecount_measure) && (0 != sizecount_max)) ) { // only touch middle led if no text size
  218. // counting set to a maximum is going on.
  219. rgblight_sethsv_noeeprom (SPEED_HUE_STEP * speed + SPEED_HUE_START, 255, 128); // full saturation, but half lit
  220. rgblight_set (); // only center led is altered, no need to go through isolate_rgblight_set()
  221. }
  222. # endif
  223. }
  224. // do this in one place to handle left/right leds being off here
  225. void isolate_rgblight_set () {
  226. # ifdef RGBLIGHT_ENABLE
  227. if (!leds_on) { // left/right leds are off
  228. // overwrite previously colors
  229. uint8_t led0r = 0; uint8_t led0g = 0; uint8_t led0b = 0;
  230. uint8_t led2r = 0; uint8_t led2g = 0; uint8_t led2b = 0;
  231. led0r = 0;
  232. led0g = 0;
  233. led0b = 0;
  234. led2r = 0;
  235. led2g = 0;
  236. led2b = 0;
  237. setrgb(led0r, led0g, led0b, (LED_TYPE *)&led[0]); // Led 0
  238. setrgb(led2r, led2g, led2b, (LED_TYPE *)&led[2]); // Led 2
  239. }
  240. rgblight_set ();
  241. # endif
  242. }
  243. // _FUN layer leds.
  244. void indicate_fun_stay (void) {
  245. # ifdef RGBLIGHT_ENABLE
  246. uint8_t led0r = 0; uint8_t led0g = 0; uint8_t led0b = 0;
  247. uint8_t led2r = 0; uint8_t led2g = 0; uint8_t led2b = 0;
  248. // See also below under _FUN layer led
  249. if (_fun_stay == TRUE) { // normal mode, 0 (100% normal)
  250. led0r = 255; // red
  251. led2r = 255; // Yellow
  252. led2g = 50;
  253. }else{
  254. led0r = 255; // Yellow
  255. led0g = 50; //
  256. led2r = 255; // red
  257. }
  258. setrgb(led0r, led0g, led0b, (LED_TYPE *)&led[0]); // Led 0
  259. setrgb(led2r, led2g, led2b, (LED_TYPE *)&led[2]); // Led 2
  260. isolate_rgblight_set ();
  261. # endif //RGBLIGHT_ENABLE
  262. }
  263. // _RAR layer leds
  264. // It is a function because this is called when the Base layer OTHER_BASE key is pressed
  265. void indicate_base (void) {
  266. # ifdef RGBLIGHT_ENABLE
  267. uint8_t led0r = 0; uint8_t led0g = 0; uint8_t led0b = 0;
  268. uint8_t led2r = 0; uint8_t led2g = 0; uint8_t led2b = 0;
  269. // See also below under _FUN layer led
  270. if (_NORMAL_ == alternate) { // normal mode, 0 (100% normal)
  271. led0r = 255; // shine white left led
  272. led0g = 255;
  273. led0b = 255;
  274. rgblight_sethsv_noeeprom (HSV_PURPLE); // This overrides the speed setting.
  275. led2r = 100; // purple
  276. led2b = 100;
  277. }
  278. # ifdef DVORAK_DESCRAMBLE // not used with other keymaps
  279. else if (_HALF_ == alternate) { // alternate mode, 1 (normal unicode)
  280. led0r = 100; // purple
  281. led0b = 100;
  282. rgblight_sethsv_noeeprom (HSV_WHITE); // shine white middle led (still breathes)
  283. led2r = 100; // purple
  284. led2b = 100;
  285. }
  286. # endif
  287. else if (_FULL_ == alternate) { // alternate mode, 1 (recomputed unicode for DVORAK_DESCRAMBLE)
  288. led0r = 100; // purple
  289. led0b = 100;
  290. rgblight_sethsv_noeeprom (HSV_PURPLE);
  291. led2r = 255;// shine white right led
  292. led2g = 255;
  293. led2b = 255;
  294. }
  295. setrgb(led0r, led0g, led0b, (LED_TYPE *)&led[0]); // Led 0
  296. setrgb(led2r, led2g, led2b, (LED_TYPE *)&led[2]); // Led 2
  297. isolate_rgblight_set ();
  298. # endif //RGBLIGHT_ENABLE
  299. }
  300. // Sets led colors for all layers. Including Capslock/Numlock changes. See a computer side activated function for that too:
  301. // led_update_user (…)
  302. void set_led_colors_ (layer_state_t state) {
  303. # ifdef RGBLIGHT_ENABLE
  304. uint8_t led0r = 0; uint8_t led0g = 0; uint8_t led0b = 0;
  305. uint8_t led2r = 0; uint8_t led2g = 0; uint8_t led2b = 0;
  306. short color_ddl = 28 ;
  307. # ifdef LEDS_OFF_BASE_DEF
  308. // Special case of switching centre led effect on/off
  309. if (!layer_state_cmp (state, _DEF_BASE)) { // letters
  310. //if (rgblight_is_enabled())
  311. if (led_middle_on) { // Follows user setting based on _RAR key.
  312. rgblight_enable_noeeprom (); // Would be easier if middle_led_control (…) could set brightness to dark, but seems to not work.
  313. }
  314. }
  315. # endif
  316. // The order should be the reverse of the #defines of layer number of the layers on top
  317. // because higher layer number is higher priority if activated
  318. /* _DEF_BASE 0 _ALT_BASE 1 _DEF_NSY 2 _ALT_NSY 3 _MOV 4 _RAR 5 _PAD 6 _ACC 7 _DRA 8 _BON 9 _FUN 10 */
  319. if (layer_state_cmp (state, _FUN)) { // F-keys, and layer toggles
  320. middle_led_control (HSV_RED); // purple
  321. indicate_fun_stay (); // Indicates state of _fun_stay, but only when it is being toggled.
  322. return ; // indicate_fun_stay function already does it all.
  323. }
  324. # ifndef REMOVE_BON // Removes this layer entirely, if set.
  325. else if (layer_state_cmp (state, _BON)) { // Bonus layer with encircled numbers and more symbols
  326. // side leds dark
  327. middle_led_control (HSV_YELLOW);
  328. }
  329. # endif // REMOVE_BON
  330. # ifndef REMOVE_DRA // This cuts out the whole _DRA layer
  331. else if (layer_state_cmp (state, _DRA)) { // Unicode drawings and unusual things
  332. led0r = 255; // gold red
  333. led0g = 128; //
  334. led2r = 255; //
  335. led2g = 128; //
  336. middle_led_control( HSV_GOLDENROD );
  337. }
  338. # endif // REMOVE_DRA
  339. # ifndef REMOVE_ACC // This cuts out the whole _ACC layer.
  340. else if (layer_state_cmp (state, _ACC)) { // Accented letters (Unicode input layer)
  341. led0g = 150; // With some blue, because it is also a symbol
  342. led0b = 100;
  343. led2g = 150;
  344. led2b = 100;
  345. middle_led_control (HSV_TURQUOISE); // cyan
  346. }
  347. # endif // REMOVE_ACC
  348. # ifndef REMOVE_PAD
  349. else if (layer_state_cmp (state, _PAD)) { // numbers pad layer
  350. if (numlock) {
  351. led0b = 255; // Blue for the numbers part
  352. led2g = 255; // Green for the navigation part
  353. }else{
  354. led0g = 255; // reversed
  355. led2b = 255; //
  356. }
  357. middle_led_control (60, 20, 100); // yellow (low saturation)
  358. }
  359. # endif // REMOVE_PAD
  360. //---
  361. else if (layer_state_cmp (state, _RAR)) { // layer with special keys
  362. indicate_base (); // this function already does it all
  363. return; //
  364. }
  365. //---
  366. else if (layer_state_cmp (state, _MOV)) { // movement layer
  367. led0g = 255;// movement is green, "go forward"
  368. led2g = 255;
  369. middle_led_control(HSV_GREEN);
  370. }
  371. //--- (pair)
  372. else if (layer_state_cmp (state, _ALT_NSY)) { // alternate, numbers/symbols
  373. led0b = 255; // first led follows the corresponding default layer: _DEF_NSY
  374. led2r = color_ddl; // Same as DDL, to which it belongs.
  375. led2g = color_ddl; //
  376. led2b = color_ddl; //
  377. middle_led_control (HSV_BLUE);
  378. }
  379. else if (layer_state_cmp (state, _DEF_NSY)) { // symbols and numbers
  380. led0b = 255; // blue for symbols, like ink (writing)
  381. led2b = 255;
  382. middle_led_control (HSV_BLUE);
  383. }
  384. //--- (pair)
  385. // Alternate BASE layer (alternate)
  386. else if (layer_state_cmp (state, _ALT_BASE)) {
  387. # ifdef LEDS_OFF_BASE_ALT // Alternative Base leds off (always)
  388. rgblight_disable_noeeprom ();
  389. # else // do use leds on Alternative Base layer
  390. # if !defined(BASE_NUMPAD__ALT_BASE) // Normal led colors for ‛regular’ base layers like Dvorak, Qwerty.
  391. if (capslock) {
  392. led2r = 255; // Brighter version to indicate capslock
  393. led2g = 255; //
  394. led2b = 255; //
  395. } else {
  396. led2r = color_ddl; // A bit of a white not too bright color on right
  397. led2g = color_ddl; //
  398. led2b = color_ddl; //
  399. }
  400. middle_led_control (HSV_TEAL); // seems to be the same as CYAN/AZURE, conflicts with _ACC
  401. # else // Numpad configured on Alternate Base, which should show the state of NumLock
  402. // This is a copy of the _PAD led colors, but less bright
  403. if (numlock) {
  404. led0b = 80; // Blue for the numbers part
  405. led2g = 80; // Green for the navigation part
  406. }else{
  407. led2b = 80; // reversed
  408. led0g = 80; //
  409. }
  410. middle_led_control (60, 20, 100); // light-blue
  411. # endif // BASE_NUMPAD__ALT_BASE
  412. # endif // LEDS_OFF_BASE_ALT
  413. }
  414. // Default layer (generally), normal BASE layer
  415. else if (layer_state_cmp (state, _DEF_BASE)) { // letters
  416. # ifdef LEDS_OFF_BASE_DEF // Default Base leds off (always)
  417. rgblight_disable_noeeprom ();
  418. # else // Do use leds on Default Base
  419. if (capslock) {
  420. led0r = 255; // Brighter version to indicate capslock
  421. led0g = 255; //
  422. led0b = 255; //
  423. } else {
  424. led0r = 28; // A bit of a weak white color on left
  425. led0g = 28; //
  426. led0b = 28; //
  427. }
  428. middle_led_control (HSV_TEAL);
  429. # endif // LEDS_OFF_BASE_DEF
  430. }
  431. //---
  432. // pushes the configuration
  433. setrgb (led0r, led0g, led0b, (LED_TYPE *)&led[0]); // Led 0
  434. setrgb (led2r, led2g, led2b, (LED_TYPE *)&led[2]); // Led 2
  435. isolate_rgblight_set (); // Activates the led color change, after on/off check.
  436. # endif //RGBLIGHT_ENABLE
  437. }
  438. // Pre-existing QMK function, called when NumLock/CapsLock key is pressed, including on another keyboard.
  439. // This function sets two booleans that keep track of the current capslock/numlock state, for use in layer led colors.
  440. bool led_update_user (led_t led_state) {
  441. if (led_state.num_lock) { // This doesn't look at the keyboard leds or any other actual leds. It seems to look at whether
  442. // or not the computer has numlock in the on/off state.
  443. numlock = TRUE;
  444. }else{
  445. numlock = FALSE;
  446. }
  447. if (led_state.caps_lock) {
  448. capslock = TRUE;
  449. }else{
  450. capslock = FALSE;
  451. }
  452. //layer_state_set_user
  453. set_led_colors_ (state_recall); // Update leds
  454. return true ;
  455. }
  456. // pre-existing function, called when layer changes
  457. layer_state_t layer_state_set_user (layer_state_t state) {
  458. set_led_colors_ (state); // Update leds
  459. state_recall = state; // Recall this, for calling set_led_colors_(…) on Num/Capslock changes in led_update_user(…)
  460. return state;
  461. }
  462. // -------------------------------- layers --------------------------------
  463. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  464. /******************** What base layers to use: **************/
  465. // * Dvorak *
  466. # if defined(BASE_DVORAK__DEF_BASE) || defined(BASE_DVORAK__ALT_BASE)
  467. # include "./base_dvorak.c" // Regular Dvorak.
  468. # endif
  469. // * Dvorak descramble *
  470. # if defined(BASE_DVORAK_DESCRAMBLE__ALT_BASE) // only for ‛Alternate’ base
  471. # include "./base_dvorak_descramble.c" // Dvorak for when computer is already remapping to Dvorak.
  472. # endif
  473. // * Qwerty *
  474. # if defined(BASE_QWERTY__DEF_BASE) || defined(BASE_QWERTY__ALT_BASE)
  475. # include "./base_qwerty.c" // Regular Qwerty.
  476. # endif
  477. // * Qwerty arrows on Base *
  478. # if defined(BASE_QWERTY_BASEARROW__DEF_BASE) || defined(BASE_QWERTY_BASEARROW__ALT_BASE)
  479. # include "./base_qwerty_basearrow.c" // Qwerty + arrows
  480. # endif
  481. // * Colemak *
  482. # if defined(BASE_COLEMAK__DEF_BASE) || defined(BASE_COLEMAK__ALT_BASE)
  483. # include "./base_colemak.c" // Regular Colemak.
  484. # endif
  485. // * Workman *
  486. # if defined(BASE_WORKMAN__DEF_BASE) || defined(BASE_WORKMAN__ALT_BASE)
  487. # include "./base_workman.c" // Regular Workman.
  488. # endif
  489. // * Numpad *
  490. # if defined(BASE_NUMPAD__ALT_BASE)
  491. # include "./base_numpad.c" // Numbers pad
  492. # endif
  493. // // ⬇ insert your ./base_YOUR_KEYMAP.c #include here:
  494. // * YOUR KEYMAP *
  495. // # if defined(BASE_YOUR_KEYMAP__DEF_BASE) || defined(BASE_YOUR_KEYMAP__ALT_BASE)
  496. // # include "./base_YOUR_KEYMAP.c" // Your Keymap.
  497. // # endif
  498. // If your keymap also has a ./base_YOUR_KEYMAP.h configuration/header file, #include it in ./user_config.h
  499. // Look for similar inclusions of base header files, similar to the #includes here.
  500. // You should be able to just copy what you did here, and only change “.c” into “.h”.
  501. // // ⬆
  502. // See the ./bases_*.c file for definition of _DEF_BASE, _DEF_NSY, _ALT_BASE, _ALT_NSY layers, selected in ./user_config.h
  503. /* ⬆⬇ (next layer) */
  504. # ifndef BASESFILE_LAYER_MOV // Use a definition of this layer in the ./bases_* file, where this #define can be defined.
  505. /* Layer _MOV: Movement layer: mouse and hands on navigation
  506. * Also delete/backspace, to navigate and delete together.
  507. */
  508. [ _MOV ] = LAYOUT_redefined (
  509. /*
  510. Layer _MOV (MOVement, mouse movement on right hand)
  511. triangle layout (mouse right hand):
  512. <pinky2<pinky<ring <middl<index<indx2| indx2>index>middl>ring> pinky>pink2>
  513. <|>-*- //(toggle) on _FUN
  514. BASE PgDn Up PgUp Home Btn3 | xxx WhDn MsUp WhU WhLft Bksp
  515. LCtl Left Down Right End Btn1 | Btn1 MsLft MsDn MsRht WhRht RCtl
  516. LSht*- xxx Acc2 Acc1 Acc0 Btn2 | Btn2 Btn3 Btn4 Btn5 xxx RSht //(toggle) on BASE
  517. ----------------------------------------------------------------------------
  518. LAlt Del Ent ___ | PgUp PgDn LGUI RAlt
  519. -*-<|> //(hold) on BASE
  520. <1 ± <2 <3 <4 | 4> 3> 2> ± 1>
  521. … …
  522. triangle layout, 'arrow' additional hardware key, with arrow cluster (difference marked _):
  523. <pinky2<pinky<ring <middl<index<indx2| indx2>index>middl>ring> pinky>pink2>
  524. <|>-*- //(toggle) on _FUN
  525. BASE PgDn Up PgUp Home Btn3 | xxx WhDn MsUp WhU WhLft Bksp
  526. LCtl Left Down Right End Btn1 | Btn1 MsLft MsDn MsRht WhRht RCtl
  527. LSht*- xxx Acc2 Acc1 Acc0 Btn2 | Btn2 Btn3 Btn4 Btn5 _Up_ RSht //(toggle) on BASE
  528. ----------------------------------------------------------------------------
  529. LAlt Del Ent ___ | PgUp PgDn _Left__Down__Right_
  530. -*-<|> //(hold) on BASE
  531. <1 ± <2 <3 <4 | 4> 3> 2> _±_ 1>
  532. triangle layout, 'arrow' additional hardware key, with arrow cluster and navigation keys:
  533. <pinky2<pinky<ring <middl<index<indx2| indx2>index>middl>ring> pinky>pink2>
  534. <|>-*- //(toggle) on _FUN
  535. BASE PgDn Up PgUp Home _Btn4_ | xxx WhDn MsUp WhU WhLft Bksp
  536. LCtl Left Down Right End Btn1 | Btn1 MsLft MsDn MsRht WhRht RCtl
  537. LSht*- xxx Acc2 Acc1 Acc0 _Btn5_ | Btn2 Btn3 _Home__PgUp_ _Up_ _PgDn_ //(toggle) on BASE
  538. ----------------------------------------------------------------------------
  539. LAlt Del Ent ___ | PgUp _End_ _Left__Down__Right_
  540. -*-<|> //(hold) on BASE
  541. <1 ± <2 <3 <4 | 4> 3> 2> _±_ 1>
  542. flat layout (mouse movement on left hand):
  543. <pinky2<pinky<ring <middl<index<indx2| indx2>index>middl>ring> pinky>pink2>
  544. <|>-*- //(toggle) on _FUN
  545. BASE WLft WDn WUp WRht xxx | Btn3 PgUp Home End PgDn Bksp
  546. LCtl MLft MDn MUp MRht Btn1 | Btn1 Left Up Down Right RCtl
  547. LSht*- Btn5 Btn4 Btn3 Butn2 xxx | Btn2 Acc0 Acc1 Acc2 xxx RSht //(toggle) on BASE
  548. ----------------------------------------------------------------------------
  549. LAlt Del Ent ___ | PgUp PgDn LGUI RAlt
  550. -*-<|> //(hold) on BASE
  551. <1 ± <2 <3 <4 | 4> 3> 2> ± 1>
  552. flat layout, 'arrow' additional hardware key, with arrow cluster (difference marked _)
  553. <pinky2<pinky<ring <middl<index<indx2| indx2>index>middl>ring> pinky>pink2>
  554. <|>-*- //(toggle) on _FUN
  555. BASE WLft WDn WUp WRht xxx | Btn3 PgUp Home End PgDn Bksp
  556. LCtl MLft MDn MUp MRht Btn1 | Btn1 Left Up Down Right RCtl
  557. LSht*- Btn5 Btn4 Btn3 Butn2 xxx | Btn2 Acc0 Acc1 Acc2 xxx RSht //(toggle) on BASE
  558. ----------------------------------------------------------------------------
  559. LAlt Del Ent ___ | PgUp _Left_ _Up_ _Down__Right_
  560. -*-<|> //(hold) on BASE
  561. <1 ± <2 <3 <4 | 4> 3> 2> _±_ 1>
  562. flat layout, 'arrow' additional hardware key, with arrow cluster and additional navigation keys:
  563. <pinky2<pinky<ring <middl<index<indx2| indx2>index>middl>ring> pinky>pink2>
  564. <|>-*- //(toggle) on _FUN
  565. BASE WLft WDn WUp WRht xxx |_Acc2_ PgUp Home End PgDn Bksp
  566. LCtl MLft MDn MUp MRht Btn1 | Btn1 Left Up Down Right RCtl
  567. LSht*- Btn5 Btn4 Btn3 Butn2 xxx |_Acc1_ Acc0 _PgUp__Home__End_ _PgDn_ //(toggle) on BASE
  568. ----------------------------------------------------------------------------
  569. LAlt Del Ent ___ | PgUp _Left_ _Up_ _Down__Right_
  570. -*-<|> //(hold) on BASE
  571. <1 ± <2 <3 <4 | 4> 3> 2> _±_ 1>
  572. flat layout, 'arrow' additional hardware key, with arrow cluster, additional navigation keys, vi(1) layout:
  573. <pinky2<pinky<ring <middl<index<indx2| indx2>index>middl>ring> pinky>pink2>
  574. <|>-*- //(toggle) on _FUN
  575. BASE WLft WDn WUp WRht xxx |_Acc2_ PgUp Home End PgDn Bksp
  576. LCtl MLft MDn MUp MRht Btn1 | Left Down Up Right Btn1 RCtl
  577. LSht*- Btn5 Btn4 Btn3 Butn2 xxx |_Acc1_ Acc0 _PgUp__Home__End_ _PgDn_ //(toggle) on BASE
  578. ----------------------------------------------------------------------------
  579. LAlt Del Ent ___ | PgUp _Left_ _Down__Up_ _Right_
  580. -*-<|> //(hold) on BASE
  581. <1 ± <2 <3 <4 | 4> 3> 2> _±_ 1>
  582. */
  583. /* Inner default navigation/mouse layout. 11 means row 1, column 1, etc.
  584. * Configured for arrows on the right, mouse on the left (BTN* on the left side, that is).
  585. */
  586. # ifndef ARROWS_TRIANGLE
  587. # define NAVI_11 KC_BTN3 // NAVI for 'navigation cluster', 11 for row 1, column 1, etc.
  588. # define NAVI_12 KC_PGUP
  589. # define NAVI_13 KC_HOME
  590. # define NAVI_14 KC_END
  591. # define NAVI_15 KC_PGDN
  592. # define NAVI_21 KC_BTN1
  593. # define NAVI_22 KC_LEFT
  594. # define NAVI_23 KC_UP
  595. # define NAVI_24 KC_DOWN
  596. # define NAVI_25 KC_RIGHT
  597. # define NAVI_31 KC_BTN2
  598. # define NAVI_32 KC_ACL0
  599. # define NAVI_33 KC_ACL1
  600. # define NAVI_34 KC_ACL2
  601. # define NAVI_35 XXXXXXX
  602. //-----------------------------------------------------------------------------------
  603. // Configured for left handed mouse, with xxx,BTN* on the right most column.
  604. # define MOUS_11 KC_WH_L // MOUS for mouse, etc.
  605. # define MOUS_12 KC_WH_D
  606. # define MOUS_13 KC_WH_U
  607. # define MOUS_14 KC_WH_R
  608. # define MOUS_15 XXXXXXX
  609. # define MOUS_21 KC_MS_L
  610. # define MOUS_22 KC_MS_D
  611. # define MOUS_23 KC_MS_U
  612. # define MOUS_24 KC_MS_R
  613. # define MOUS_25 KC_BTN1
  614. # define MOUS_31 KC_BTN5
  615. # define MOUS_32 KC_BTN4
  616. # define MOUS_33 KC_BTN3
  617. # define MOUS_34 KC_BTN2
  618. # define MOUS_35 XXXXXXX
  619. # endif
  620. // Alternative navigation/mouse layout: arrows in triangle, and left hand on the left 'wasd' location.
  621. // If you want these arrows on the right hand, you may want to edit this, to put right most column left, etc.
  622. # ifdef ARROWS_TRIANGLE
  623. # define NAVI_11 KC_PGDN
  624. # define NAVI_12 KC_UP
  625. # define NAVI_13 KC_PGUP
  626. # define NAVI_14 KC_HOME
  627. # define NAVI_15 KC_BTN3
  628. # define NAVI_21 KC_LEFT
  629. # define NAVI_22 KC_DOWN
  630. # define NAVI_23 KC_RIGHT
  631. # define NAVI_24 KC_END
  632. # define NAVI_25 KC_BTN1
  633. # define NAVI_31 XXXXXXX
  634. # define NAVI_32 KC_ACL2
  635. # define NAVI_33 KC_ACL1
  636. # define NAVI_34 KC_ACL0
  637. # define NAVI_35 KC_BTN2
  638. //------------------------------------------------------------------------------------
  639. // If switching hands to put mouse left, same as for navigation side: switch outer columns by editing here.
  640. # define MOUS_11 XXXXXXX
  641. # define MOUS_12 KC_WH_D
  642. # define MOUS_13 KC_MS_U
  643. # define MOUS_14 KC_WH_U
  644. # define MOUS_15 KC_WH_L
  645. # define MOUS_21 KC_BTN1
  646. # define MOUS_22 KC_MS_L
  647. # define MOUS_23 KC_MS_D
  648. # define MOUS_24 KC_MS_R
  649. # define MOUS_25 KC_WH_R
  650. # define MOUS_31 KC_BTN2
  651. # define MOUS_32 KC_BTN3
  652. # define MOUS_33 KC_BTN4
  653. # define MOUS_34 KC_BTN5
  654. # define MOUS_35 XXXXXXX
  655. # endif
  656. // Default left/right layout, meaning arrows right and mouse left.
  657. # ifndef ARROWS_LEFT
  658. # define LEFT_AA MOUS_11
  659. # define LEFT_AB MOUS_12
  660. # define LEFT_AC MOUS_13
  661. # define LEFT_AD MOUS_14
  662. # define LEFT_AE MOUS_15
  663. # define LEFT_BA MOUS_21
  664. # define LEFT_BB MOUS_22
  665. # define LEFT_BC MOUS_23
  666. # define LEFT_BD MOUS_24
  667. # define LEFT_BE MOUS_25
  668. # define LEFT_CA MOUS_31
  669. # define LEFT_CB MOUS_32
  670. # define LEFT_CC MOUS_33
  671. # define LEFT_CD MOUS_34
  672. # define LEFT_CE MOUS_35
  673. # define RGHT_AA NAVI_11
  674. # define RGHT_AB NAVI_12
  675. # define RGHT_AC NAVI_13
  676. # define RGHT_AD NAVI_14
  677. # define RGHT_AE NAVI_15
  678. # define RGHT_BA NAVI_21
  679. # define RGHT_BB NAVI_22
  680. # define RGHT_BC NAVI_23
  681. # define RGHT_BD NAVI_24
  682. # define RGHT_BE NAVI_25
  683. # define RGHT_CA NAVI_31
  684. # define RGHT_CB NAVI_32
  685. # define RGHT_CC NAVI_33
  686. # define RGHT_CD NAVI_34
  687. # define RGHT_CE NAVI_35
  688. # endif
  689. # ifdef ARROWS_LEFT
  690. # define LEFT_AA NAVI_11
  691. # define LEFT_AB NAVI_12
  692. # define LEFT_AC NAVI_13
  693. # define LEFT_AD NAVI_14
  694. # define LEFT_AE NAVI_15
  695. # define LEFT_BA NAVI_21
  696. # define LEFT_BB NAVI_22
  697. # define LEFT_BC NAVI_23
  698. # define LEFT_BD NAVI_24
  699. # define LEFT_BE NAVI_25
  700. # define LEFT_CA NAVI_31
  701. # define LEFT_CB NAVI_32
  702. # define LEFT_CC NAVI_33
  703. # define LEFT_CD NAVI_34
  704. # define LEFT_CE NAVI_35
  705. # define RGHT_AA MOUS_11
  706. # define RGHT_AB MOUS_12
  707. # define RGHT_AC MOUS_13
  708. # define RGHT_AD MOUS_14
  709. # define RGHT_AE MOUS_15
  710. # define RGHT_BA MOUS_21
  711. # define RGHT_BB MOUS_22
  712. # define RGHT_BC MOUS_23
  713. # define RGHT_BD MOUS_24
  714. # define RGHT_BE MOUS_25
  715. # define RGHT_CA MOUS_31
  716. # define RGHT_CB MOUS_32
  717. # define RGHT_CC MOUS_33
  718. # define RGHT_CD MOUS_34
  719. # define RGHT_CE MOUS_35
  720. # endif
  721. /* Definition of the additional arrow cluster with optional navigation keys, for the 'arrow' hardware layout.
  722. *
  723. * By default what becomes the up-arrow (row 2, 2nd key from right) is a no-action key on this layer,
  724. * which can be displaced without worry.
  725. * Keys that are displaced for the larger arrow cluster with navigation keys, get moved to the second definition
  726. * of KC_BTN2 and KC_BTN3, which is on the non-mouse hand.
  727. *
  728. * Only the version where the triangle arrows are defined for the left hand, or the version where the flat line
  729. * arrows are defined for the right hand, are supported.
  730. *
  731. * There are several configurations, worked down in order to keep this mess under control.
  732. *
  733. * v----------------------not-defined-------------v----------------v
  734. * !MOREKEY2_ARROW_CLUSTER !MOREKEY2_ADD_NAVIGATION !ARROWS_TRIANGLE !ARROWS_LEFT
  735. * defined MOREKEY2_ARROW_CLUSTER ...................... yes yes yes
  736. * defined MOREKEY2_ADD_NAVIGATION yes ....................... yes only for flat arrows
  737. * defined ARROWS_TRIANGLE yes yes ............... no
  738. * defined ARROWS_LEFT yes only for triangle yes ...........
  739. * MOREKEY2_ARROW_CLUSTER MOREKEY2_ADD_NAVIGATION ARROWS_TRIANGLE ARROWS_LEFT
  740. * ^--------------------------defined-------------^----------------^
  741. *
  742. * Definition order:
  743. * 0 no arrow cluster (and therefore no additional navigation keys either)
  744. * 1 triangle arrows with arrow cluster
  745. * 2 '' '' + additional navigation and repositioning displaced keys
  746. * 3 flat arrows with arrow cluster
  747. * 4 '' '' + additional navigation and repositioning displaced keys
  748. */
  749. /* 0 (Nothing special, just the default keys)*/
  750. // Default layout without arrow cluster. (With a little imagination you can visualize the keyboard.)
  751. # if !defined(MOREKEY2_ARROW_CLUSTER)
  752. // Default
  753. # define _MOV_KEY_ROW2_KEY1 KC_RSFT
  754. # define _MOV_KEY_ROW2_KEY2 RGHT_CE // Key counting from the right to the left.
  755. # define _MOV_KEY_ROW2_KEY3 RGHT_CD
  756. # define _MOV_KEY_ROW2_KEY4 RGHT_CC
  757. // ------------------------------------------
  758. # define _MOV_KEY_ROW1_KEY1 KC_RALT // ''
  759. # define _MOV_KEY_ROW1_KEY2 MORE_key2 // ''
  760. # define _MOV_KEY_ROW1_KEY3 KC__YGUI // '' (etc)
  761. # define _MOV_KEY_ROW1_KEY4 KC_PGDN
  762. // <|,> , , , ,
  763. // |, 4> , 3> , 2> , ± , 1> // ± is the additional hardware key
  764. # endif
  765. /* 1 (triangle arrows with arrow cluster) */
  766. // Patch in the arrows for arrow triangle layout
  767. # if defined(MOREKEY2_ARROW_CLUSTER) && defined(ARROWS_TRIANGLE)
  768. // Arrow cluster
  769. # define _MOV_KEY_ROW2_KEY2 KC_UP
  770. // ------------------------------------------
  771. # define _MOV_KEY_ROW1_KEY1 KC_RIGHT
  772. # define _MOV_KEY_ROW1_KEY2 KC_DOWN
  773. # define _MOV_KEY_ROW1_KEY3 KC_LEFT
  774. // <|,> , , , ,
  775. // |, 4> , 3> , 2> , ± , 1>
  776. # endif
  777. // The default layout around the arrows
  778. # if defined(MOREKEY2_ARROW_CLUSTER) && !defined(MOREKEY2_ADD_NAVIGATION) && defined(ARROWS_TRIANGLE)
  779. // Default keys
  780. # define _MOV_KEY_ROW2_KEY1 KC_RSFT
  781. # define _MOV_KEY_ROW2_KEY3 RGHT_CD
  782. # define _MOV_KEY_ROW2_KEY4 RGHT_CC
  783. // ------------------------------------------
  784. # define _MOV_KEY_ROW1_KEY4 KC_PGDN
  785. // <|,> , , , ,
  786. // |, 4> , 3> , 2> , ± , 1>
  787. # endif
  788. /* 2 ( '' '' + additional navigation and repositioning displaced keys) */
  789. // Patch in the navigation keys for the arrow in triangle layout.
  790. # if defined(MOREKEY2_ADD_NAVIGATION) && defined(ARROWS_TRIANGLE) // Navigation additional keys (arrows implied).
  791. # define _MOV_KEY_ROW2_KEY1 KC_PGDN
  792. # define _MOV_KEY_ROW2_KEY3 KC_PGUP
  793. # define _MOV_KEY_ROW2_KEY4 KC_HOME
  794. // ------------------------------------------
  795. # define _MOV_KEY_ROW1_KEY4 KC_END
  796. // <|,> , , , ,
  797. // |, 4> , 3> , 2> , ± , 1>
  798. # endif
  799. // We have now overwritten the positions of RGHT_CC and RGHT_CD, which could be useful keys.
  800. // You don't want to mess with BTN1 on the other hand, because it needs to select together with mouse moving in many applications.
  801. # if defined(MOREKEY2_ADD_NAVIGATION) && defined(ARROWS_TRIANGLE) && defined(ARROWS_LEFT) // ARROWS_LEFT because the wider map is edited
  802. //
  803. // ... spelling this out to keep brain for exploding:
  804. // Overwritten (copied from above):
  805. // #define RGHT_CC MOUS_33
  806. // #define MOUS_33 KC_BTN4
  807. // #define RGHT_CD MOUS_34
  808. // #define MOUS_34 KC_BTN5
  809. // 'BTN4' and 'BTN5' are overwritten.
  810. // Where are KC_BTN2 and KC_BTN3 on the non-mouse hand:
  811. // #define NAVI_15 KC_BTN3
  812. // #define LEFT_AE NAVI_15
  813. // #define NAVI_35 KC_BTN2
  814. // #define LEFT_CE NAVI_35
  815. // 'LEFT_AE' and 'LEFT_CE' provide room.
  816. //
  817. # undef LEFT_AE
  818. # define LEFT_AE KC_BTN4
  819. # undef LEFT_CE
  820. # define LEFT_CE KC_BTN5
  821. # endif
  822. /* 3 (flat arrows with arrow cluster) */
  823. # if defined(MOREKEY2_ARROW_CLUSTER) && !defined(ARROWS_TRIANGLE)
  824. // arrow cluster
  825. # define _MOV_KEY_ROW1_KEY1 KC_RIGHT
  826. # define _MOV_KEY_ROW1_KEY2 KC_DOWN
  827. # define _MOV_KEY_ROW1_KEY3 KC_UP
  828. # define _MOV_KEY_ROW1_KEY4 KC_LEFT
  829. // <|,> , , , ,
  830. // |, 4> , 3> , 2> , ± , 1>
  831. # endif
  832. // The default layout around the arrows
  833. # if defined(MOREKEY2_ARROW_CLUSTER) && !defined(MOREKEY2_ADD_NAVIGATION) && !defined(ARROWS_TRIANGLE)
  834. // Default
  835. # define _MOV_KEY_ROW2_KEY1 KC_RSFT
  836. # define _MOV_KEY_ROW2_KEY2 RGHT_CE // Key counting from the right to the left.
  837. # define _MOV_KEY_ROW2_KEY3 RGHT_CD
  838. # define _MOV_KEY_ROW2_KEY4 RGHT_CC
  839. // <|,> , , , ,
  840. // |, 4> , 3> , 2> , ± , 1>
  841. # endif
  842. /* 4 ( '' '' + additional navigation and repositioning displaced keys) */
  843. // The definitions for the additional navigation keys (HOME, etc)
  844. # if defined(MOREKEY2_ADD_NAVIGATION) && !defined(ARROWS_TRIANGLE)
  845. // Additional navigation keys: flat
  846. # define _MOV_KEY_ROW2_KEY1 KC_PGDN
  847. # define _MOV_KEY_ROW2_KEY2 KC_END
  848. # define _MOV_KEY_ROW2_KEY3 KC_HOME
  849. # define _MOV_KEY_ROW2_KEY4 KC_PGUP
  850. // <|,> , , , ,
  851. // |, 4> , 3> , 2> , ± , 1>
  852. # endif
  853. // Replace the overwritten key positions:
  854. # if defined(MOREKEY2_ADD_NAVIGATION) && !defined(ARROWS_TRIANGLE) && !defined(ARROWS_LEFT) // !ARROWS_LEFT because the wider map is edited
  855. //
  856. // Overwritten (copied from above):
  857. // #define RGHT_CC NAVI_33
  858. // #define NAVI_33 KC_ACL1
  859. // #define RGHT_CD NAVI_34
  860. // #define NAVI_34 KC_ACL2
  861. // 'KC_ACL1' and 'KC_ACL2' are overwritten.
  862. // Where are BTN2 and BTN3 on the non-mouse hand:
  863. // #define NAVI_11 KC_BTN3
  864. // #define RGHT_AA NAVI_11
  865. // #define NAVI_31 KC_BTN2
  866. // #define RGHT_CA NAVI_31
  867. // 'RGHT_AA' and 'RGHT_CA' provide room.
  868. // It seems best to count the acceleration keys from right to left/up on the keyboard.
  869. //
  870. # undef RGHT_AA
  871. # define RGHT_AA KC_ACL2
  872. # undef RGHT_CA
  873. # define RGHT_CA KC_ACL1
  874. # endif
  875. // Changes the home row on the right hand to become HJKL (as in Qwerty) vi(1) arrow keys,
  876. // and causes the arrow block to move one key to the left. The key lost on the left is
  877. // put back on the other end (pinky).
  878. // Row 3
  879. # if defined(VI_SWITCHERYDOO) && !defined(ARROWS_TRIANGLE) // For all hardware variants
  880. // |, indx2> , index> , middl> , ring> , pinky> , pink2> ,
  881. // <|,> , , , , , ,
  882. # undef RGHT_BA
  883. # define RGHT_BA KC_LEFT
  884. # undef RGHT_BB
  885. # define RGHT_BB KC_DOWN
  886. # undef RGHT_BC
  887. # define RGHT_BC KC_UP
  888. # undef RGHT_BD
  889. # define RGHT_BD KC_RIGHT
  890. # undef RGHT_BE
  891. # define RGHT_BE KC_BTN1
  892. # endif
  893. // Row 1
  894. # if defined(VI_SWITCHERYDOO) && !defined(ARROWS_TRIANGLE) && defined(MOREKEY2_ARROW_CLUSTER) // Only for 'arrow' hardware
  895. // arrow cluster
  896. # undef _MOV_KEY_ROW1_KEY1
  897. # define _MOV_KEY_ROW1_KEY1 KC_RIGHT
  898. # undef _MOV_KEY_ROW1_KEY2
  899. # define _MOV_KEY_ROW1_KEY2 KC_UP
  900. # undef _MOV_KEY_ROW1_KEY3
  901. # define _MOV_KEY_ROW1_KEY3 KC_DOWN
  902. # undef _MOV_KEY_ROW1_KEY4
  903. # define _MOV_KEY_ROW1_KEY4 KC_LEFT
  904. // <|,> , , , ,
  905. // |, 4> , 3> , 2> , ± , 1>
  906. # endif
  907. // (If you want to alter something in detail just for your keyboard, it is probably smart to just write in the keycodes (like KC_PGUP) in the final definitions here below.)
  908. //
  909. // <pink2 , <pinky , <ring , <middl , <index , <indx2 |, indx2> , index> , middl> , ring> , pinky> , pink2> ,
  910. // , , , -*- , , <|,> , , , , , ,
  911. CTO_BASE , LEFT_AA , LEFT_AB , LEFT_AC , LEFT_AD , LEFT_AE , RGHT_AA , RGHT_AB , RGHT_AC , RGHT_AD , RGHT_AE , KC_BSPC ,
  912. KC_LCTL , LEFT_BA , LEFT_BB , LEFT_BC , LEFT_BD , LEFT_BE , RGHT_BA , RGHT_BB , RGHT_BC , RGHT_BD , RGHT_BE , KC_RCTL ,
  913. KC_LSFT , LEFT_CA , LEFT_CB , LEFT_CC , LEFT_CD , LEFT_CE , RGHT_CA , RGHT_CB , _MOV_KEY_ROW2_KEY4 , _MOV_KEY_ROW2_KEY3 , _MOV_KEY_ROW2_KEY2 , _MOV_KEY_ROW2_KEY1 ,
  914. // --------------------------------------------------------------------------------------------------------------------------------------------------------------------
  915. KC_LALT
  916. # ifdef TRANSMINIVAN_LEFTSIDE
  917. , TRANS_LEFT
  918. # endif
  919. # ifdef MORE_KEY__COMMAND
  920. , MORE_key1
  921. # endif
  922. , KC_DEL , KC_ENT
  923. # ifndef SPACE_LEFT__ENTER_RIGHT // standard, layer switch on Base
  924. , _______
  925. # else // reversed
  926. , KC_PGUP
  927. # endif
  928. # ifdef TRANSMINIVAN_MIDLEFT
  929. , TRANS_MIDLEFT
  930. # endif
  931. # ifndef SPACE_LEFT__ENTER_RIGHT // standard
  932. , KC_PGUP
  933. # else // reversed, layer switch on Base
  934. , _______
  935. # endif
  936. # ifdef TRANSMINIVAN_RIGHTSIDE
  937. , TRANS_RIGHT
  938. # endif
  939. , _MOV_KEY_ROW1_KEY4 , _MOV_KEY_ROW1_KEY3
  940. # ifdef MORE_KEY__ARROW
  941. , _MOV_KEY_ROW1_KEY2
  942. # endif
  943. , _MOV_KEY_ROW1_KEY1
  944. // , , , -*- <|,> , , ,
  945. // <1 ±± , <2 , <3 , <4 |, 4> , 3> , 2> , ± ± 1>
  946. ),
  947. # endif // BASESFILE_LAYER_MOV
  948. /* ⬆⬇ */
  949. # ifndef BASESFILE_LAYER_RAR // Use a definition of this layer in the ./bases_* file, where this #define can be defined.
  950. /* Layer _RAR: Various special keys.
  951. * - The key which switches between Default and Alternate base layer.
  952. * - Power keys
  953. * The power keys have to be pressed with Shift, as a safety guard.
  954. * Without shift they write their name, as if someone typed it.
  955. * - Media keys
  956. * - Brightness for screen keys (depends on computer system if it works)
  957. * - Leds of keyboard on/off
  958. * - Unicode input mode
  959. * ☑ precedes the Unicode input modes, as memory aid and tester
  960. * Note that ☑ has no letters in its Unicode, but press with Shift for 🗹
  961. * which does. This matters when testing ‛descramble’ Dvorak mode.
  962. * - Capslock is on its normal position
  963. * - Insert
  964. * - APP (whatever it is) fakes being next to right GUI (though other layer).
  965. * - The traditional obsolete button like ScrLk/PrtSc are also included, in
  966. * case some program needs them.
  967. * - Speed measuring
  968. * - Text size measuring
  969. * - Some unused spots remaining.
  970. */
  971. [ _RAR ] = LAYOUT_redefined (
  972. /*
  973. _RAR (RARe keys. Power keys, Unicode mode, Alternate BASE, Media, Brightness, Speed, leds, …)
  974. <pink2<pinky <ring <middl <indexx<indx2| indx2>index>middl>ring> pinky> pink2>
  975. <|> -*- //(toggle) on _FUN
  976. BASE Cnt/Mx Cnull CWmin CRprt Speed | SRprt Play Next Prev Stop RSht(•)
  977. CapsL Power• Wake• Sleep• Pause• ScrLk | PrtSc xxx Vol+ Vol- Mute Insert // • requires Shift
  978. ☑ uLNX uBSD uOSX uWIN uWNC | xxx xxx Bri+ Bri- xxx APP // Ü(nicode) tester
  979. ----------------------------------------------------------------------------
  980. SLed MLeds RGUI xxx | !Alter xxx LGUI ___ // Middle-led, Side-leds, ! 'alternate'
  981. <|> -*- // (Hold) on BASE
  982. <1 ± <2 ± <3 <4 | 4> 3> 2> ± 1>
  983. … …
  984. */
  985. //
  986. // <pink2 , <pinky , <ring , <middl , <index , <indx2 |, indx2> , index> , middl> , ring> , pinky> , pink2> ,
  987. // , , , , -*- , <|,> , , , , , ,
  988. CTO_BASE , COUNT_TOG , COUNT_NULL , COUNT_WORDMIN , COUNT_REPORT , SPEED_TOG , SPEED_REPORT , KC_MPLY , KC_MNXT , KC_MPRV , KC_MSTP , KC_RSFT ,
  989. KC_CAPS , C_KC_PWR , C_KC_WAKE , C_KC_SLEP , C_KC_PAUS , KC_SLCK , KC_PSCR , XXXXXXX , KC_VOLU , KC_VOLD , KC_MUTE , KC_INS ,
  990. XP_DRA_CG , UNICODE_MODE_LNX , UNICODE_MODE_BSD , UNICODE_MODE_OSX , UNICODE_MODE_WIN , UNICODE_MODE_WINC , XXXXXXX , XXXXXXX , KC_BRIGHTNESS_UP , KC_BRIGHTNESS_DOWN , XXXXXXX , KC_APP ,
  991. // -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  992. LEDS_ON
  993. # ifdef TRANSMINIVAN_LEFTSIDE
  994. , TRANS_LEFT
  995. # endif
  996. # ifdef MORE_KEY__COMMAND
  997. , MORE_key1
  998. # endif
  999. # ifdef LEDS_OFF_BASE_DEF // This messes with led effect on/off, so we need to track the state of this setting now.
  1000. , RGBTOG_
  1001. # else // Here we don't mess with led effect on/off, so we can use QMK key blindly.
  1002. , RGB_TOG
  1003. # endif
  1004. , KC__XGUI , XXXXXXX
  1005. # ifdef TRANSMINIVAN_MIDLEFT
  1006. , TRANS_MIDLEFT
  1007. # endif
  1008. , OTHER_BASE , XXXXXXX
  1009. # ifdef TRANSMINIVAN_RIGHTSIDE
  1010. , TRANS_RIGHT
  1011. # endif
  1012. , KC__YGUI
  1013. # ifdef MORE_KEY__ARROW
  1014. , MORE_key2
  1015. # endif
  1016. , _______
  1017. // , , , <|,> , , ,
  1018. // <1 ± ± , <2 , <3 , <4 |, 4> , 3> , 2> , ± ± 1>
  1019. ),
  1020. # endif // BASESFILE_LAYER_RAR
  1021. /* ⬆⬇ */
  1022. # ifndef REMOVE_PAD // This removes all references to _PAD in the code, therefore is not functionally the same as BASESFILE_LAYER_PAD
  1023. # ifndef BASESFILE_LAYER_PAD // Use a definition of this layer in the ./bases_* file, where this #define can be defined.
  1024. # ifndef NUMPAD_COMMON_SQUARE // Use default _PAD layer, where numbers are aligned as they are on _NSY.
  1025. // Conversely, if this is defined, this layer will resembel a numeric keypad.
  1026. // See also base_numpad.c
  1027. /* Layer _PAD: Numbers pad, for numbers pad version of numbers (computer programs can see the difference).
  1028. * Number pad navigation will be more or less useless, but there is a repetition of the Numpad
  1029. * keys 4,2,8,6 row 4 for arrows, and 3,1,7,9 row 2 for navigation, to make it a little easier to find.
  1030. */
  1031. [ _PAD ] = LAYOUT_redefined (
  1032. /*
  1033. Layer _PAD Numbers Pad (special symbol versions; regular '1' is not the same as this numpad '1', etc)
  1034. <pink2 <pinky<ring <middl<index<indx2| indx2>index>middl>ring> pinky>pink2>
  1035. -*- <|> //(toggle) on _FUN
  1036. BASE xxx xxx .DEL 4LEFT 2DOWN | 8UP 6RGHT * xxx xxx Bksp
  1037. LCtl 1END 2DOWN 3PGDN 4LEFT 5 | 6RGHT 7HOME 8UP 9PGUP 0INS -
  1038. LSht xxx xxx / xxx = | + 3PGDN 1END 7HOME 9PGUP RSht
  1039. -*---------------------------------------------------------------------------- //-*- toggle on BASE
  1040. LAlt Del Tab ENT | NUML xxx LGUI RAlt
  1041. <|>
  1042. <1 ± <2 <3 <4 | 4> 3> 2> ± 1>
  1043. … …
  1044. */
  1045. //
  1046. // <pink2 , <pinky , <ring , <middl , <index , <indx2 |, indx2> , index> , middl> , ring> , pinky> , pink2> ,
  1047. // , , , , , -*- <|,> , , , , , ,
  1048. CTO_BASE , XXXXXXX , XXXXXXX , KC_KP_DOT , KC_KP_4 , KC_KP_2 , KC_KP_8 , KC_KP_6 , KC_KP_ASTERISK , XXXXXXX , XXXXXXX , KC_BSPC ,
  1049. KC_LCTL , KC_KP_1 , KC_KP_2 , KC_KP_3 , KC_KP_4 , KC_KP_5 , KC_KP_6 , KC_KP_7 , KC_KP_8 , KC_KP_9 , KC_KP_0 , KC_KP_MINUS ,
  1050. KC_LSFT , XXXXXXX , XXXXXXX , KC_KP_SLASH , XXXXXXX , KC_KP_EQUAL , KC_KP_PLUS , KC_KP_3 , KC_KP_1 , KC_KP_7 , KC_KP_9 , KC_RSFT ,
  1051. // ----------------------------------------------------------------------------------------------------------------------------------------------
  1052. KC_LALT
  1053. # ifdef TRANSMINIVAN_LEFTSIDE
  1054. , _______ // On Base layers this key typically defaults to MO ( _PAD )
  1055. # endif
  1056. # ifdef MORE_KEY__COMMAND
  1057. , MORE_key1
  1058. # endif
  1059. , KC_DEL , KC_TAB , KC_KP_ENTER
  1060. # ifdef TRANSMINIVAN_MIDLEFT
  1061. , TRANS_MIDLEFT
  1062. # endif
  1063. , KC_NUMLOCK , XXXXXXX , KC__YGUI
  1064. # ifdef TRANSMINIVAN_RIGHTSIDE
  1065. , TRANS_RIGHT
  1066. # endif
  1067. # ifdef MORE_KEY__ARROW
  1068. , MORE_key2
  1069. # endif
  1070. , KC_RALT
  1071. // , , , <|,> , , ,
  1072. // <1 ± ± , <2 , <3 , <4 |, 4> , 3> , 2> , ± ± 1>
  1073. ),
  1074. # else // NUMPAD_COMMON_SQUARE
  1075. [ _PAD ] = LAYOUT_redefined (
  1076. /*
  1077. * Layer _PAD: Option for a different _PAD layer in the common layers system.
  1078. * This variety resembles the square layout of a numerical keyboard.
  1079. * It is different from one of the Numpad Base layer compile options, in that
  1080. * it only has a number pad for the right hand. It is also different in featuring
  1081. * modifiers, and the overall layout is sligthly different (Enter, = symbol).
  1082. *
  1083. * ‛Tab’ on key 3 left hand is the same as the other _PAD layer option (with the
  1084. * numbers in a line, equal to the _NSY layer), to retain the same ability to
  1085. * type Control-Tab. It seems better to have RAlt in its usual place, Enter in
  1086. * its usual place, than to strictly follow a standard numeric keyboard layout
  1087. * (which puts Enter somewhere on the right, row 1). It seems easy enough to
  1088. * type Enter on this key as well, even with the right hand. Numlock is also
  1089. * in its usual place. Note that ‛Del’ on the left, row 1, is not a numbers pad
  1090. * Delete/Dot key, but standard Delete, also in the usual place.
  1091. *
  1092. * This is probably the better one of the square layout numpads, unless you have a use
  1093. * for the two hands version. This is also available on ‛Base’ Numpad.
  1094. *
  1095. Layer _PAD (Number pad, with NumLock on)
  1096. <pink2 <pinky<ring <middl<index<indx2| indx2>index>middl>ring>pin>pink2>
  1097. <|>
  1098. BASE xxx xxx xxx xxx xxx | = 7 8 9 - Bspc
  1099. LCtl xxx xxx xxx xxx xxx | * 4 5 6 + RCtl
  1100. LSht xxx xxx xxx xxx xxx | / 1 2 3 , RSht
  1101. ------------------------------------------------------------------------
  1102. LAlt Del Tab Ent | NumL 0 . RAlt
  1103. <|>
  1104. <1 ± <2 <3 <4 | 4> 3> 2> ± 1>
  1105. … | …
  1106. Layer _PAD (Number pad, with NumLock off)
  1107. <pink2 <pinky<ring <middl<index<indx2| indx2>index>middl>ring >pin>pink2>
  1108. <|>
  1109. BASE xxx xxx xxx xxx xxx | = Home Up PgUp - Bspc
  1110. LCtl xxx xxx xxx xxx xxx | * Left 5 Right + RCtl
  1111. LSht xxx xxx xxx xxx xxx | / End Down PgDn , RSht
  1112. -------------------------------------------------------------------------
  1113. LAlt Del Tab Ent | NumL Ins Del RAlt
  1114. <|>
  1115. <1 ± <2 <3 <4 | 4> 3> 2> ± 1>
  1116. … | …
  1117. */
  1118. //
  1119. // <pink2 , <pinky , <ring , <middl , <index , <indx2 |, indx2> , index> , middl> , ring> , pinky> , pink2> ,
  1120. // , , , , , -*- <|,> , , , , , ,
  1121. CTO_BASE , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , KC_KP_EQUAL , KC_KP_7 , KC_KP_8 , KC_KP_9 , KC_KP_MINUS , KC_BSPC ,
  1122. KC_LCTL , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , KC_KP_ASTERISK , KC_KP_4 , KC_KP_5 , KC_KP_6 , KC_KP_PLUS , KC_RCTL ,
  1123. KC_LSFT , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , KC_KP_SLASH , KC_KP_1 , KC_KP_2 , KC_KP_3 , KC_KP_COMMA , KC_RSFT ,
  1124. // -----------------------------------------------------------------------------------------------------------------------------------
  1125. KC_LALT
  1126. # ifdef TRANSMINIVAN_LEFTSIDE
  1127. , TRANS_LEFT
  1128. # endif
  1129. # ifdef MORE_KEY__COMMAND
  1130. , MORE_key1
  1131. # endif
  1132. , KC_DEL , KC_TAB , KC_KP_ENTER
  1133. # ifdef TRANSMINIVAN_MIDLEFT
  1134. , TRANS_MIDLEFT
  1135. # endif
  1136. , KC_NUMLOCK , KC_KP_0
  1137. // See comment in ./base_numpad.c on the first layout (double handed Base layer), about the next few keys:
  1138. // This layer follows that layout Base Numpad.
  1139. // ---⬇
  1140. # ifdef TRANSMINIVAN_RIGHTSIDE
  1141. , TRANS_RIGHT
  1142. # endif
  1143. # ifdef MORE_KEY__ARROW
  1144. //, MORE_key2
  1145. , KC__YGUI
  1146. # endif
  1147. // ---⬆
  1148. , KC_KP_DOT
  1149. , KC_RALT
  1150. // , , , <|,> , , ,
  1151. // <1 ± ± , <2 , <3 , <4 |, 4> , 3> ± ± , 2> , 1>
  1152. ),
  1153. # endif // NUMPAD_COMMON_SQUARE
  1154. # endif // BASESFILE_LAYER_PAD
  1155. # endif // REMOVE_PAD
  1156. /* ⬆⬇ */
  1157. # ifndef REMOVE_ACC // This cuts out the whole _ACC layer.
  1158. # ifndef BASESFILE_LAYER_ACC // Use a definition of this layer in the ./bases_* file, where this #define can be defined.
  1159. /* Layer _ACC: Accented and other unusual characters. It seems this would
  1160. * cover Dutch, German, French, Scandinavia, Italy and Spain.
  1161. * It should helps with remembering what keys are where, if one
  1162. * knows the logic behind it (however flawed it might be).
  1163. * This layer has the uncluttered Tab key (whoohoo!).
  1164. *
  1165. * The logic is ... Versions of the vowels with accents are
  1166. * widened vertically on the board, from their
  1167. * normal position.
  1168. * Grave is a line going up, thus on upper row. é
  1169. * Acute is a line going down, thus on lower row. è
  1170. * Diaereses is dots going horizontal, thus middle. ë
  1171. * Diareses is umlaut which is most frequent if
  1172. * including German, thus home row. ë
  1173. * There is no room for Caret on the left, thus it is
  1174. * on the right, following same-finger logic (O
  1175. * is ring finger, etc).
  1176. * Caret is on the lower row to make room for versions
  1177. * of 'n' and 'c' near their normal position.
  1178. * There is no room for ÿŸ on the normal y, because
  1179. * íÍ is on it, which is more important, and to
  1180. * keep the logic of that block, therefore it is
  1181. * as close to it as can be.
  1182. * øØ and åÅ follow the same-finger logic (a is left
  1183. * hand pinky, etc), and are on remaining spots.
  1184. * œŒ and æÆ are also no remaining spots, both close
  1185. * to êÊ for the e in there, the œŒ being further
  1186. * to the left to follow the same finger logic on
  1187. * that right hand side: a on the right, o on the left.
  1188. * ¡ and ¿ had no more room on this layer, therefore,
  1189. * and because they are unusual, they are on the
  1190. * _DRA(wings) layer. They are located under the keys
  1191. * that also have ! and ?, respectively.
  1192. *
  1193. */
  1194. [ _ACC ] = LAYOUT_redefined (
  1195. /*
  1196. Layer _ACC (ACCented characters, see _RAR layer for input modes)
  1197. <pink2 <pinky<ring <middl<index<indx2| indx2>index>middl>ring> pinky>pink2>
  1198. -*- <|> //(toggle) on _FUN
  1199. BASE áÁ óÓ éÉ úÚ íÍ | ýÝ ijIJ çÇ øØ åÅ Bksp
  1200. RCTL(Tab) äÄ öÖ ëË üÜ ïÏ | ÿŸ œŒ æÆ ñÑ ß μ
  1201. LSht àÀ òÒ èÈ ùÙ ìÌ | îÎ ûÛ êÊ ôÔ â RSht
  1202. ----------------------------------------------------------------------------
  1203. LAlt ___ ___ Ent | Spc ___ ___ RAlt
  1204. -*- <|> //(hold) on BASE
  1205. <1 ± <2 <3 <4 | 4> 3> 2> ± 1>
  1206. … …
  1207. */
  1208. //
  1209. // <pink2 , <pinky , <ring , <middl , <index , <indx2 |, indx2> , index> , middl> , ring> , pinky> , pink2> ,
  1210. // , , , , , <|,>-*- , , , , , ,
  1211. CTO_BASE , XP_ACC_AA , XP_ACC_AB , XP_ACC_AC , XP_ACC_AD , XP_ACC_AE , XP_ACC_AF , XP_ACC_AG , XP_ACC_AH , XP_ACC_AI , XP_ACC_AJ , KC_BSPC ,
  1212. LCTL ( KC_TAB ) , XP_ACC_BA , XP_ACC_BB , XP_ACC_BC , XP_ACC_BD , XP_ACC_BE , XP_ACC_BF , XP_ACC_BG , XP_ACC_BH , XP_ACC_BI , XP_ACC_BJ , XP_ACC_BK ,
  1213. KC_LSFT , XP_ACC_CA , XP_ACC_CB , XP_ACC_CC , XP_ACC_CD , XP_ACC_CE , XP_ACC_CF , XP_ACC_CG , XP_ACC_CH , XP_ACC_CI , XP_ACC_CJ , KC_RSFT ,
  1214. // ----------------------------------------------------------------------------------------------------------------------------------------------
  1215. KC_LALT
  1216. # ifdef TRANSMINIVAN_LEFTSIDE
  1217. , TRANS_LEFT
  1218. # endif
  1219. # ifdef MORE_KEY__COMMAND
  1220. , MORE_key1
  1221. # endif
  1222. , _______ , _______ , KC_ENT
  1223. # ifdef TRANSMINIVAN_MIDLEFT
  1224. , TRANS_MIDLEFT
  1225. # endif
  1226. , KC_SPC , _______ , _______
  1227. # ifdef TRANSMINIVAN_RIGHTSIDE
  1228. , TRANS_RIGHT
  1229. # endif
  1230. # ifdef MORE_KEY__ARROW
  1231. , MORE_key2
  1232. # endif
  1233. , KC_RALT
  1234. // , -*- , , <|,> , , ,
  1235. // <1 ± ± , <2 , <3 , <4 |, 4> , 3> , 2> , ± ± 1>
  1236. ),
  1237. # endif // BASESFILE_LAYER_ACC
  1238. # endif // REMOVE_ACC
  1239. /* ⬆⬇ */
  1240. # ifndef REMOVE_DRA // This cuts out the whole _DRA layer
  1241. # ifndef BASESFILE_LAYER_DRA // Use a definition of this layer in the ./bases_* file, where this #define can be defined.
  1242. /* Layer _DRA: Drawings, like various Unicode symbols.
  1243. *
  1244. */
  1245. [ _DRA ] = LAYOUT_redefined (
  1246. /*
  1247. Layer _DRA (DRAwings, whatever else (rendering width varies in different applications))
  1248. <pink2<pinky<ring <middl<index<indx2| indx2>index>middl>ring> pinky>pink2>
  1249. -*- <|> //(toggle) on _FUN
  1250. BASE “„ ”≤ £≥ ∅ ¢ ±ƒ | ❦♥ 🙂🙁 👍👎 ⁽₍ ⁾₎ Bksp
  1251. Tab ¹₁ ²₂ ³₃ ⁴₄ ⁵₅ | ⁶₆ ⁷₇ ⁸₈ ⁹₉ ⁰₀ RCTL
  1252. LSht 「━ 」─ °〇 •§ …· | ⮘⮙ ⮚⮛ ¿¡ 《┄ 》┅ RSht
  1253. -------------------------------------------------------------------------
  1254. LAlt ___ ___ Ent | Spc ___ ___ RAlt
  1255. -*- <|> -*- //(hold) on BASE
  1256. <1 ± <2 <3 <4 | 4> 3> 2> ± 1>
  1257. … …
  1258. */
  1259. //
  1260. // <pink2 , <pinky , <ring , <middl , <index , <indx2 |, indx2> , index> , middl> , ring> , pinky> , pink2> ,
  1261. // , , , , , <|,> , -*- , , , , ,
  1262. CTO_BASE , XP_DRA_AA , XP_DRA_AB , XP_DRA_AC , XP_DRA_AD , XP_DRA_AE , XP_DRA_AF , XP_DRA_AG , XP_DRA_AH , XP_DRA_AI , XP_DRA_AJ , KC_BSPC ,
  1263. KC_TAB , XP_DRA_BA , XP_DRA_BB , XP_DRA_BC , XP_DRA_BD , XP_DRA_BE , XP_DRA_BF , XP_DRA_BG , XP_DRA_BH , XP_DRA_BI , XP_DRA_BJ , KC_RCTL ,
  1264. KC_LSFT , XP_DRA_CA , XP_DRA_CB , XP_DRA_CC , XP_DRA_CD , XP_DRA_CE , XP_DRA_CF , XP_DRA_CG , XP_DRA_CH , XP_DRA_CI , XP_DRA_CJ , KC_RSFT ,
  1265. // --------------------------------------------------------------------------------------------------------------------------------------------
  1266. KC_LALT
  1267. # ifdef TRANSMINIVAN_LEFTSIDE
  1268. , TRANS_LEFT
  1269. # endif
  1270. # ifdef MORE_KEY__COMMAND
  1271. , MORE_key1
  1272. # endif
  1273. , _______ , _______ , KC_ENT
  1274. # ifdef TRANSMINIVAN_MIDLEFT
  1275. , TRANS_MIDLEFT
  1276. # endif
  1277. , KC_SPC , _______ , _______
  1278. # ifdef TRANSMINIVAN_RIGHTSIDE
  1279. , TRANS_RIGHT
  1280. # endif
  1281. # ifdef MORE_KEY__ARROW
  1282. , MORE_key2
  1283. # endif
  1284. , KC_RALT
  1285. // , , , <|,> , , ,
  1286. // <1 ± ± , <2 , <3 , <4 |, 4> , 3> , 2> , ± ± 1>
  1287. ),
  1288. # endif // BASESFILE_LAYER_RAR
  1289. # endif // REMOVE_DRA
  1290. /* ⬆⬇ */
  1291. # ifndef REMOVE_BON // Removes this layer entirely, if set.
  1292. # ifndef BASESFILE_LAYER_BON // Use a definition of this layer in the ./bases_* file, where this #define can be defined.
  1293. /*
  1294. * Bonus layer: Enumeration numbers, some general purpose / mathematical symbols
  1295. * ⁻ is an exponential minus sign (the center-dot · can be used in exponents too)
  1296. * × is multiplication
  1297. * ‰ is promille, ‱ is pro-tenthousandth
  1298. *
  1299. */
  1300. [ _BON ] = LAYOUT_redefined (
  1301. /*
  1302. Layer _BON (Bonus layer, a variety of more stuffs.)
  1303. <pink2<pinky<ring <middl<index<indx2| indx2>index>middl>ring> pinky>pink2>
  1304. -*- <|>
  1305. BASE ‛ 🛠 ’ ⬆ ¤ 🄯 ∑ © ‰ ‱ | ★ ٭ 😊 ⍨ × ⃰ √ ⁻ ⁺ Bksp
  1306. `~ ① ⬅ ② ⬇ ③ ➡ ④ ┏ ⑤ ┓ | ⑥ ┃ ⑦ ┇ ⑧ ╋ ⑨ ⓪ ∞ — ≈ // — is a dash (larger), not hyphen
  1307. LSht ‹ › ÷ ☞ ┗ ≠ ┛ | ✗ ┣ ✓ ┫ ⚠ « » RSht
  1308. -------------------------------------------------------------------------
  1309. Left ___ ___ Ent | Spc ___ ___ Right
  1310. -*- -*- <|> -*- // Activation on BASE
  1311. <1 ± <2 <3 <4 | 4> 3> 2> ± 1>
  1312. … …
  1313. */
  1314. //
  1315. // <pink2 , <pinky , <ring , <middl , <index , <indx2 |, indx2> , index> , middl> , ring> , pinky> , pink2> ,
  1316. // , , , , , <|,> , , , , , ,
  1317. CTO_BASE , XP_BON_AA , XP_BON_AB , XP_BON_AC , XP_BON_AD , XP_BON_AE , XP_BON_AF , XP_BON_AG , XP_BON_AH , XP_BON_AI , XP_BON_AJ , KC_BSPC ,
  1318. KC_GRV , XP_BON_BA , XP_BON_BB , XP_BON_BC , XP_BON_BD , XP_BON_BE , XP_BON_BF , XP_BON_BG , XP_BON_BH , XP_BON_BI , XP_BON_BJ , XP_BON_BK ,
  1319. KC_LSFT , XP_BON_CA , XP_BON_CB , XP_BON_CC , XP_BON_CD , XP_BON_CE , XP_BON_CF , XP_BON_CG , XP_BON_CH , XP_BON_CI , XP_BON_CJ , KC_RSFT ,
  1320. // -------------------------------------------------------------------------------------------------------------------------------------------------
  1321. KC_LEFT
  1322. # ifdef TRANSMINIVAN_LEFTSIDE
  1323. , TRANS_LEFT
  1324. # endif
  1325. # ifdef MORE_KEY__COMMAND
  1326. , MORE_key1
  1327. # endif
  1328. , _______ , _______ , KC_ENT
  1329. # ifdef TRANSMINIVAN_MIDLEFT
  1330. , TRANS_MIDLEFT
  1331. # endif
  1332. , KC_SPC , _______ , _______
  1333. # ifdef TRANSMINIVAN_RIGHTSIDE
  1334. , TRANS_RIGHT
  1335. # endif
  1336. # ifdef MORE_KEY__ARROW
  1337. , MORE_key2
  1338. # endif
  1339. , KC_RIGHT
  1340. // , , , <|,> , , ,
  1341. // <1 ± ± , <2 , <3 , <4 |, 4> , 3> , 2> , ± ± 1>
  1342. ),
  1343. # endif // BASESFILE_LAYER_BON
  1344. # endif // REMOVE_BON
  1345. /* ⬆⬇ */
  1346. # ifndef BASESFILE_LAYER_FUN // Use a definition of this layer in the ./bases_* file, where this #define can be defined.
  1347. /* Layer _FUN: Function keys until F20. Some combo modifiers control/alt/shift
  1348. * Toward any layer by toggle. Layer can be set to return to BASE after one F-key press (FUN<, row 1)
  1349. */
  1350. [ _FUN ] = LAYOUT_redefined (
  1351. /*
  1352. Layer _FUN (F-keys, Layer access, Set BASE key direction)
  1353. <pink2<pinky<ring <middl<index<indx2| indx2>index>middl>ring> pinky>pink2>
  1354. toggl toggl set toggl toggl toggl | toggl toggl // Type of layer switch
  1355. <|>
  1356. BASE: NUMS: _PAD _ACC _DRA _BON | _MOV _RAR xxx xxx xxx Bksp //':' are dynamic ...
  1357. LCtl F1 F2 F3 F4 F5 | F6 F7 F8 F9 F10 RCtl
  1358. LSht F11 F12 F13 F14 F15 | F16 F17 F18 F19 F20 RSht
  1359. ----------------------------------------------------------------------*-- //-*- toggle on BASE
  1360. LAlt LCtl& LCtl& LSht& | FUN< +LCtl&LSht LGUI RAlt //... < toggle 'stay'
  1361. LSht LAlt LAlt | &LAlt
  1362. +xxx +xxx +xxx | +xxx
  1363. <|>
  1364. <1 ± <2 <3 <4 | 4> 3> 2> ± 1>
  1365. … …
  1366. */
  1367. //
  1368. // <pink2 , <pinky , <ring , <middl , <index , <indx2 |, indx2> , index> , middl> , ring> , pinky> , pink2> ,
  1369. // , , -*- , , , <|,> , , , , , ,
  1370. CTO_BASE , CTO_NUMS , TO ( _PAD ) , CTO_ACCE , CTO_DRAW , TO ( _BON ), TO ( _MOV ) , TO ( _RAR ) , XXXXXXX , XXXXXXX , XXXXXXX , KC_BSPC ,
  1371. KC_LCTL , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_RCTL ,
  1372. KC_LSFT , KC_F11 , KC_F12 , KC_F13 , KC_F14 , KC_F15 , KC_F16 , KC_F17 , KC_F18 , KC_F19 , KC_F20 , KC_RSFT ,
  1373. // ------------------------------------------------------------------------------------------------------------------------------------------
  1374. KC_LALT
  1375. # ifdef TRANSMINIVAN_LEFTSIDE
  1376. , TRANS_LEFT
  1377. # endif
  1378. # ifdef MORE_KEY__COMMAND
  1379. , MORE_key1
  1380. # endif
  1381. , MT ( MOD_LCTL | MOD_LSFT, XXXXXXX ) , MT ( MOD_LCTL | MOD_LALT , XXXXXXX ) , MT ( MOD_LSFT | MOD_LALT , XXXXXXX )
  1382. # ifdef TRANSMINIVAN_MIDLEFT
  1383. , TRANS_MIDLEFT
  1384. # endif
  1385. , _FUN_STAY , MT ( MOD_LCTL | MOD_LSFT | MOD_LALT , XXXXXXX ) , KC__YGUI
  1386. # ifdef TRANSMINIVAN_RIGHTSIDE
  1387. , _______ // On Base layers this key typically defaults to MO ( _FUN )
  1388. # endif
  1389. # ifdef MORE_KEY__ARROW
  1390. , MORE_key2
  1391. # endif
  1392. , KC_RALT
  1393. // , , , <|,> , , ,
  1394. // <1 ± ± , <2 , <3 , <4 |, 4> , 3> , 2> , ± ± 1>
  1395. ),
  1396. # endif // BASESFILE_LAYER_FUN
  1397. /* ⬆ */
  1398. /*
  1399. * New layer template. Includes left/right movement arrows, deletion, modifiers.
  1400. * If you want a new layer, in the logic of this layout you would add a toggle on the
  1401. * _FUN layer top row on the first free key to it, and optionally alter the hold
  1402. * layer switch keys on the base layers. (Check if a new layer will fit on the chip.)
  1403. *
  1404. [ _??? ] = LAYOUT_redefined (
  1405. // <pink2<pinky<ring <middl<index<indx2| indx2>index>middl>ring> pinky>pink2>
  1406. // <|>
  1407. // BASE xxx xxx xxx xxx xxx | xxx xxx xxx xxx xxx Bksp
  1408. // LCtl xxx xxx xxx xxx xxx | xxx xxx xxx xxx xxx RCtl
  1409. // LSht xxx xxx xxx xxx xxx | xxx xxx xxx xxx xxx RSht
  1410. // -------------------------------------------------------------------------
  1411. // LAlt+Left Del ___ Ent | Spc ___ ___ RAlt+Right
  1412. // <|>
  1413. // <1 ± <2 <3 <4 | 4> 3> 2> ± 1>
  1414. // … …
  1415. //
  1416. //
  1417. // <pink2 , <pinky , <ring , <middl , <index , <indx2 |, indx2> , index> , middl> , ring> , pinky> , pink2> ,
  1418. // , , , , , <|,> , , , , , ,
  1419. CTO_BASE , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , KC_BSPC ,
  1420. KC_LCTL , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , KC_RCTL ,
  1421. KC_LSFT , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , KC_RSFT ,
  1422. // ------------------------------------------------------------------------------------------------------------------------
  1423. LALT_T ( KC_LEFT )
  1424. # ifdef TRANSMINIVAN_LEFTSIDE
  1425. , TRANS_LEFT
  1426. # endif
  1427. # ifdef MORE_KEY__COMMAND
  1428. , MORE_key1
  1429. # endif
  1430. , KC_DEL , XXXXXXX , KC_ENT
  1431. # ifdef TRANSMINIVAN_MIDLEFT
  1432. , TRANS_MIDLEFT
  1433. # endif
  1434. , KC_SPC , XXXXXXX , XXXXXXX
  1435. # ifdef TRANSMINIVAN_RIGHTSIDE
  1436. , TRANS_RIGHT
  1437. # endif
  1438. # ifdef MORE_KEY__ARROW
  1439. , MORE_key2
  1440. # endif
  1441. , RALT_T ( KC_RIGHT )
  1442. // , , , <|,> , , ,
  1443. // <1 ± ± , <2 , <3 , <4 |, 4> , 3> , 2> , ± ± 1>
  1444. ),
  1445. */
  1446. };