]> git.friedersdorff.com Git - max/tmk_keyboard.git/blob - keyboard/hhkb/keymap_hhkb.c
updated README for hhkb to include a Quick-start section
[max/tmk_keyboard.git] / keyboard / hhkb / keymap_hhkb.c
1 /*
2  * HHKB Layout
3  */
4 #include "keymap_common.h"
5
6
7 #ifdef KEYMAP_SECTION_ENABLE
8 const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
9 #else
10 const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
11 #endif
12     /* Layer 0: Default Layer
13      * ,-----------------------------------------------------------.
14      * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  \|  `|
15      * |-----------------------------------------------------------|
16      * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|Backs|
17      * |-----------------------------------------------------------|
18      * |Contro|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Enter   |
19      * |-----------------------------------------------------------|
20      * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift |Fn0|
21      * `-----------------------------------------------------------'
22      *       |Alt|Gui  |         Space         |Gui  |Alt|
23      *       `-------------------------------------------'
24      */
25     KEYMAP(ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSLS,GRV,   \
26            TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSPC,       \
27            LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT,             \
28            LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT,FN0,             \
29                 LALT,LGUI,          SPC,                RGUI,RALT),
30
31     /* Layer 1: HHKB mode (HHKB Fn)
32      * ,-----------------------------------------------------------.
33      * |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
34      * |-----------------------------------------------------------|
35      * |Caps |   |   |   |   |   |   |   |Psc|Slk|Pus|Up |   |Backs|
36      * |-----------------------------------------------------------|
37      * |      |VoD|VoU|Mut|   |   |  *|  /|Hom|PgU|Lef|Rig|Enter   |
38      * |-----------------------------------------------------------|
39      * |        |   |   |   |   |   |  +|  -|End|PgD|Dow|      |   |
40      * `-----------------------------------------------------------'
41      *       |   |     |                       |     |   |
42      *       `-------------------------------------------'
43      */
44     KEYMAP(PWR, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, INS, DEL,   \
45            CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS, UP, TRNS, BSPC,      \
46            TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT,PENT,            \
47            TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END, PGDN,DOWN,TRNS,TRNS,            \
48                 TRNS,TRNS,          TRNS,               TRNS,TRNS),
49 };
50
51
52
53 /*
54  * Fn action definition
55  */
56 #ifdef KEYMAP_SECTION_ENABLE
57 const action_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
58     [0]  = ACTION_LAYER_MOMENTARY(1),
59     [1]  = ACTION_LAYER_MOMENTARY(2),
60     [2]  = ACTION_LAYER_MOMENTARY(3),
61     [3]  = ACTION_LAYER_MOMENTARY(4),
62     [4]  = ACTION_LAYER_MOMENTARY(5),
63     [5]  = ACTION_LAYER_MOMENTARY(6),
64     [6]  = ACTION_LAYER_MOMENTARY(7),
65     [7]  = ACTION_LAYER_TOGGLE(1),
66     [8]  = ACTION_LAYER_TOGGLE(2),
67     [9]  = ACTION_LAYER_TOGGLE(3),
68     [10] = ACTION_LAYER_TAP_TOGGLE(1),
69     [11] = ACTION_LAYER_TAP_TOGGLE(2),
70     [12] = ACTION_LAYER_TAP_TOGGLE(3),
71     [13] = ACTION_LAYER_TAP_KEY(1, KC_BSLASH),
72     [14] = ACTION_LAYER_TAP_KEY(2, KC_TAB),
73     [15] = ACTION_LAYER_TAP_KEY(3, KC_ENTER),
74     [16] = ACTION_LAYER_TAP_KEY(4, KC_SPACE),
75     [17] = ACTION_LAYER_TAP_KEY(5, KC_SCOLON),
76     [18] = ACTION_LAYER_TAP_KEY(6, KC_QUOTE),
77     [19] = ACTION_LAYER_TAP_KEY(7, KC_SLASH),
78     [20] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_SPACE),
79     [21] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_SPACE),
80     [22] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_QUOTE),
81     [23] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENTER),
82     [24] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC),
83     [25] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_BSPACE),
84     [26] = ACTION_MODS_ONESHOT(MOD_LCTL),
85     [27] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_ESC),
86     [28] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPACE),
87     [29] = ACTION_MODS_ONESHOT(MOD_LSFT),
88     [30] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRAVE),
89     [31] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_BSLASH),
90 };
91 #else
92 const action_t fn_actions[] PROGMEM = {
93     [0]  = ACTION_LAYER_MOMENTARY(1),
94 };
95 #endif