aboutsummaryrefslogtreecommitdiff
path: root/keyboards/rart/rartpad/keymaps/numpad/keymap.c
diff options
context:
space:
mode:
authorladbahuy <67696967+ladbahuy@users.noreply.github.com>2020-07-11 17:54:22 +0700
committerGitHub <noreply@github.com>2020-07-11 11:54:22 +0100
commit6609197cde9420b1e9e8b2337d939df6475e8a3c (patch)
tree8c1ddd9b21d1c2a88017449b4f054c025cdab8df /keyboards/rart/rartpad/keymaps/numpad/keymap.c
parent421621fbf13df48a462ce33ffd7988a886f3ec06 (diff)
downloadqmk_firmware-6609197cde9420b1e9e8b2337d939df6475e8a3c.tar.gz
qmk_firmware-6609197cde9420b1e9e8b2337d939df6475e8a3c.zip
[keyboard] Add rartpad (#9614)
Diffstat (limited to 'keyboards/rart/rartpad/keymaps/numpad/keymap.c')
-rw-r--r--keyboards/rart/rartpad/keymaps/numpad/keymap.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/keyboards/rart/rartpad/keymaps/numpad/keymap.c b/keyboards/rart/rartpad/keymaps/numpad/keymap.c
new file mode 100644
index 000000000..a3508ece9
--- /dev/null
+++ b/keyboards/rart/rartpad/keymaps/numpad/keymap.c
@@ -0,0 +1,45 @@
1/*
2Copyright 2020 Alabahuy
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17#include QMK_KEYBOARD_H
18
19
20const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
21
22 [0] = LAYOUT_numpad_5x4(
23 KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
24 KC_P7, KC_P8, KC_P9,
25 KC_P4, KC_P5, KC_P6, KC_PPLS,
26 KC_P1, KC_P2, KC_P3,
27 KC_P0, KC_PDOT, KC_PENT
28 )
29};
30
31void encoder_update_user(uint8_t index, bool clockwise) {
32 if (index == 0) { /* First encoder */
33 if (clockwise) {
34 tap_code(KC_VOLU);
35 } else {
36 tap_code(KC_VOLD);
37 }
38 } else if (index == 1) { /* Second encoder */
39 if (clockwise) {
40 tap_code(KC_PGUP);
41 } else {
42 tap_code(KC_PGDN);
43 }
44 }
45}