From 4b4f1c6edb3c0fdba20f241e453407c80f262620 Mon Sep 17 00:00:00 2001 From: Will McGloughlin <3410869+wymcg@users.noreply.github.com> Date: Mon, 7 Mar 2022 02:16:50 -0500 Subject: [Keymap] Add encoder showcase keymap (#16544) --- keyboards/psuieee/pluto12/keymaps/default/keymap.c | 2 +- keyboards/psuieee/pluto12/keymaps/wymcg/keymap.c | 56 ++++++++++++++++++++++ keyboards/psuieee/pluto12/keymaps/wymcg/readme.md | 1 + 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 keyboards/psuieee/pluto12/keymaps/wymcg/keymap.c create mode 100644 keyboards/psuieee/pluto12/keymaps/wymcg/readme.md (limited to 'keyboards/psuieee/pluto12/keymaps') diff --git a/keyboards/psuieee/pluto12/keymaps/default/keymap.c b/keyboards/psuieee/pluto12/keymaps/default/keymap.c index 1c09c4fc83..c7008dad9e 100644 --- a/keyboards/psuieee/pluto12/keymaps/default/keymap.c +++ b/keyboards/psuieee/pluto12/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -// Copyright 2021 Will McGLoughlin (wymcg) +// Copyright 2021-22 Will McGLoughlin (wymcg) // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H diff --git a/keyboards/psuieee/pluto12/keymaps/wymcg/keymap.c b/keyboards/psuieee/pluto12/keymaps/wymcg/keymap.c new file mode 100644 index 0000000000..96499b8789 --- /dev/null +++ b/keyboards/psuieee/pluto12/keymaps/wymcg/keymap.c @@ -0,0 +1,56 @@ +// Copyright 2021-22 Will McGLoughlin (wymcg) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +// Defines names for use in layer keycodes and the keymap +enum layer_names { + _BASE, + _NAV, + _PROD +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + KC_MUTE, KC_MPRV, KC_MPLY, KC_MNXT, + TO(_NAV), G(KC_1), G(KC_2), G(KC_3), + TO(_PROD), G(KC_4), G(KC_5), G(KC_6) + ), + [_NAV] = LAYOUT( + TO(_BASE), KC_HOME, KC_UP, KC_END, + A(KC_TAB), KC_LEFT, KC_DOWN, KC_RIGHT, + G(KC_TAB), KC_PGDN, KC_PGUP, MO(_BASE) + ), + [_PROD] = LAYOUT( + TO(_BASE), KC_NO, KC_NO, KC_NO, + C(KC_Z), C(KC_X), C(KC_C), C(KC_V), + C(KC_A), C(KC_LEFT), C(KC_RIGHT),MO(_BASE) + ) +}; + +bool encoder_update_user(uint8_t index, bool clockwise) { + switch (biton32(layer_state)) { + case _BASE: + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + break; + case _NAV: + if (clockwise) { + tap_code16(C(G(KC_RIGHT))); + } else { + tap_code16(C(G(KC_LEFT))); + } + break; + case _PROD: + if (clockwise) { + tap_code16(C(KC_Y)); + } else { + tap_code16(C(KC_Z)); + } + break; + } + return false; +} diff --git a/keyboards/psuieee/pluto12/keymaps/wymcg/readme.md b/keyboards/psuieee/pluto12/keymaps/wymcg/readme.md new file mode 100644 index 0000000000..60d2f19be3 --- /dev/null +++ b/keyboards/psuieee/pluto12/keymaps/wymcg/readme.md @@ -0,0 +1 @@ +# wymcg's custom keymap -- cgit v1.2.3