aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikkel Jeppesen <2756925+Duckle29@users.noreply.github.com>2019-02-26 22:04:28 +0100
committerDrashna Jaelre <drashna@live.com>2019-02-26 13:04:28 -0800
commit168b0cf64d539e88436b1d93f5d2ad65db1c8591 (patch)
treed175185ba5798e6b5afbe6a5c00f2609ea315c6d
parentbcaf66bd3238b5a69c7ec5910a116c5668e1695c (diff)
downloadqmk_firmware-168b0cf64d539e88436b1d93f5d2ad65db1c8591.tar.gz
qmk_firmware-168b0cf64d539e88436b1d93f5d2ad65db1c8591.zip
Added a numpad keymap for the vitamins included keyboard (#5247)
* Fixed pin for RGB * Added numpad keymap for vitamins included * Implemented changes
-rw-r--r--keyboards/vitamins_included/keymaps/numpad/config.h39
-rw-r--r--keyboards/vitamins_included/keymaps/numpad/keymap.c75
2 files changed, 114 insertions, 0 deletions
diff --git a/keyboards/vitamins_included/keymaps/numpad/config.h b/keyboards/vitamins_included/keymaps/numpad/config.h
new file mode 100644
index 000000000..aba9fa7d4
--- /dev/null
+++ b/keyboards/vitamins_included/keymaps/numpad/config.h
@@ -0,0 +1,39 @@
1/*
2This is the c configuration file for the keymap
3
4Copyright 2012 Jun Wako <wakojun@gmail.com>
5Copyright 2015 Jack Humbert
6
7This program is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#pragma once
22
23/* Use I2C or Serial, not both */
24
25#define USE_SERIAL
26// #define USE_I2C
27
28/* Select hand configuration */
29
30//#define MASTER_LEFT
31// #define MASTER_RIGHT
32#define EE_HANDS
33
34#ifdef AUDIO_ENABLE
35 #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
36 SONG(DVORAK_SOUND), \
37 SONG(COLEMAK_SOUND) \
38 }
39#endif
diff --git a/keyboards/vitamins_included/keymaps/numpad/keymap.c b/keyboards/vitamins_included/keymaps/numpad/keymap.c
new file mode 100644
index 000000000..1767851fe
--- /dev/null
+++ b/keyboards/vitamins_included/keymaps/numpad/keymap.c
@@ -0,0 +1,75 @@
1#include QMK_KEYBOARD_H
2
3extern keymap_config_t keymap_config;
4
5// Each layer gets a name for readability, which is then used in the keymap matrix below.
6// The underscores don't mean anything - you can have a layer called STUFF or any other name.
7// Layer names don't all need to be of the same length, obviously, and you can also skip them
8// entirely and just use numbers.
9#define _NUMPAD 0
10#define _ADJUST 3
11
12enum custom_keycodes {
13 NUMPAD = SAFE_RANGE,
14 ADJUST
15};
16
17const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
18
19/* Numpad
20 * ,-----------------------------------------------------------------------------------.
21 * | 0 | 1 | 4 | 7 | nlck | esc | 0 | 1 | 4 | 7 | nlck | esc |
22 * |------+------+------+------+------+-------------+------+------+------+------+------|
23 * | , | 2 | 5 | 8 | / | adj | , | 2 | 5 | 8 | / | adj |
24 * |------+------+------+------+------+------|------+------+------+------+------+------|
25 * | . | 3 | 6 | 9 | * | adj | . | 3 | 6 | 9 | * | adj |
26 * |------+------+------+------+------+------+------+------+------+------+------+------|
27 * | Enter| adj | - | + |bckspc| adj | Enter| adj | - | + |bckspc| adj |
28 * `-----------------------------------------------------------------------------------'
29 */
30[_NUMPAD] = LAYOUT_ortho_4x12( \
31 KC_KP_0, KC_KP_1, KC_KP_4, KC_KP_7, KC_NUMLOCK, KC_ESC, KC_KP_0, KC_KP_1, KC_KP_4, KC_KP_7, KC_NUMLOCK, KC_ESC, \
32 KC_KP_COMMA, KC_KP_2, KC_KP_5, KC_KP_8, KC_KP_SLASH, ADJUST, KC_KP_COMMA, KC_KP_2, KC_KP_5, KC_KP_8, KC_KP_SLASH, ADJUST, \
33 KC_KP_DOT, KC_KP_3, KC_KP_6, KC_KP_9, KC_KP_ASTERISK, ADJUST, KC_KP_DOT, KC_KP_3, KC_KP_6, KC_KP_9, KC_KP_ASTERISK, ADJUST , \
34 KC_KP_ENTER, ADJUST, KC_KP_MINUS, KC_KP_PLUS, KC_BSPACE, ADJUST, KC_KP_ENTER, ADJUST, KC_KP_MINUS, KC_KP_PLUS, KC_BSPACE, ADJUST \
35),
36
37/* Adjust (Lower + Raise)
38 * ,-----------------------------------------------------------------------------------.
39 * | | Reset| | | | | | | | | | Del |
40 * |------+------+------+------+------+-------------+------+------+------+------+------|
41 * | | | |Aud on|Audoff|AGnorm|AGswap| | | | | |
42 * |------+------+------+------+------+------|------+------+------+------+------+------|
43 * | | | | | | | | | | | | |
44 * |------+------+------+------+------+------+------+------+------+------+------+------|
45 * | | | | | | RESET RESET | | | | |RGB_MOD|
46 * `-----------------------------------------------------------------------------------'
47 */
48[_ADJUST] = LAYOUT_ortho_4x12( \
49 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
50 _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, \
51 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
52 _______, _______, _______, _______, _______, RESET, RESET, _______, _______, _______, _______, RGB_MOD \
53)
54
55
56};
57
58void persistent_default_layer_set(uint16_t default_layer) {
59 eeconfig_update_default_layer(default_layer);
60 default_layer_set(default_layer);
61}
62
63bool process_record_user(uint16_t keycode, keyrecord_t *record) {
64 switch (keycode) {
65 case ADJUST:
66 if (record->event.pressed) {
67 layer_on(_ADJUST);
68 } else {
69 layer_off(_ADJUST);
70 }
71 return false;
72 break;
73 }
74 return true;
75}