From dd42387d9fd288db22bd5c73664471220a6de8c2 Mon Sep 17 00:00:00 2001 From: Tom Date: Fri, 15 Oct 2021 03:11:01 +0200 Subject: [Keymap] Add keebio iris layout beakl 15 (#14762) --- keyboards/keebio/iris/keymaps/sq5rix/config.h | 25 ++++ keyboards/keebio/iris/keymaps/sq5rix/keymap.c | 185 +++++++++++++++++++++++++ keyboards/keebio/iris/keymaps/sq5rix/readme.md | 17 +++ keyboards/keebio/iris/keymaps/sq5rix/rules.mk | 4 + 4 files changed, 231 insertions(+) create mode 100644 keyboards/keebio/iris/keymaps/sq5rix/config.h create mode 100644 keyboards/keebio/iris/keymaps/sq5rix/keymap.c create mode 100644 keyboards/keebio/iris/keymaps/sq5rix/readme.md create mode 100644 keyboards/keebio/iris/keymaps/sq5rix/rules.mk (limited to 'keyboards/keebio/iris/keymaps') diff --git a/keyboards/keebio/iris/keymaps/sq5rix/config.h b/keyboards/keebio/iris/keymaps/sq5rix/config.h new file mode 100644 index 0000000000..8c576917e8 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/sq5rix/config.h @@ -0,0 +1,25 @@ +/* +Copyright 2017 Danny Nguyen + +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 . +*/ + +#pragma once +#define EE_HANDS +#define TAPPING_TERM 164 +#define IGNORE_MOD_TAP_INTERRUPT +#define PERMISSIVE_HOLD +#define RGBLIGHT_LAYERS +#define ENCODER_RESOLUTION 4 +#define ENCODER_DEFAULT_POS 0x3 diff --git a/keyboards/keebio/iris/keymaps/sq5rix/keymap.c b/keyboards/keebio/iris/keymaps/sq5rix/keymap.c new file mode 100644 index 0000000000..19a939a55b --- /dev/null +++ b/keyboards/keebio/iris/keymaps/sq5rix/keymap.c @@ -0,0 +1,185 @@ +// Copyright 2021 Tomasz Wawer (@sq5rix) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +enum layers { + _BEAKL15, + _LOWER, + _RAISE, + _MOUSE +}; + +enum custom_keycodes { + LT_DAT = SAFE_RANGE, + LT_COM, + LT_QUOT +}; + +#define LOWER LT(_LOWER, KC_ENT) +#define LOWER2 LT(_LOWER, KC_T) +#define RAISE LT(_RAISE, KC_SPC) +#define RAISE2 LT(_RAISE, KC_BSPC) +#define MOUSE LT(_MOUSE, KC_A) + +#define SH_ESC MT(MOD_LSFT, KC_ESC) +#define SH_CWD MT(MOD_LALT, KC_BSPC) +#define SH_LTAB MT(MOD_LALT, KC_TAB) +#define SH_UND MT(MOD_LCTL, KC_UNDS) +#define SH_Z MT(MOD_LCTL, KC_Z) + +#define SH_LGS MT(MOD_LGUI, KC_B) +#define AL_I ALGR_T(KC_I) +#define AL_N ALGR_T(KC_N) + +// Tap Dance definitions +enum { + TD_S +}; +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_S] = ACTION_TAP_DANCE_DOUBLE(KC_S, KC_Z), +}; + +bool sh_key(keyrecord_t *record, uint8_t sk, uint8_t nk); +bool sh_key8(keyrecord_t *record, uint8_t sk, uint8_t nk); + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BEAKL15] = LAYOUT( + TG(_RAISE), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, + SH_LTAB, KC_Q, KC_H, KC_O, KC_U, KC_X, KC_G, KC_C, KC_R, KC_F, KC_Z, KC_LGUI, + SH_UND, KC_Y, AL_I, KC_E, MOUSE, LT_DAT, KC_D, TD(TD_S),LOWER2, AL_N, KC_B, KC_SCLN, + KC_LSFT, KC_J, KC_SLSH, LT_COM, KC_K, LT_QUOT, RGB_TOG, BL_TOGG, KC_W, KC_M, KC_L, KC_P, KC_V, KC_RSFT, + SH_Z, LOWER, RAISE, SH_ESC, RAISE2, SH_LTAB + ), + + [_LOWER] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_LT, KC_DLR, KC_GT, KC_EXLM, _______, KC_LBRC, KC_UNDS, KC_RBRC, KC_EXLM, _______, + _______, KC_BSLS, KC_LPRN, KC_DQUO, KC_RPRN, KC_HASH, KC_PERC, KC_LCBR, KC_EQL, KC_RCBR, KC_PIPE, _______, + _______, KC_SCLN, KC_SLSH, KC_ASTR, KC_PLUS, _______, _______, _______, _______, KC_AMPR, KC_CIRC, KC_TILD, KC_SCLN, _______, + _______, _______, _______, _______, _______, _______ + + ), + + [_RAISE] = LAYOUT( + _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_BRIGHTNESS_DOWN, KC_BRIGHTNESS_UP, KC_PSCREEN, _______, _______, _______, _______, RESET, + _______, KC_SLSH, KC_6, KC_5, KC_4, KC_EQL, KC_CIRC, KC_PGUP, KC_UP, KC_PGDN, _______, RGB_VAI, + _______, KC_3, KC_2, KC_1, KC_0, KC_DOT, KC_EQL, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + _______, KC_ASTR, KC_9, KC_8, KC_7, KC_PLUS, _______, _______, KC_PLUS, KC_HOME, KC_COLN, KC_END, _______, RGB_MOD, + _______, _______, _______, _______, _______, _______ + ), + + [_MOUSE] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_BTN1, KC_MS_U, KC_BTN2, _______, _______, + _______, _______, _______, KC_BTN1, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN3, _______, _______, _______, + _______, _______, _______, _______, _______, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LT_DAT: + return sh_key8(record, KC_2, KC_DOT); + case LT_COM: + return sh_key8(record, KC_1, KC_COMM); + case LT_QUOT: + return sh_key(record, KC_GRV, KC_QUOT); + default: + return true; + } +} + +bool sh_key(keyrecord_t *record, uint8_t sk, uint8_t nk){ + if (record->event.pressed) { + if (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)){ + unregister_code(KC_LSFT); + unregister_code(KC_RSFT); + register_code(sk); + } else { + register_code(nk); + } + } + else { + unregister_code16(sk); + unregister_code(nk); + } + return false; +} + +bool sh_key8(keyrecord_t *record, uint8_t sk, uint8_t nk){ + if (record->event.pressed) { + if (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)){ + register_code(sk); + } else { + register_code(nk); + } + } + else { + unregister_code(sk); + unregister_code(nk); + } + return false; +} + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (clockwise) { + tap_code16(C(G(KC_LEFT))); + } else { + tap_code16(C(G(KC_RGHT))); + } + } + // tmux screen + else if (index == 1) { + switch(biton32(layer_state)){ + case 0: + if (clockwise) { + send_string(SS_LCTL("B")"p"); + } else { + send_string(SS_LCTL("B")"n"); + } + break; + case _RAISE: + if (clockwise) { + tap_code16(C(G(KC_PGUP))); + } else { + tap_code16(C(G(KC_PGDN))); + } + break; + } + } + return true; +} + +const rgblight_segment_t PROGMEM raise_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {1, 12, HSV_RED} +); +const rgblight_segment_t PROGMEM lower_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {1, 12, HSV_BLUE} +); +const rgblight_segment_t PROGMEM mouse_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {1, 12, HSV_GREEN} +); + +// Now define the array of layers. Later layers take precedence +const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( + lower_layer, + raise_layer, + mouse_layer +); + +void keyboard_post_init_user(void) { + // Enable the LED layers + rgblight_layers = my_rgb_layers; +} + +layer_state_t layer_state_set_user(layer_state_t state) { + rgblight_set_layer_state(0, layer_state_cmp(state, 2)); + rgblight_set_layer_state(1, layer_state_cmp(state, 3)); + rgblight_set_layer_state(2, layer_state_cmp(state, 4)); + return state; +} + diff --git a/keyboards/keebio/iris/keymaps/sq5rix/readme.md b/keyboards/keebio/iris/keymaps/sq5rix/readme.md new file mode 100644 index 0000000000..96370c74cd --- /dev/null +++ b/keyboards/keebio/iris/keymaps/sq5rix/readme.md @@ -0,0 +1,17 @@ +BEAKL-15 keymap for keebio iris +@sq5rix tom wawer +https://deskthority.net/wiki/BEAKL#BEAKL_15 + +Modern keyboard map easy to learn +very effective to type + +esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 Del + q h o u x g c r f z + - y i e a . d s t n b ; + j / , , k w m l p v + + z enter space esc bkspc tab + +lots of special functions +three layers with puncs, numbers and mouse + diff --git a/keyboards/keebio/iris/keymaps/sq5rix/rules.mk b/keyboards/keebio/iris/keymaps/sq5rix/rules.mk new file mode 100644 index 0000000000..3fc2bd9768 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/sq5rix/rules.mk @@ -0,0 +1,4 @@ +RGBLIGHT_ENABLE = yes +TAP_DANCE_ENABLE = yes +LTO_ENABLE = yes +MOUSEKEY_ENABLE = yes -- cgit v1.2.3