From 1806509ad5d34d6eabf2968097d6f68f048fc761 Mon Sep 17 00:00:00 2001 From: hdbx <38972365+hdbx@users.noreply.github.com> Date: Sat, 5 May 2018 02:27:00 +0900 Subject: [PATCH] Add new keymap for Ergo42 (#2891) * Add Ergo42 keymaps for JIS layout --- keyboards/ergo42/keymaps/hdbx/config.h | 48 ++++++ keyboards/ergo42/keymaps/hdbx/keymap.c | 188 ++++++++++++++++++++++++ keyboards/ergo42/keymaps/hdbx/readme.md | 71 +++++++++ keyboards/ergo42/keymaps/hdbx/rules.mk | 5 + 4 files changed, 312 insertions(+) create mode 100644 keyboards/ergo42/keymaps/hdbx/config.h create mode 100644 keyboards/ergo42/keymaps/hdbx/keymap.c create mode 100644 keyboards/ergo42/keymaps/hdbx/readme.md create mode 100644 keyboards/ergo42/keymaps/hdbx/rules.mk diff --git a/keyboards/ergo42/keymaps/hdbx/config.h b/keyboards/ergo42/keymaps/hdbx/config.h new file mode 100644 index 0000000000..39be7526ae --- /dev/null +++ b/keyboards/ergo42/keymaps/hdbx/config.h @@ -0,0 +1,48 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define TAPPING_TERM 120 +#define TAPPING_TOGGLE 3 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_SLEEP +#define RGBLED_NUM 14 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +#endif diff --git a/keyboards/ergo42/keymaps/hdbx/keymap.c b/keyboards/ergo42/keymaps/hdbx/keymap.c new file mode 100644 index 0000000000..29a419bce1 --- /dev/null +++ b/keyboards/ergo42/keymaps/hdbx/keymap.c @@ -0,0 +1,188 @@ +#include "ergo42.h" +#include "action_layer.h" +#include "eeconfig.h" +#include "keymap_jp.h" // qmk_firmware-master/quantum/keymap_extras/keymap_jp.h 日本語キーボード設定用 +#include // macro sendstring for jis keyboard マクロ文字列送信時に日本語キーボード設定での文字化け回避 + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _GAME 3 +#define _ADJUST 4 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + MCR1, + MCR2, + MCR3, + DYNAMIC_MACRO_RANGE, + WN_SCLN, // タップでJISの「:」 シフトでJISの「;」 (Windows) +}; + +// Use Dynamic macro +#include "dynamic_macro.h" + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +#define KC_LOWR LT(_LOWER, KC_MHEN) // タップで無変換 ホールドでLower +#define KC_RASE LT(_RAISE, KC_HENK) // タップで変換 ホールドでRaise +#define KC_ALPS LALT(KC_PSCR) // Alt + PrintScreen +#define KC_LSLP MT(MOD_LSFT, JP_LPRN) // タップで( ホールドで左Shift +#define KC_RSRP MT(MOD_RSFT, JP_RPRN) // タップで) ホールドで右Shift +#define KC_ALTB MT(MOD_LALT, KC_TAB) // タップでTAB ホールドで左ALT +#define KC_ESCA LT(_ADJUST,KC_ESC) // タップでESC ホールドでADJUSTレイヤーon + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * ,-------------------------------------------------------. ,-------------------------------------------------------. + * |Tab/Alt| Q | W | E | R | T | - | | ~ | Y | U | I | O | P | BSPC | + * |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + * | Ctrl | A | S | D | F | G | [ | | ] | H | J | K | L | : | ' | + * |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + * | (/Sft | Z | X | C | V | B | F2 | | Home | N | M | , | . | / | )/Sft | + * |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + * | TT | GUI | \ | Esc/ | LOWER | Enter | Del | | End | Space | RAISE | Left | Down | Up | Right | + * |(_GAME)| | |_ADJUST| 無変換| | | | | | 変換 | | | | | + * `-------------------------------------------------------' `-------------------------------------------------------' + */ + +[_QWERTY] = KEYMAP( \ + KC_ALTB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, JP_TILD, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, JP_LBRC, JP_RBRC, KC_H, KC_J, KC_K, KC_L, WN_SCLN, JP_QUOT, \ + KC_LSLP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_F2, KC_HOME, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSRP, \ + TT(_GAME),KC_LGUI, JP_YEN, KC_ESCA, KC_LOWR, KC_ENT, KC_DEL, KC_END, KC_SPC, KC_RASE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* LOWER + * ,-------------------------------------------------------. ,-------------------------------------------------------. + * |Tab/Alt| 1 | 2 | 3 | 4 | 5 | 6 | | Esc | 7 | 8 | 9 | O | = | BSPC | + * |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + * | Ctrl | F1 | F2 | F3 | F4 | F5 | F6 | | F2 | 4 | 5 | 6 | - | / | Enter | + * |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + * | Shift | F7 | F8 | F9 | F10 | F11 | F12 | | Home | 1 | 2 | 3 | + | * | Shift | + * |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + * |XXXXXXX| GUI |XXXXXXX| Esc | | Enter | Del | | End | 0 | . | Left | Down | Up | Right | + * `-------------------------------------------------------' `-------------------------------------------------------' + */ + +[_LOWER] = KEYMAP( \ + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_ESC, KC_7, KC_8, KC_9, KC_0, JP_EQL, _______, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F2, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_PSLS, KC_ENT, \ + KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PAST, KC_RSFT, \ + _______, _______, XXXXXXX, KC_ESC, _______, _______, _______, _______, KC_P0, KC_PDOT, _______, _______, _______, _______ \ +), + +/* RAISE + * ,-------------------------------------------------------. ,-------------------------------------------------------. + * |Tab/Alt| ! | @ | # | $ | % | _ | | ` | ^ | & | Ins | \ |PrntScr| BSPC | + * |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + * | Ctrl |XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX| { | | } | Left | Down | Up | Right | ; | " | + * |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + * | Shift |XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX| |PageUp |XXXXXXX|XXXXXXX| < | > | ? | Shift | + * |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + * |XXXXXXX| GUI | | | Esc |XXXXXXX| Enter | Del | |PageDwn| Space | | Left | Down | Up | Right | + * `-------------------------------------------------------' `-------------------------------------------------------' + */ + +[_RAISE] = KEYMAP( \ + _______, KC_EXLM, JP_AT, KC_HASH, KC_DLR, KC_PERC, JP_UNDS, JP_GRV, JP_CIRC, JP_AMPR, KC_INS, JP_YEN, KC_ALPS, _______, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, JP_LBRC, JP_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_SCLN, JP_DQT, \ + KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ + _______, _______, KC_PIPE, KC_ESC, XXXXXXX, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______ \ +), + +/* GAME + * ,-------------------------------------------------------. ,-------------------------------------------------------. + * | Esc | Q | W | E | R | T |PrntScr| | | | | | | | | + * |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + * | Ctrl | A | S | D | F | G | F5 | | | | | | | | | + * |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + * | Shift | Z | X | C | V | B | F2 | |PageUp | | | | | | | + * |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + * | | GUI | Tab | Alt | Space | Enter | Del | |PageDwn| Space |XXXXXXX| Left | Down | Up | Right | + * `-------------------------------------------------------' `-------------------------------------------------------' + */ +[_GAME] = KEYMAP( \ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ALPS, _______, _______, _______, _______, _______, _______, _______, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, JP_LBRC, _______, _______, _______, _______, _______, _______, _______, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_F2, KC_PGUP, _______, _______, _______, _______, _______, _______, \ + _______, KC_LGUI, KC_TAB, KC_LALT, KC_SPC, KC_ENT, KC_DEL, KC_PGDN, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* ADJUST + * ,-------------------------------------------------------. ,-------------------------------------------------------. + * |RGB_TOG| MCR1 | MCR2 | MCR3 |XXXXXXX|XXXXXXX|XXXXXXX| |XXXXXXX|PLAY_M1|PLAY_M2|REC_M1 |REC_M2 |STP_REC| BSPC | + * |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + * | RESET |RGB_MOD|_PLAIN |_BREATH|RGB_HuI|RGB_SaI|RGB_VaI| |XXXXXXX|QWERTY |XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX| + * |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + * | Shift |_RAINBW|_SNAKE |_GRADIE|RGB_HuD|RGB_SaD|RGB_VaD| |XXXXXXX| M-PLAY|M-MUTE |VOL_DWN|VOL_UP |PREV_TR|NEXT_TR| + * |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + * | DEBUG |XXXXXXX|XXXXXXX| |XXXXXXX|XXXXXXX|XXXXXXX| |XXXXXXX|XXXXXXX|XXXXXXX| Left | Down | Up | Right | + * `-------------------------------------------------------' `-------------------------------------------------------' + */ +[_ADJUST] = KEYMAP( \ + RGB_TOG, MCR1, MCR2, MCR3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, DYN_REC_START1, DYN_REC_START2, DYN_REC_STOP, KC_BSPC, \ + RESET, RGB_MOD, RGB_M_P, RGB_M_B, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, QWERTY, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_LSFT, RGB_M_R, RGB_M_SN,RGB_M_G, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MNXT, \ + DEBUG, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static bool lshift = false; + if (!process_record_dynamic_macro(keycode, record)) { + return false; + } + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case WN_SCLN: // コロン「;:」 + if (record->event.pressed) { + lshift = keyboard_report->mods & MOD_BIT(KC_LSFT); + if (lshift) { + unregister_code(KC_LSFT); + register_code(JP_SCLN); + unregister_code(JP_SCLN); + } else { + register_code(JP_COLN); + unregister_code(JP_COLN); + } + } + return false; + break; + case MCR1: + if (record->event.pressed) { + SEND_STRING("hogehoge"); // 送信文字列 + } + return false; + break; + case MCR2: + if (record->event.pressed) { + SEND_STRING("hogehogehoge"SS_TAP(X_ENTER)); // 送信文字列 + } + return false; + break; + case MCR3: + if (record->event.pressed) { + SEND_STRING("hoge@hoge.co.jp"); // 送信文字列 + } + return false; + break; + } + return true; +} diff --git a/keyboards/ergo42/keymaps/hdbx/readme.md b/keyboards/ergo42/keymaps/hdbx/readme.md new file mode 100644 index 0000000000..2aeebfe41c --- /dev/null +++ b/keyboards/ergo42/keymaps/hdbx/readme.md @@ -0,0 +1,71 @@ +# hdbx + +Designed for Japanese Keyboardists using JIS on the Ergo42. + +## Layer + +```` +QWERTY +,-------------------------------------------------------. ,-------------------------------------------------------. +|Tab/Alt| Q | W | E | R | T | - | | ~ | Y | U | I | O | P | BSPC | +|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| +| Ctrl | A | S | D | F | G | [ | | ] | H | J | K | L | : | ' | +|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| +| (/Sft | Z | X | C | V | B | F2 | | Home | N | M | , | . | / | )/Sft | +|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| +| TT | GUI | \ | Esc/ | LOWER | Enter | Del | | End | Space | RAISE | Left | Down | Up | Right | +|(_GAME)| | |_ADJUST| 無変換| | | | | | 変換 | | | | | +`-------------------------------------------------------' `-------------------------------------------------------' + */ + +LOWER +,-------------------------------------------------------. ,-------------------------------------------------------. +|Tab/Alt| 1 | 2 | 3 | 4 | 5 | 6 | | Esc | 7 | 8 | 9 | O | = | BSPC | +|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| +| Ctrl | F1 | F2 | F3 | F4 | F5 | F6 | | F2 | 4 | 5 | 6 | - | / | Enter | +|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| +| Shift | F7 | F8 | F9 | F10 | F11 | F12 | | Home | 1 | 2 | 3 | + | * | Shift | +|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| +|XXXXXXX| GUI |XXXXXXX| Esc | | Enter | Del | | End | 0 | . | Left | Down | Up | Right | +`-------------------------------------------------------' `-------------------------------------------------------' + */ + +RAISE +,-------------------------------------------------------. ,-------------------------------------------------------. +|Tab/Alt| ! | @ | # | $ | % | _ | | ` | ^ | & | Ins | \ |PrntScr| BSPC | +|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| +| Ctrl |XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX| { | | } | Left | Down | Up | Right | ; | " | +|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| +| Shift |XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX| |PageUp |XXXXXXX|XXXXXXX| < | > | ? | Shift | +|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| +|XXXXXXX| GUI | | | Esc |XXXXXXX| Enter | Del | |PageDwn| Space | | Left | Down | Up | Right | +`-------------------------------------------------------' `-------------------------------------------------------' + */ + +GAME +,-------------------------------------------------------. ,-------------------------------------------------------. +| Esc | Q | W | E | R | T |PrntScr| | | | | | | | | +|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| +| Ctrl | A | S | D | F | G | F5 | | | | | | | | | +|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| +| Shift | Z | X | C | V | B | F2 | |PageUp | | | | | | | +|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| +| | GUI | Tab | Alt | Space | Enter | Del | |PageDwn| Space |XXXXXXX| Left | Down | Up | Right | +`-------------------------------------------------------' `-------------------------------------------------------' + */ + +ADJUST +,-------------------------------------------------------. ,-------------------------------------------------------. +|RGB_TOG| MCR1 | MCR2 | MCR3 |XXXXXXX|XXXXXXX|XXXXXXX| |XXXXXXX|PLAY_M1|PLAY_M2|REC_M1 |REC_M2 |STP_REC| BSPC | +|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| +| RESET |RGB_MOD|_PLAIN |_BREATH|RGB_HuI|RGB_SaI|RGB_VaI| |XXXXXXX|QWERTY |XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX| +|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| +| Shift |_RAINBW|_SNAKE |_GRADIE|RGB_HuD|RGB_SaD|RGB_VaD| |XXXXXXX| M-PLAY|M-MUTE |VOL_DWN|VOL_UP |PREV_TR|NEXT_TR| +|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| +| DEBUG |XXXXXXX|XXXXXXX| |XXXXXXX|XXXXXXX|XXXXXXX| |XXXXXXX|XXXXXXX|XXXXXXX| Left | Down | Up | Right | +`-------------------------------------------------------' `-------------------------------------------------------' +```` + +## Notes + +Supports RGB Underglow and Dynamic Macros. diff --git a/keyboards/ergo42/keymaps/hdbx/rules.mk b/keyboards/ergo42/keymaps/hdbx/rules.mk new file mode 100644 index 0000000000..1e57612788 --- /dev/null +++ b/keyboards/ergo42/keymaps/hdbx/rules.mk @@ -0,0 +1,5 @@ +RGBLIGHT_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif