aboutsummaryrefslogtreecommitdiff
path: root/keyboards/ckeys/washington/keymaps/default/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/ckeys/washington/keymaps/default/keymap.c')
-rw-r--r--keyboards/ckeys/washington/keymaps/default/keymap.c84
1 files changed, 84 insertions, 0 deletions
diff --git a/keyboards/ckeys/washington/keymaps/default/keymap.c b/keyboards/ckeys/washington/keymaps/default/keymap.c
new file mode 100644
index 000000000..771905814
--- /dev/null
+++ b/keyboards/ckeys/washington/keymaps/default/keymap.c
@@ -0,0 +1,84 @@
1/* Copyright 2019 merlin04
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
18// Defines names for use in layer keycodes and the keymap
19enum layer_names {
20 _BASE,
21 _FN
22};
23
24// Defines the keycodes used by our macros in process_record_user
25/*enum custom_keycodes {
26};*/
27
28const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
29 /* Base */
30 [_BASE] = LAYOUT(
31 KC_PGUP, KC_UP, KC_PGDN,
32 KC_LEFT, KC_DOWN, KC_RIGHT,
33 MO(_FN), KC_MUTE, BL_TOGG
34 ),
35 [_FN] = LAYOUT(
36 KC_HOME, KC_CALC, KC_END,
37 BL_STEP, KC_ESC, KC_SLEP,
38 KC_TRNS, KC_MPLY, RESET
39 )
40};
41
42bool encoder_update_user(uint8_t index, bool clockwise) {
43 switch (biton32(layer_state)) {
44 case _BASE:
45 if (clockwise) {
46 tap_code(KC_VOLU);
47 } else {
48 tap_code(KC_VOLD);
49 }
50 break;
51 case _FN:
52 if (clockwise) {
53 tap_code(KC_MNXT);
54 } else {
55 tap_code(KC_MPRV);
56 }
57 }
58 return true;
59}
60
61#ifdef OLED_ENABLE
62bool oled_task_user(void) {
63 // Host Keyboard Layer Status
64 oled_write_P(PSTR("Layer: "), false);
65 switch (biton32(layer_state)) {
66 case _BASE:
67 oled_write_P(PSTR("Default\n"), false);
68 break;
69 case _FN:
70 oled_write_P(PSTR("FN\n"), false);
71 break;
72 default:
73 // Or use the write_ln shortcut over adding '\n' to the end of your string
74 oled_write_ln_P(PSTR("Undefined"), false);
75 }
76
77 // Host Keyboard LED Status
78 uint8_t usb_led = host_keyboard_leds();
79 oled_write_P(IS_LED_ON(usb_led, USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false);
80 oled_write_P(IS_LED_ON(usb_led, USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false);
81 oled_write_P(IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK) ? PSTR("SCRLCK ") : PSTR(" "), false);
82 return false;
83}
84#endif