forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Keymap] Add encoder showcase keymap (qmk#16544)
- Loading branch information
Showing
7 changed files
with
68 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# wymcg's custom keymap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// Copyright 2021 Will McGloughlin (@wymcg) | ||
// Copyright 2021-22 Will McGloughlin (@wymcg) | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#include "pluto12.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters