From fced377ac007d27f2650ccffbe0b18abcdcfe23d Mon Sep 17 00:00:00 2001 From: James Young <18669334+noroadsleft@users.noreply.github.com> Date: Sat, 30 May 2020 13:14:59 -0700 Subject: 2020 May 30 Breaking Changes Update (#9215) * Branch point for 2020 May 30 Breaking Change * Migrate `ACTION_LAYER_TOGGLE` to `TG()` (#8954) * Migrate `ACTION_MODS_ONESHOT` to `OSM()` (#8957) * Migrate `ACTION_DEFAULT_LAYER_SET` to `DF()` (#8958) * Migrate `ACTION_LAYER_MODS` to `LM()` (#8959) * Migrate `ACTION_MODS_TAP_KEY` to `MT()` (#8968) * Convert V-USB usbdrv to a submodule (#8321) * Unify Tap Hold functions and documentation (#8348) * Changing board names to prevent confusion (#8412) * Move the Keyboardio Model01 to a keyboardio/ subdir (#8499) * Move spaceman keyboards (#8830) * Migrate miscellaneous `fn_actions` entries (#8977) * Migrate `ACTION_MODS_KEY` to chained mod keycodes (#8979) * Organizing my keyboards (plaid, tartan, ergoinu) (#8537) * Refactor Lily58 to use split_common (#6260) * Refactor zinc to use split_common (#7114) * Add a message if bin/qmk doesn't work (#9000) * Fix conflicting types for 'tfp_printf' (#8269) * Fixed RGB_DISABLE_AFTER_TIMEOUT to be seconds based & small internals cleanup (#6480) * Refactor and updates to TKC1800 code (#8472) * Switch to qmk forks for everything (#9019) * audio refactor: replace deprecated PLAY_NOTE_ARRAY (#8484) * Audio enable corrections (2/3) (#8903) * Split HHKB to ANSI and JP layouts and Add VIA support for each (#8582) * Audio enable corrections (Part 4) (#8974) * Fix typo from PR7114 (#9171) * Augment future branch Changelogs (#8978) * Revert "Branch point for 2020 May 30 Breaking Change" --- .../hhkb/ansi/keymaps/shela/action_pseudo_lut.c | 143 ++++++++++++++++ .../hhkb/ansi/keymaps/shela/action_pseudo_lut.h | 15 ++ keyboards/hhkb/ansi/keymaps/shela/config.h | 12 ++ keyboards/hhkb/ansi/keymaps/shela/keymap.c | 186 +++++++++++++++++++++ keyboards/hhkb/ansi/keymaps/shela/keymap_jis2us.h | 32 ++++ keyboards/hhkb/ansi/keymaps/shela/readme.md | 14 ++ keyboards/hhkb/ansi/keymaps/shela/rules.mk | 1 + 7 files changed, 403 insertions(+) create mode 100644 keyboards/hhkb/ansi/keymaps/shela/action_pseudo_lut.c create mode 100644 keyboards/hhkb/ansi/keymaps/shela/action_pseudo_lut.h create mode 100644 keyboards/hhkb/ansi/keymaps/shela/config.h create mode 100644 keyboards/hhkb/ansi/keymaps/shela/keymap.c create mode 100644 keyboards/hhkb/ansi/keymaps/shela/keymap_jis2us.h create mode 100644 keyboards/hhkb/ansi/keymaps/shela/readme.md create mode 100644 keyboards/hhkb/ansi/keymaps/shela/rules.mk (limited to 'keyboards/hhkb/ansi/keymaps/shela') diff --git a/keyboards/hhkb/ansi/keymaps/shela/action_pseudo_lut.c b/keyboards/hhkb/ansi/keymaps/shela/action_pseudo_lut.c new file mode 100644 index 0000000000..a15f5e5e0b --- /dev/null +++ b/keyboards/hhkb/ansi/keymaps/shela/action_pseudo_lut.c @@ -0,0 +1,143 @@ +#include "quantum.h" +#include "command.h" +#include "action_pseudo_lut.h" + +static uint8_t send_key_shift_bit[SHIFT_BIT_SIZE]; + +/* + * Pseudo layout action. + * This action converts a keycode in order to output the character according to the keymap you specified + * still your keyboard layout recognized wrongly on your OS. + * Memo: Using other layer keymap to get keycode + */ +void action_pseudo_lut(keyrecord_t *record, uint8_t base_keymap_id, const uint16_t (*keymap)[2]) { + uint8_t prev_shift; + uint16_t keycode; + uint16_t pseudo_keycode; + + /* get keycode from keymap you specified */ + keycode = keymap_key_to_keycode(base_keymap_id, record->event.key); + + prev_shift = keyboard_report->mods & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + + if (record->event.pressed) { + /* when magic commands entered, keycode does not converted */ + if (IS_COMMAND()) { + if (prev_shift) { + add_shift_bit(keycode); + } + register_code(keycode); + return; + } + + if (prev_shift) { + pseudo_keycode = convert_keycode(keymap, keycode, true); + dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode); + add_shift_bit(keycode); + + if (IS_LSFT(pseudo_keycode)) { + register_code(QK_LSFT ^ pseudo_keycode); + } else { + /* delete shift mod temporarily */ + del_mods(prev_shift); + send_keyboard_report(); + register_code(pseudo_keycode); + add_mods(prev_shift); + send_keyboard_report(); + } + } else { + pseudo_keycode = convert_keycode(keymap, keycode, false); + dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode); + + if (IS_LSFT(pseudo_keycode)) { + add_weak_mods(MOD_BIT(KC_LSFT)); + send_keyboard_report(); + register_code(QK_LSFT ^ pseudo_keycode); + /* on Windows, prevent key repeat to avoid unintended output */ + unregister_code(QK_LSFT ^ pseudo_keycode); + del_weak_mods(MOD_BIT(KC_LSFT)); + send_keyboard_report(); + } else { + register_code(pseudo_keycode); + } + } + } else { + if (get_shift_bit(keycode)) { + del_shift_bit(keycode); + pseudo_keycode = convert_keycode(keymap, keycode, true); + } else { + pseudo_keycode = convert_keycode(keymap, keycode, false); + } + dprintf("released: %02X, converted: %04X\n", keycode, pseudo_keycode); + + if (IS_LSFT(pseudo_keycode)) { + unregister_code(QK_LSFT ^ pseudo_keycode); + } else { + unregister_code(pseudo_keycode); + } + } +} + +uint16_t convert_keycode(const uint16_t (*keymap)[2], uint16_t keycode, bool shift_modded) +{ + uint16_t pseudo_keycode; + + switch (keycode) { + case KC_A ... KC_CAPSLOCK: +#if defined(__AVR__) + if (shift_modded) { + pseudo_keycode = pgm_read_word(&keymap[keycode][1]); + } else { + pseudo_keycode = pgm_read_word(&keymap[keycode][0]); + } +#else + if (shift_modded) { + pseudo_keycode = keymap[keycode][1]; + } else { + pseudo_keycode = keymap[keycode][0]; + } +#endif + /* if undefined, use got keycode as it is */ + if (pseudo_keycode == 0x00) { + if (shift_modded) { + pseudo_keycode = S(keycode); + } else { + pseudo_keycode = keycode; + } + } + break; + default: + if (shift_modded) { + pseudo_keycode = S(keycode); + } else { + pseudo_keycode = keycode; + } + break; + } + return pseudo_keycode; +} + +uint8_t get_shift_bit(uint16_t keycode) { + if ((keycode >> 3) < SHIFT_BIT_SIZE) { + return send_key_shift_bit[keycode >> 3] & (1 << (keycode & 7)); + } else { + dprintf("get_shift_bit: Can't get shift bit. keycode: %02X\n", keycode); + return 0; + } +} + +void add_shift_bit(uint16_t keycode) { + if ((keycode >> 3) < SHIFT_BIT_SIZE) { + send_key_shift_bit[keycode >> 3] |= (1 << (keycode & 7)); + } else { + dprintf("add_shift_bit: Can't add shift bit. keycode: %02X\n", keycode); + } +} + +void del_shift_bit(uint16_t keycode) { + if ((keycode >> 3) < SHIFT_BIT_SIZE) { + send_key_shift_bit[keycode >> 3] &= ~(1 << (keycode & 7)); + } else { + dprintf("del_shift_bit: Can't delete shift bit. keycode: %02X\n", keycode); + } +} diff --git a/keyboards/hhkb/ansi/keymaps/shela/action_pseudo_lut.h b/keyboards/hhkb/ansi/keymaps/shela/action_pseudo_lut.h new file mode 100644 index 0000000000..681252440f --- /dev/null +++ b/keyboards/hhkb/ansi/keymaps/shela/action_pseudo_lut.h @@ -0,0 +1,15 @@ +#ifndef ACTION_PSEUDO_LUT_H +#define ACTION_PSEUDO_LUT_H + +#define SHIFT_BIT_SIZE (0xE7 / 8 + 1) // 1bit per 1key + +#define IS_LSFT(kc) ((QK_LSFT & (kc)) == QK_LSFT) + +void action_pseudo_lut(keyrecord_t *, uint8_t, const uint16_t (*)[2]); +uint16_t convert_keycode(const uint16_t (*)[2], uint16_t, bool); + +uint8_t get_shift_bit(uint16_t); +void add_shift_bit(uint16_t); +void del_shift_bit(uint16_t); + +#endif diff --git a/keyboards/hhkb/ansi/keymaps/shela/config.h b/keyboards/hhkb/ansi/keymaps/shela/config.h new file mode 100644 index 0000000000..08cc1fb46e --- /dev/null +++ b/keyboards/hhkb/ansi/keymaps/shela/config.h @@ -0,0 +1,12 @@ +#ifndef CONFIG_SHELA_H +#define CONFIG_SHELA_H + +#include "../../config.h" + +#undef TAPPING_TERM +#define TAPPING_TERM 230 + +#define ONESHOT_TAP_TOGGLE 2 +#define ONESHOT_TIMEOUT 2000 + +#endif diff --git a/keyboards/hhkb/ansi/keymaps/shela/keymap.c b/keyboards/hhkb/ansi/keymaps/shela/keymap.c new file mode 100644 index 0000000000..3971e8f945 --- /dev/null +++ b/keyboards/hhkb/ansi/keymaps/shela/keymap.c @@ -0,0 +1,186 @@ +/* + * HHKB Pro 2 US Layout for shela + */ +#include QMK_KEYBOARD_H +#include "keymap_jis2us.h" +#include "action_pseudo_lut.h" + +enum keymap_layout +{ + BASE = 0, + PSEUDO_US, + DVORAK, + MOUSE, + TENKEY, + HHKB, + SPACE_FN, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Layer 0: Default Layer + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | ` | BSp | + * |-----------------------------------------------------------------------------------------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |-----------------------------------------------------------------------------------------| + * | Control | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------| + * | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Fn0 | + * `-----------------------------------------------------------------------------------------' + * |LAlt | LGui | SpaceFN | RGui |RAlt | + * `-----------------------------------------------------------------' + */ + [BASE] = + LAYOUT(KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + OSM(MOD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(HHKB), + KC_LALT, KC_LGUI, LT(SPACE_FN, KC_SPACE), KC_RGUI, KC_RALT), + + /* Layer 1: Pseudo US Layout Layer + * ,-----------------------------------------------------------------------------------------. + * | Esc | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | BSp | + * |-----------------------------------------------------------------------------------------| + * | Tab | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | + * |-----------------------------------------------------------------------------------------| + * | Control | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Enter | + * |-----------------------------------------------------------------------------------------| + * | Shift | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Fn1 | Shift | Fn0 | + * `-----------------------------------------------------------------------------------------' + * |LGui | Fn3 | SpaceFN | Fn4 |RGui | + * `-----------------------------------------------------------------' + */ + [PSEUDO_US] = + LAYOUT(KC_ESC, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_BSPC, + KC_TAB, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, + KC_LCTL, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_ENT, + KC_LSFT, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_RSFT, MO(HHKB), + KC_LGUI, MT(MOD_LALT, KC_MHEN), LT(SPACE_FN, KC_SPACE), MT(MOD_RALT, KC_KANA), KC_RGUI), + + /* Layer 2: Dvorak Layer + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | [ | ] | ` | BSp | + * |-----------------------------------------------------------------------------------------| + * | Tab | ' | , | . | P | Y | F | G | C | R | L | / | = | \ | + * |-----------------------------------------------------------------------------------------| + * | Control | A | O | E | U | I | D | H | T | N | S | - | Enter | + * |-----------------------------------------------------------------------------------------| + * | Shift | ; | Q | J | K | X | B | M | W | V | Z | Shift | Fn0 | + * `-----------------------------------------------------------------------------------------' + * |LAlt | LGui | SpaceFN | RGui |RAlt | + * `-----------------------------------------------------------------' + */ + [DVORAK] = + LAYOUT(KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_GRV, KC_BSPC, + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, MO(HHKB), + KC_LALT, KC_LGUI, LT(SPACE_FN, KC_SPACE), KC_RGUI, KC_RALT), + + /* Layer 3: Mouse layer + * ,-----------------------------------------------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | MwL | MwD | MwU | MwR | | | | | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | McL | McD | McU | McR | | | | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | Mb1 | Mb2 | Mb3 | | | | Fn0 | + * `-----------------------------------------------------------------------------------------' + * | | | Mb1 | | | + * `-----------------------------------------------------------------' + */ + [MOUSE] = + LAYOUT(KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_NO, KC_NO, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_BTN1, KC_BTN2, KC_BTN3, KC_NO, KC_NO, KC_TRNS, MO(HHKB), + KC_TRNS, KC_TRNS, KC_BTN1, KC_TRNS, KC_TRNS), + + /* Layer 4: Tenkey layer + * ,-----------------------------------------------------------------------------------------. + * | Esc | | | | | | | | | | / | * | - | | BSp | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | | | | 7 | 8 | 9 | + | | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | | | | 4 | 5 | 6 | Enter | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | | | 1 | 2 | 3 | + | Fn0 | + * `-----------------------------------------------------------------------------------------' + * | | | SpaceFN | 0 | . | + * `-----------------------------------------------------------------' + */ + [TENKEY] = + LAYOUT(KC_ESC, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSLS, KC_PAST, KC_PMNS, KC_NO, KC_BSPC, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_KP_7, KC_KP_8, KC_KP_9, KC_PPLS, KC_NO, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_KP_4, KC_KP_5, KC_KP_6, KC_PENT, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_KP_1, KC_KP_2, KC_KP_3, KC_PPLS, MO(HHKB), + KC_TRNS, KC_TRNS, LT(SPACE_FN, KC_SPACE), KC_KP_0, KC_PDOT), + + /* Layer 5: HHKB mode (HHKB Fn) + * ,-----------------------------------------------------------------------------------------. + * | Pwr | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del | + * |-----------------------------------------------------------------------------------------| + * | Caps | Fn5 | Fn6 | Fn7 | Fn8 | Fn9 | | | Psc | Slk | Pus | Up | | BSp | + * |-----------------------------------------------------------------------------------------| + * | | VoD | VoU | Mut | | | * | / | Hom | PgU | Lef | Rig | Enter | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | + | - | End | PgD | Dow | | | + * `-----------------------------------------------------------------------------------------' + * | | | | | | + * `-----------------------------------------------------------------' + */ + [HHKB] = + LAYOUT(KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_CAPS, DF(BASE), DF(PSEUDO_US), DF(MOUSE), DF(TENKEY), DF(DVORAK), KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + /* Layer 6: SpaceFN + * ,-----------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | Del | + * |-----------------------------------------------------------------------------------------| + * | | Hom | Up | End | | | | Hom | End | | Psc | Slk | Pau | Ins | + * |-----------------------------------------------------------------------------------------| + * | | Lef | Dow | Rig | PgU | | Lef | Dow | Up | Rig | | | | + * |-----------------------------------------------------------------------------------------| + * | | | | PgD | | Spc | | PgD | PgU | | | | | + * `-----------------------------------------------------------------------------------------' + * | | | | | | + * `-----------------------------------------------------------------' + */ + [SPACE_FN] = + LAYOUT(KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_DEL, + KC_TRNS, KC_HOME, KC_UP, KC_END, KC_NO, KC_NO, KC_NO, KC_HOME, KC_END, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_INS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGUP, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, KC_NO, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_PGDN, KC_NO, KC_SPC, KC_NO, KC_PGDN, KC_PGUP, KC_NO, KC_NO, KC_TRNS, KC_NO, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +/* + * user defined action function + */ +enum function_id +{ + PSEUDO_US_FUNCTION, +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + + switch (id) + { + case PSEUDO_US_FUNCTION: + action_pseudo_lut(record, BASE, keymap_jis2us); + break; + } +} + +/* + * Fn action definition + */ +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_FUNCTION(PSEUDO_US_FUNCTION), +}; diff --git a/keyboards/hhkb/ansi/keymaps/shela/keymap_jis2us.h b/keyboards/hhkb/ansi/keymaps/shela/keymap_jis2us.h new file mode 100644 index 0000000000..edc1e6d869 --- /dev/null +++ b/keyboards/hhkb/ansi/keymaps/shela/keymap_jis2us.h @@ -0,0 +1,32 @@ +#ifndef LAYOUT_JIS2US_H +#define LAYOUT_JIS2US_H + +/* keymap for convert from JIS to US */ +const uint16_t PROGMEM keymap_jis2us[][2] = { + [KC_A ... KC_CAPS] = { 0x00, 0x00 }, /* default value */ + + [KC_1] = { KC_1, KC_EXLM }, /* 1 and ! -> 1 and ! */ + [KC_2] = { KC_2, KC_LBRC }, /* 2 and " -> 2 and @ */ + [KC_3] = { KC_3, KC_HASH }, /* 3 and # -> 3 and # */ + [KC_4] = { KC_4, KC_DLR }, /* 4 and $ -> 4 and $ */ + [KC_5] = { KC_5, KC_PERC }, /* 5 and % -> 5 and % */ + [KC_6] = { KC_6, KC_EQL }, /* 6 and & -> 6 and ^ */ + [KC_7] = { KC_7, KC_CIRC }, /* 7 and ' -> 7 and & */ + [KC_8] = { KC_8, KC_DQT }, /* 8 and ( -> 8 and * */ + [KC_9] = { KC_9, KC_ASTR }, /* 9 and ) -> 9 and ( */ + [KC_0] = { KC_0, KC_LPRN }, /* 0 and (no assign) -> 0 and ) */ + [KC_MINS] = { KC_MINS, S(KC_RO) }, /* - and = -> - and _ */ + [KC_EQL] = { KC_UNDS, KC_COLN }, /* ^ and ~ -> = and + */ + [KC_LBRC] = { KC_RBRC, KC_RCBR }, /* @ and ` -> [ and { */ + [KC_RBRC] = { KC_BSLS, KC_PIPE }, /* [ and { -> ] and } */ + [KC_BSLS] = { KC_JYEN, S(KC_JYEN) }, /* ] and } -> / and | */ + [KC_NUHS] = { KC_NUHS, S(KC_NUHS) }, /* (no assign) */ + [KC_SCLN] = { KC_SCLN, KC_QUOT }, /* ; and + -> ; and : */ + [KC_QUOT] = { KC_AMPR, KC_AT }, /* : and * -> ' and " */ + [KC_GRV] = { KC_LCBR, KC_PLUS }, /* (no assign) -> ` and ~ */ + [KC_COMM] = { KC_COMM, KC_LT }, /* , and < -> , and < */ + [KC_DOT] = { KC_DOT, KC_GT }, /* . and > -> . and > */ + [KC_SLSH] = { KC_SLSH, KC_QUES }, /* / and ? -> / and ? */ +}; + +#endif diff --git a/keyboards/hhkb/ansi/keymaps/shela/readme.md b/keyboards/hhkb/ansi/keymaps/shela/readme.md new file mode 100644 index 0000000000..5a06a83632 --- /dev/null +++ b/keyboards/hhkb/ansi/keymaps/shela/readme.md @@ -0,0 +1,14 @@ +# Shela's HHKB Layout + +Layer 0: US Layout +Layer 1: Pseudo US Layout +Layer 2: Dvorak Layout +Layer 3: Mouse +Layer 4: Tenkey +Layer 5: HHKB Fn Key +Layer 6: SpaceFN + +## Pseudo US Layout + +On japanese Windows, HHKB Professional 2 US layout model recognized wrongly as JIS layout without changing OS settings. +But, you can use HHKB like a US layout keyboard as it is. diff --git a/keyboards/hhkb/ansi/keymaps/shela/rules.mk b/keyboards/hhkb/ansi/keymaps/shela/rules.mk new file mode 100644 index 0000000000..d0586bda68 --- /dev/null +++ b/keyboards/hhkb/ansi/keymaps/shela/rules.mk @@ -0,0 +1 @@ +SRC += action_pseudo_lut.c -- cgit v1.2.3