keymap.c 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  17. KEYMAP( // layer 0 : default
  18. // left hand
  19. EQL, 1, 2, 3, 4, 5, ESC,
  20. BSLS,Q, W, E, R, T, FN1,
  21. TAB, A, S, D, F, G,
  22. LSFT,Z, X, C, V, B, FN0,
  23. LGUI,GRV, BSLS,LEFT,RGHT,
  24. LCTL,LALT,
  25. HOME,
  26. BSPC,DEL, END,
  27. // right hand
  28. FN2, 6, 7, 8, 9, 0, MINS,
  29. LBRC,Y, U, I, O, P, RBRC,
  30. H, J, K, L, SCLN,QUOT,
  31. FN0, N, M, COMM,DOT, SLSH,RSFT,
  32. LEFT,DOWN,UP, RGHT,RGUI,
  33. RALT,RCTL,
  34. PGUP,
  35. PGDN,ENT, SPC
  36. ),
  37. KEYMAP( // layer 1 : function and symbol keys
  38. // left hand
  39. TRNS,F1, F2, F3, F4, F5, F11,
  40. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN3,
  41. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  42. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  43. TRNS,TRNS,TRNS,TRNS,TRNS,
  44. TRNS,TRNS,
  45. TRNS,
  46. TRNS,TRNS,TRNS,
  47. // right hand
  48. F12, F6, F7, F8, F9, F10, TRNS,
  49. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  50. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  51. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  52. TRNS,TRNS,TRNS,TRNS,TRNS,
  53. TRNS,TRNS,
  54. TRNS,
  55. TRNS,TRNS,TRNS
  56. ),
  57. KEYMAP( // layer 2 : keyboard functions
  58. // left hand
  59. BTLD,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  60. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, FN3,
  61. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  62. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  63. TRNS,TRNS,TRNS,TRNS,TRNS,
  64. TRNS,TRNS,
  65. TRNS,
  66. TRNS,TRNS,TRNS,
  67. // right hand
  68. TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  69. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  70. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  71. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  72. TRNS,TRNS,TRNS,TRNS,TRNS,
  73. TRNS,TRNS,
  74. TRNS,
  75. TRNS,TRNS,TRNS
  76. ),
  77. KEYMAP( // layer 3: numpad
  78. // left hand
  79. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  80. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  81. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  82. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
  83. TRNS,TRNS,TRNS,TRNS,TRNS,
  84. TRNS,TRNS,
  85. TRNS,
  86. TRNS,TRNS,TRNS,
  87. // right hand
  88. TRNS,NLCK,PSLS,PAST,PAST,PMNS,BSPC,
  89. TRNS,NO, P7, P8, P9, PMNS,BSPC,
  90. NO, P4, P5, P6, PPLS,PENT,
  91. TRNS,NO, P1, P2, P3, PPLS,PENT,
  92. P0, PDOT,SLSH,PENT,PENT,
  93. TRNS,TRNS,
  94. TRNS,
  95. TRNS,TRNS,TRNS
  96. ),
  97. };
  98. const uint16_t fn_actions[] = {
  99. ACTION_LAYER_MOMENTARY(1), // FN0 - switch to Layer1
  100. ACTION_LAYER_SET(2, ON_PRESS), // FN1 - set Layer2
  101. ACTION_LAYER_TOGGLE(3), // FN2 - toggle Layer3 aka Numpad layer
  102. ACTION_LAYER_SET(0, ON_PRESS), // FN3 - set Layer0
  103. };