forked from tmk/tmk_keyboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
171 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
/* | ||
* HHKB JP Layout | ||
*/ | ||
#include "keymap_common.h" | ||
|
||
|
||
#ifdef KEYMAP_SECTION_ENABLE | ||
const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = { | ||
#else | ||
const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { | ||
#endif | ||
/* Layer 0: Default Layer | ||
* ,-----------------------------------------------------------. | ||
* |` | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| BS| | ||
* |-----------------------------------------------------------| | ||
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | ||
* |------------------------------------------------------` ENT| | ||
* |Esc | A| S| D| F| G| H| J| K| L| ;| '|Fn2| | | ||
* |-----------------------------------------------------------| | ||
* |LShift | Z| X| C| V| B| N| M| ,| .| /|Fn4| Up|RST| | ||
* |-----------------------------------------------------------| | ||
* |Fn0||Ctl|Gui|Alt|Spc| Space |Spc|Alt|Gui|Ctl||Lft|Dwn|Rgt| | ||
* `-----------------------------------------------------------' | ||
*/ | ||
KEYMAP_JP(GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,BSPC, \ | ||
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, \ | ||
ESC, A, S, D, F, G, H, J, K, L, SCLN,QUOT, FN2,ENT, \ | ||
LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,FN4, UP, RSFT, \ | ||
FN0, LCTL,LGUI,LALT, SPC, SPC, SPC,RALT,RGUI,RCTL, LEFT,DOWN,RGHT), | ||
|
||
/* Layer 1: Extended mode (HHKB Fn) | ||
* ,-----------------------------------------------------------. | ||
* |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| | ||
* |-----------------------------------------------------------| | ||
* | |Mut|VoD|VoU| | | | | | |Psc|Slk|Pus| | | ||
* |------------------------------------------------------` | | ||
* |Caps |Ply|Stp|Prv|Nxt| | | | | |Ins|Hom|PgU| | | ||
* |-----------------------------------------------------------| | ||
* | |BiD|BiU| | | | | | |Del|End|PgD|PgU| | | ||
* |-----------------------------------------------------------| | ||
* |Fn0|| | | | | | | | | ||Hom|PgD|End| | ||
* `-----------------------------------------------------------' | ||
*/ | ||
KEYMAP_JP(PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ | ||
TRNS,MUTE,VOLD,VOLU, NO, NO, NO, NO, NO, NO,PSCR,SLCK,PAUS, \ | ||
CAPS,MPLY,MSTP,MPRV,MNXT, NO, NO, NO, NO, NO,INS,HOME,PGUP,TRNS, \ | ||
TRNS,BRTD,BRTI, NO, NO, NO, NO, NO, NO, DEL, END,PGDN,PGUP,TRNS, \ | ||
FN0 ,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,HOME,PGDN, END), | ||
|
||
/* Layer 2: Movement mode (JIS BSLS) | ||
* ,-----------------------------------------------------------. | ||
* | |Fn6|Fn7|Fn8|Fn9| | | | | |Fn10|Fn11| | | | | ||
* |-----------------------------------------------------------| | ||
* | | | | |Fn12| | | | | | | | | | | ||
* |------------------------------------------------------` | | ||
* | |Fn14|Fn13| | | | | | | | | |Fn2| | | ||
* |-----------------------------------------------------------| | ||
* | |Fn16|Fn15| | | | | | | | | | | | | ||
* |-----------------------------------------------------------| | ||
* | || | | | | | | | | || | | | | ||
* `-----------------------------------------------------------' | ||
*/ | ||
KEYMAP_JP(NO ,FN6, FN7, FN8, FN9, NO, NO, NO, NO, NO, FN10,FN11, NO, NO, NO, \ | ||
NO ,NO ,NO ,NO ,FN12, NO, NO, NO, NO, NO, NO, NO, NO, \ | ||
NO ,FN14,FN13,NO , NO, NO, NO, NO, NO, NO, NO, NO,FN2, NO, \ | ||
TRNS,FN16,FN15,NO , NO, NO, NO, NO, NO, NO, NO, NO, NO,TRNS, \ | ||
NO ,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, NO, NO, NO), | ||
|
||
/* Layer 3: Numpad mode (JIS RO) | ||
* ,-----------------------------------------------------------. | ||
* | | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0|Eql|Eql| | BS| | ||
* |-----------------------------------------------------------| | ||
* | | | | | | | | | | | | | | | | ||
* |------------------------------------------------------`PENT| | ||
* | | | | | | | * | / | | | | | | | | ||
* |-----------------------------------------------------------| | ||
* | | | | | | | + | - | , | . | |Fn4| Up| | | ||
* |-----------------------------------------------------------| | ||
* | || | | | | | | | | ||Lft|Dwn|Rgt| | ||
* `-----------------------------------------------------------' | ||
*/ | ||
KEYMAP_JP(NO , P1, P2, P3, P4, P5, P6, P7, P8, P9, P0,PEQL,PEQL, NO,BSPC, \ | ||
NO , NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, \ | ||
NO , NO, NO, NO, NO, NO,PAST,PSLS, NO, NO, NO, NO, NO,PENT, \ | ||
TRNS, NO, NO, NO, NO, NO,PPLS,PMNS,PCMM,PDOT, NO, FN4, UP,TRNS, \ | ||
NO ,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,LEFT,DOWN,RGHT), | ||
}; | ||
|
||
|
||
|
||
/* | ||
* Fn action definition | ||
*/ | ||
#ifdef KEYMAP_SECTION_ENABLE | ||
const action_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = { | ||
#else | ||
const action_t fn_actions[] PROGMEM = { | ||
#endif | ||
[0] = ACTION_LAYER_MOMENTARY(1), // ACTION_LAYER_TAP_TOGGLE | ||
[1] = ACTION_LAYER_INVERT(1, ON_RELEASE), // replaced with Fn0 | ||
[2] = ACTION_LAYER_MOMENTARY(2), // ACTION_LAYER_TAP_TOGGLE | ||
[3] = ACTION_LAYER_INVERT(2, ON_RELEASE), // replaced with Fn2 | ||
[4] = ACTION_LAYER_MOMENTARY(3), // ACTION_LAYER_TAP_TOGGLE | ||
[5] = ACTION_LAYER_INVERT(3, ON_RELEASE), // replaced with Fn4 | ||
[6] = ACTION_MACRO(0), | ||
[7] = ACTION_MACRO(1), | ||
[8] = ACTION_MACRO(2), | ||
[9] = ACTION_MACRO(3), | ||
[10] = ACTION_MACRO(4), | ||
[11] = ACTION_MACRO(5), | ||
[12] = ACTION_MACRO(6), | ||
[13] = ACTION_MACRO(7), | ||
[14] = ACTION_MACRO(8), | ||
[15] = ACTION_MACRO(9), | ||
[16] = ACTION_MACRO(10) | ||
}; | ||
|
||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | ||
{ | ||
switch (id) { | ||
case 0: | ||
return (record->event.pressed ? | ||
MACRO( T(SLCK), T(SLCK), T(1), END ) : | ||
MACRO_NONE ); | ||
case 1: | ||
return (record->event.pressed ? | ||
MACRO( T(SLCK), T(SLCK), T(2), END ) : | ||
MACRO_NONE ); | ||
case 2: | ||
return (record->event.pressed ? | ||
MACRO( T(SLCK), T(SLCK), T(3), END ) : | ||
MACRO_NONE ); | ||
case 3: | ||
return (record->event.pressed ? | ||
MACRO( T(SLCK), T(SLCK), T(4), END ) : | ||
MACRO_NONE ); | ||
case 4: | ||
return (record->event.pressed ? | ||
MACRO( T(SLCK), T(SLCK), T(F1), END ) : | ||
MACRO_NONE ); | ||
case 5: | ||
return (record->event.pressed ? | ||
MACRO( T(SLCK), T(SLCK), T(F2), END ) : | ||
MACRO_NONE ); | ||
case 6: | ||
return (record->event.pressed ? | ||
MACRO( T(SLCK), T(SLCK), T(F3), END ) : | ||
MACRO_NONE ); | ||
case 7: | ||
return (record->event.pressed ? | ||
MACRO( T(SLCK), T(SLCK), T(F5), END ) : | ||
MACRO_NONE ); | ||
case 8: | ||
return (record->event.pressed ? | ||
MACRO( T(SLCK), T(SLCK), T(A), END ) : | ||
MACRO_NONE ); | ||
case 9: | ||
return (record->event.pressed ? | ||
MACRO( T(SLCK), T(SLCK), T(F7), END ) : | ||
MACRO_NONE ); | ||
case 10: | ||
return (record->event.pressed ? | ||
MACRO( T(SLCK), T(SLCK), T(U), END ) : | ||
MACRO_NONE ); | ||
} | ||
return MACRO_NONE; | ||
} |