aboutsummaryrefslogtreecommitdiff
path: root/keyboards/keebio/bdn9/keymaps/codecoffeecode/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/keebio/bdn9/keymaps/codecoffeecode/keymap.c')
-rw-r--r--keyboards/keebio/bdn9/keymaps/codecoffeecode/keymap.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/keyboards/keebio/bdn9/keymaps/codecoffeecode/keymap.c b/keyboards/keebio/bdn9/keymaps/codecoffeecode/keymap.c
new file mode 100644
index 000000000..9747dbf22
--- /dev/null
+++ b/keyboards/keebio/bdn9/keymaps/codecoffeecode/keymap.c
@@ -0,0 +1,57 @@
1/* Copyright 2019 Danny Nguyen <danny@keeb.io>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 /*
20 | Knob 1: Scrl Dn/Up | | Knob 2: Vol Dn/Up |
21 | Press: Mute | Up | Press: Play/Pause |
22 | Left | Down | Right |
23 | Media Previous | MO(1)| Media Next |
24 */
25 [0] = LAYOUT(
26 KC_MUTE, KC_UP, KC_MPLY,
27 KC_LEFT, KC_DOWN, KC_RIGHT,
28 KC_MPRV, MO(1), KC_MNXT
29 ),
30 /*
31 | RESET | Home | Media Stop |
32 | | End | |
33 | CTRL_END | | CTRL_HOME |
34 */
35 [1] = LAYOUT(
36 RESET , KC_HOME, KC_STOP,
37 _______, KC_END, _______,
38 LCTL(KC_END), _______, LCTL(KC_HOME)
39 ),
40};
41
42void encoder_update_user(uint8_t index, bool clockwise) {
43 if (index == 0) {
44 if (clockwise) {
45 tap_code(KC_MS_WH_UP);
46 } else {
47 tap_code(KC_MS_WH_DOWN);
48 }
49 }
50 else if (index == 1) {
51 if (clockwise) {
52 tap_code(KC_VOLU);
53 } else {
54 tap_code(KC_VOLD);
55 }
56 }
57}