3 * http://geekhack.org/index.php?topic=51069.0
5 #include "keymap_common.h"
8 const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
9 /* Layer 0: Default Layer
10 * ,-----------------------------------------------------------.
11 * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| `|BSp|
12 * |-----------------------------------------------------------|
13 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|
14 * |-----------------------------------------------------------|
15 * |Contro| A| S| D| F| G| H| J| K| L| ;| '|Enter |
16 * |-----------------------------------------------------------|
17 * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn0|
18 * `-----------------------------------------------------------'
19 * |Gui|Alt | SpaceFN |Alt |Gui|
20 * `-------------------------------------------'
22 KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, GRV, BSPC, \
23 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \
24 LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, \
25 LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT,FN0, \
26 LGUI,LALT, FN1, RALT,RGUI),
28 /* Layer 1: HHKB mode (HHKB Fn)
29 * ,-----------------------------------------------------------.
30 * |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
31 * |-----------------------------------------------------------|
32 * |Caps | | | | | | | |Psc|Slk|Pus|Up | |Backs|
33 * |-----------------------------------------------------------|
34 * | |VoD|VoU|Mut| | | *| /|Hom|PgU|Lef|Rig|Enter |
35 * |-----------------------------------------------------------|
36 * | | | | | | | +| -|End|PgD|Dow| | |
37 * `-----------------------------------------------------------'
39 * `-------------------------------------------'
41 KEYMAP(PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \
42 CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS, UP, TRNS, BSPC, \
43 TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT,PENT, \
44 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END, PGDN,DOWN,TRNS,TRNS, \
45 TRNS,TRNS, SPC, TRNS,TRNS),
48 * ,-----------------------------------------------------------.
49 * |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |Del|
50 * |-----------------------------------------------------------|
51 * | | | |Esc| | | |Hom|Up |End|Psc|Slk|Pau|Ins |
52 * |-----------------------------------------------------------|
53 * | | | | | | |PgU|Lef|Dow|Rig| | | |
54 * |-----------------------------------------------------------|
55 * | | | | | |Spc|PgD|` |~ | | | | |
56 * `-----------------------------------------------------------'
58 * `-------------------------------------------'
60 KEYMAP(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,DEL, \
61 TRNS,TRNS,TRNS,ESC, TRNS,TRNS,TRNS,HOME,FN3, END, PSCR,SLCK,PAUS,INS, \
62 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PGUP,LEFT,DOWN,RGHT,TRNS,TRNS,TRNS, \
63 TRNS,TRNS,TRNS,TRNS,TRNS,SPC, PGDN,GRV, FN2, TRNS,TRNS,TRNS,NO, \
64 TRNS,TRNS, TRNS, TRNS,TRNS),
69 * user defined action function
72 CTRL_SPACE_I, // Ctrl + Up(SpaceFN) -> PgUp
75 void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
77 # define MODS_CTRL_MASK (MOD_BIT(KC_LCTRL)|MOD_BIT(KC_RCTRL))
78 static uint8_t ctrl_space_i_prev_ctrl;
81 // Ctrl + Up(SpaceFN) -> PgUp
83 ctrl_space_i_prev_ctrl = get_mods()&MODS_CTRL_MASK;
84 if (record->event.pressed) {
85 if (ctrl_space_i_prev_ctrl) {
86 del_mods(ctrl_space_i_prev_ctrl); // remove Ctrl
88 send_keyboard_report(); // send PgUp without Ctrl
89 add_mods(ctrl_space_i_prev_ctrl); // return Ctrl but not sent
92 send_keyboard_report();
95 if (ctrl_space_i_prev_ctrl) {
97 send_keyboard_report();
100 send_keyboard_report();
109 * Fn action definition
111 const action_t PROGMEM fn_actions[] = {
112 [0] = ACTION_LAYER_MOMENTARY(1),
113 [1] = ACTION_LAYER_TAP_KEY(2, KC_SPACE),
114 [2] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde
115 [3] = ACTION_FUNCTION(CTRL_SPACE_I), // Ctrl + Up(SpaceFN) -> PgUp