keymap.c 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. Copyright 2016 Fred Sundvik <fsundvik@gmail.com>
  3. Jun Wako <wakojun@gmail.com>
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 2 of the License, or
  7. (at your option) any later version.
  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. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. #include "infinity_ergodox.h"
  16. // Workaround for old keymap format
  17. #define KC_RESET RESET
  18. const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  19. KEYMAP( // layer 0 : default
  20. // left hand
  21. EQL, 1, 2, 3, 4, 5, ESC,
  22. BSLS,Q, W, E, R, T, FN1,
  23. TAB, A, S, D, F, G,
  24. LSFT,Z, X, C, V, B, FN0,
  25. LGUI,GRV, BSLS,LEFT,RGHT,
  26. LCTL,LALT,
  27. HOME,
  28. BSPC,DEL, END,
  29. // right hand
  30. FN2, 6, 7, 8, 9, 0, MINS,
  31. LBRC,Y, U, I, O, P, RBRC,
  32. H, J, K, L, SCLN,QUOT,
  33. FN0, N, M, COMM,DOT, SLSH,RSFT,
  34. LEFT,DOWN,UP, RGHT,RGUI,
  35. RALT,RCTL,
  36. PGUP,
  37. PGDN,ENT, SPC
  38. ),
  39. KEYMAP( // layer 1 : function and symbol keys
  40. // left hand
  41. TRNS,F1, F2, F3, F4, F5, F11,
  42. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN3,
  43. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  44. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  45. TRNS,TRNS,TRNS,TRNS,TRNS,
  46. TRNS,TRNS,
  47. TRNS,
  48. TRNS,TRNS,TRNS,
  49. // right hand
  50. F12, F6, F7, F8, F9, F10, TRNS,
  51. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  52. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  53. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  54. TRNS,TRNS,TRNS,TRNS,TRNS,
  55. TRNS,TRNS,
  56. TRNS,
  57. TRNS,TRNS,TRNS
  58. ),
  59. KEYMAP( // layer 2 : keyboard functions
  60. // left hand
  61. RESET,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  62. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, FN3,
  63. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  64. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  65. TRNS,TRNS,TRNS,TRNS,TRNS,
  66. TRNS,TRNS,
  67. TRNS,
  68. TRNS,TRNS,TRNS,
  69. // right hand
  70. TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  71. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  72. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  73. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  74. TRNS,TRNS,TRNS,TRNS,TRNS,
  75. TRNS,TRNS,
  76. TRNS,
  77. TRNS,TRNS,TRNS
  78. ),
  79. KEYMAP( // layer 3: numpad
  80. // left hand
  81. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  82. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  83. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  84. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  85. TRNS,TRNS,TRNS,TRNS,TRNS,
  86. TRNS,TRNS,
  87. TRNS,
  88. TRNS,TRNS,TRNS,
  89. // right hand
  90. TRNS,NLCK,PSLS,PAST,PAST,PMNS,BSPC,
  91. TRNS,NO, P7, P8, P9, PMNS,BSPC,
  92. NO, P4, P5, P6, PPLS,PENT,
  93. TRNS,NO, P1, P2, P3, PPLS,PENT,
  94. P0, PDOT,SLSH,PENT,PENT,
  95. TRNS,TRNS,
  96. TRNS,
  97. TRNS,TRNS,TRNS
  98. ),
  99. };
  100. const uint16_t fn_actions[] = {
  101. ACTION_LAYER_MOMENTARY(1), // FN0 - switch to Layer1
  102. ACTION_LAYER_SET(2, ON_PRESS), // FN1 - set Layer2
  103. ACTION_LAYER_TOGGLE(3), // FN2 - toggle Layer3 aka Numpad layer
  104. ACTION_LAYER_SET(0, ON_PRESS), // FN3 - set Layer0
  105. };