From 14a66a181ea6d300aab199cb121027d926fd6ab6 Mon Sep 17 00:00:00 2001 From: tmk Date: Sun, 8 Nov 2015 13:05:30 +0900 Subject: [PATCH 1/2] alps64: support for keymap editor --- keyboard/alps64/Makefile.keymap_editor | 4 ++ keyboard/alps64/keymap_plain.c | 59 ++++++++++++++++++++++++-- 2 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 keyboard/alps64/Makefile.keymap_editor diff --git a/keyboard/alps64/Makefile.keymap_editor b/keyboard/alps64/Makefile.keymap_editor new file mode 100644 index 00000000..d7ad0cc4 --- /dev/null +++ b/keyboard/alps64/Makefile.keymap_editor @@ -0,0 +1,4 @@ +# build firmware for keymap editor +# +KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor +include Makefile diff --git a/keyboard/alps64/keymap_plain.c b/keyboard/alps64/keymap_plain.c index a5489919..fcbec596 100644 --- a/keyboard/alps64/keymap_plain.c +++ b/keyboard/alps64/keymap_plain.c @@ -1,7 +1,23 @@ #include "keymap_common.h" -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: qwerty */ +#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 + /* 0: qwerty + * ,-----------------------------------------------------------. + * |` | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| #|Bsp| + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * |-----------------------------------------------------------| + * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Enter | + * |-----------------------------------------------------------| + * |Shft| \| Z| X| C| V| B| N| M| ,| .| /|Shift |Esc| + * |-----------------------------------------------------------' + * |Ctrl|Gui |Alt | Space |App |Alt |Gui |Ctrl | + * `-----------------------------------------------------------' + */ KEYMAP( \ GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NUHS, BSPC, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \ @@ -9,4 +25,41 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT,ESC, \ LCTL,LGUI,LALT, SPC, APP, RALT,RGUI,RCTL), }; -const uint16_t PROGMEM fn_actions[] = {}; +#ifdef KEYMAP_SECTION_ENABLE +const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = { + [0] = ACTION_LAYER_MOMENTARY(1), + [1] = ACTION_LAYER_MOMENTARY(2), + [2] = ACTION_LAYER_MOMENTARY(3), + [3] = ACTION_LAYER_MOMENTARY(4), + [4] = ACTION_LAYER_MOMENTARY(5), + [5] = ACTION_LAYER_MOMENTARY(6), + [6] = ACTION_LAYER_MOMENTARY(7), + [7] = ACTION_LAYER_TOGGLE(1), + [8] = ACTION_LAYER_TOGGLE(2), + [9] = ACTION_LAYER_TOGGLE(3), + [10] = ACTION_LAYER_TAP_TOGGLE(1), + [11] = ACTION_LAYER_TAP_TOGGLE(2), + [12] = ACTION_LAYER_TAP_TOGGLE(3), + [13] = ACTION_LAYER_TAP_KEY(1, KC_A), + [14] = ACTION_LAYER_TAP_KEY(2, KC_F), + [15] = ACTION_LAYER_TAP_KEY(3, KC_J), + [16] = ACTION_LAYER_TAP_KEY(4, KC_SPACE), + [17] = ACTION_LAYER_TAP_KEY(5, KC_SCOLON), + [18] = ACTION_LAYER_TAP_KEY(6, KC_QUOTE), + [19] = ACTION_LAYER_TAP_KEY(7, KC_SLASH), + [20] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_SPACE), + [21] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_SPACE), + [22] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_QUOTE), + [23] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENTER), + [24] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC), + [25] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_BSPACE), + [26] = ACTION_MODS_ONESHOT(MOD_LCTL), + [27] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_ESC), + [28] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPACE), + [29] = ACTION_MODS_ONESHOT(MOD_LSFT), + [30] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRAVE), + [31] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_BSLASH), +}; +#else +const uint16_t fn_actions[] PROGMEM = {}; +#endif From db2015a6b2d01c765dbd5ef2d13f160ab69965f4 Mon Sep 17 00:00:00 2001 From: tmk Date: Mon, 9 Nov 2015 11:21:45 +0900 Subject: [PATCH 2/2] hhkb: fix for keymap editor --- keyboard/hhkb/Makefile.keymap_editor | 5 +++++ keyboard/hhkb/Makefile.rn42 | 4 ++-- keyboard/hhkb/Makefile.rn42.keymap_editor | 5 +++++ keyboard/hhkb/config_rn42.h | 2 +- keyboard/hhkb/keymap_hhkb.c | 4 ++-- 5 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 keyboard/hhkb/Makefile.keymap_editor create mode 100644 keyboard/hhkb/Makefile.rn42.keymap_editor diff --git a/keyboard/hhkb/Makefile.keymap_editor b/keyboard/hhkb/Makefile.keymap_editor new file mode 100644 index 00000000..77a13e68 --- /dev/null +++ b/keyboard/hhkb/Makefile.keymap_editor @@ -0,0 +1,5 @@ +# build firmware for keymap editor +# +KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor +include Makefile + diff --git a/keyboard/hhkb/Makefile.rn42 b/keyboard/hhkb/Makefile.rn42 index cbb2b744..8cb44352 100644 --- a/keyboard/hhkb/Makefile.rn42 +++ b/keyboard/hhkb/Makefile.rn42 @@ -108,12 +108,12 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options # comment out to disable the options. # -#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = yes # Console for debug COMMAND_ENABLE = yes # Commands for debug and configuration -#NKRO_ENABLE = yes # USB Nkey Rollover +NKRO_ENABLE = yes # USB Nkey Rollover #KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor #HHKB_JP = yes # HHKB JP support diff --git a/keyboard/hhkb/Makefile.rn42.keymap_editor b/keyboard/hhkb/Makefile.rn42.keymap_editor new file mode 100644 index 00000000..6e55f694 --- /dev/null +++ b/keyboard/hhkb/Makefile.rn42.keymap_editor @@ -0,0 +1,5 @@ +# build firmware for keymap editor +# +KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor +include Makefile.rn42 + diff --git a/keyboard/hhkb/config_rn42.h b/keyboard/hhkb/config_rn42.h index 21e73f1c..df75fba5 100644 --- a/keyboard/hhkb/config_rn42.h +++ b/keyboard/hhkb/config_rn42.h @@ -48,7 +48,7 @@ along with this program. If not, see . #define ONESHOT_TIMEOUT 300 /* Boot Magic salt key: Space */ -#define BOOTMAGIC_KEY_SALT KC_FN6 +#define BOOTMAGIC_KEY_SALT KC_SPACE /* power control of key switch board */ #define HHKB_POWER_SAVING diff --git a/keyboard/hhkb/keymap_hhkb.c b/keyboard/hhkb/keymap_hhkb.c index 86ad0f5e..f0552a37 100644 --- a/keyboard/hhkb/keymap_hhkb.c +++ b/keyboard/hhkb/keymap_hhkb.c @@ -85,8 +85,8 @@ const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = { [27] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_ESC), [28] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPACE), [29] = ACTION_MODS_ONESHOT(MOD_LSFT), - [30] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ESC), - [31] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_BSPACE), + [30] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRAVE), + [31] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_BSLASH), }; #else const uint16_t fn_actions[] PROGMEM = {