From c2f3c418f33bf5d8d60e005de4d076949a7c7098 Mon Sep 17 00:00:00 2001 From: MakotoKurauchi Date: Sun, 19 Sep 2021 04:28:41 +0900 Subject: [Keyboard] Add new keyboard quick17 (#13703) Co-authored-by: Drashna Jaelre Co-authored-by: Ryan Co-authored-by: keyaki-namiki <28521374+keyaki-namiki@users.noreply.github.com> --- keyboards/yushakobo/quick17/keymaps/via/keymap.c | 113 ++++++++++++++++++++++ keyboards/yushakobo/quick17/keymaps/via/readme.md | 62 ++++++++++++ keyboards/yushakobo/quick17/keymaps/via/rules.mk | 3 + 3 files changed, 178 insertions(+) create mode 100644 keyboards/yushakobo/quick17/keymaps/via/keymap.c create mode 100644 keyboards/yushakobo/quick17/keymaps/via/readme.md create mode 100644 keyboards/yushakobo/quick17/keymaps/via/rules.mk (limited to 'keyboards/yushakobo/quick17/keymaps/via') diff --git a/keyboards/yushakobo/quick17/keymaps/via/keymap.c b/keyboards/yushakobo/quick17/keymaps/via/keymap.c new file mode 100644 index 0000000000..a3873bc1ee --- /dev/null +++ b/keyboards/yushakobo/quick17/keymaps/via/keymap.c @@ -0,0 +1,113 @@ +/* Copyright 2021 yushakobo + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + KC_LANG +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_CONTROL] = LAYOUT( + KC_TAB, KC_PGUP,KC_UP, KC_PGDN,KC_HOME,KC_INS, + KC_LCTL,KC_LEFT,KC_DOWN,KC_RGHT,KC_END, KC_DEL, + KC_LSFT,KC_LGUI,KC_ESC, KC_LALT,LT(3,KC_SPC),TO(1) + ), + [_EDIT1] = LAYOUT( + KC_ESC, KC_W, KC_E, KC_R, KC_Y, KC_BSPC, + KC_LCTL,KC_A, KC_D, KC_F, KC_H, LCTL(KC_Z), + KC_LSFT,KC_X, KC_V, KC_B, LT(2,KC_SPC),LCTL(KC_S) + ), + [_EDIT2] = LAYOUT( + KC_ESC, KC_Q, KC_BTN3,KC_INS, KC_ENT, KC_DEL, + KC_LCTL,KC_LBRC,KC_RBRC,KC_PGDN,KC_PGUP,LCTL(KC_Y), + KC_LSFT,TO(3), RGB_TOG,TO(0), _______,KC_NO + ), + [_FN] = LAYOUT( + KC_ESC, KC_LANG,KC_NO, RGB_TOG,KC_MNXT,KC_VOLU, + KC_CAPS,KC_NLCK,KC_NO, RGB_MOD,KC_MPRV,KC_VOLD, + CG_NORM,LCG_SWP,EEP_RST,RESET, TO(0), KC_MUTE + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_LANG: + if (record->event.pressed){ + if (keymap_config.swap_lctl_lgui == false){ + tap_code16(LALT(KC_GRV)); + } else { + if(input_mode()){ + register_code(KC_LANG2); + set_input_mode(false); + } else { + register_code(KC_LANG1); + set_input_mode(true); + } + } + } else { + unregister_code(KC_LANG1); + unregister_code(KC_LANG2); + } + break; + default: + break; + } + return true; +} + +bool encoder_update_user(uint8_t index, bool clockwise){ + if (index == 0) { + if (IS_LAYER_ON(_EDIT2)){ + if (clockwise) { + tap_code(KC_LBRC); + } else { + tap_code(KC_RBRC); + } + } else if (IS_LAYER_ON(_EDIT1)){ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (IS_LAYER_ON(_FN)){ + if (clockwise) { + tap_code(KC_MNXT); + } else { + tap_code(KC_MPRV); + } + } else { // IS_LAYER_ON(_CONTROL) + if (clockwise) { + tap_code(KC_WH_U); + } else { + tap_code(KC_WH_D); + } + } + } + return false; +} + +#ifdef RGB_MATRIX_ENABLE + void keyboard_post_init_user(void){ + rgb_matrix_mode(RGB_MATRIX_CUSTOM_quick17_rgbm_effect); + set_input_mode(false); + } +#else + void keyboard_post_init_user(void){ + rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL); + set_input_mode(false); + } +#endif diff --git a/keyboards/yushakobo/quick17/keymaps/via/readme.md b/keyboards/yushakobo/quick17/keymaps/via/readme.md new file mode 100644 index 0000000000..da0923539d --- /dev/null +++ b/keyboards/yushakobo/quick17/keymaps/via/readme.md @@ -0,0 +1,62 @@ +# The via keymap for quick17 + +## CONTROL(default) Layer +``` + ,-----------------------------------------------. + | Tab | PgUp | Up | PgDn | Home | Ins | + |-------+-------+-------+-------+-------+-------| + | Ctrl | Left | Down | Right | End | Del | + |-------+-------+-------+-------+-------+-------| + | Shift | GUI | Esc | Alt | FN/Spc| EDIT1 | + `-----------------------------------------------' +``` + +## EDIT1 Layer +``` + ,--------------------------------------------------. + | Esc | W | E | R | Y | Bspc | + |-------+-------+-------+-------+---------+--------| + | Ctrl | A | D | F | H | Ctrl+Z | + |-------+-------+-------+-------+---------+--------| + | Shift | X | V | B |EDIT2/Spc| Ctrl+S | + `--------------------------------------------------' +``` + +## EDIT2 Layer +``` + ,-------------------------------------------------. + | Esc | Q | BTN3 | Ins | Enter | Bspc | + |-------+-------+-------+-------+--------+--------| + | Ctrl | [ | ] | PgDn | PgUp | Ctrl+Z | + |-------+-------+-------+-------+--------+--------| + | Shift | FN |RGB_TOG|CONTROL| (NONE) | (NONE) | + `-------------------------------------------------' +``` + +## FN Layer +``` + ,---------------------------------------------------. + | Esc | LANG | (NONE) |RGB_TOG| Media > | Vol+ | + |-------+-------+--------+-------+---------+--------| + | Caps | Numlk | (NONE) |RGB_MOD| Media < | Vol- | + |-------+-------+--------+-------+---------+--------| + | Win | mac | EEP_RST| RESET | CONTROL | Mute | + `---------------------------------------------------' +``` +### difference between mac-Mode and Win-Mode +- In mac Mode, `Ctrl` key will be changed into `command` key. +- `LANG` key will change its behaviour. + +### "LANG" key behaviour + +- mac Mode: cycle around "かな" and "英数" +- Win Mode: key combinations of Alt and ` + +## Rotary encoder behaviour + +|On layer...|Clockwise|C-Clockwise| +|---|---|---| +|CONTROL|Scroll Up|Scroll Down| +|EDIT1|Vol+|Vol-| +|EDIT2|[|]| +|FN|Media >|Media <| diff --git a/keyboards/yushakobo/quick17/keymaps/via/rules.mk b/keyboards/yushakobo/quick17/keymaps/via/rules.mk new file mode 100644 index 0000000000..b5502db7c4 --- /dev/null +++ b/keyboards/yushakobo/quick17/keymaps/via/rules.mk @@ -0,0 +1,3 @@ +VIA_ENABLE = yes +RGBLIGHT_ENABLE = yes +RGB_MATRIX_ENABLE = no \ No newline at end of file -- cgit v1.2.3