diff options
Diffstat (limited to 'keyboards/dumbpad/keymaps/default/keymap.c')
| -rw-r--r-- | keyboards/dumbpad/keymaps/default/keymap.c | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/keyboards/dumbpad/keymaps/default/keymap.c b/keyboards/dumbpad/keymaps/default/keymap.c new file mode 100644 index 000000000..061215a61 --- /dev/null +++ b/keyboards/dumbpad/keymaps/default/keymap.c | |||
| @@ -0,0 +1,106 @@ | |||
| 1 | /* Copyright 2019 imchipwood | ||
| 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 | #define _BASE 0 | ||
| 19 | #define _SUB 1 | ||
| 20 | |||
| 21 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 22 | /* | ||
| 23 | BASE LAYER | ||
| 24 | /-----------------------------------------------------` | ||
| 25 | | | 7 | 8 | 9 | Bkspc | | ||
| 26 | | |---------|---------|---------|---------| | ||
| 27 | | | 4 | 5 | 6 | Esc | | ||
| 28 | | |---------|---------|---------|---------| | ||
| 29 | | | 1 | 2 | 3 | Tab | | ||
| 30 | |-------------|---------|---------|---------|---------| | ||
| 31 | | Left mouse | MO(SUB) | 0 | . | Enter | | ||
| 32 | \-----------------------------------------------------' | ||
| 33 | */ | ||
| 34 | [_BASE] = LAYOUT( /* Base */ | ||
| 35 | KC_7, KC_8, KC_9, KC_BSPC, | ||
| 36 | KC_4, KC_5, KC_6, KC_ESC, | ||
| 37 | KC_1, KC_2, KC_3, KC_TAB, | ||
| 38 | KC_BTN1, MO(_SUB), KC_0, KC_DOT, KC_ENTER | ||
| 39 | ), | ||
| 40 | /* | ||
| 41 | SUB LAYER | ||
| 42 | /-----------------------------------------------------` | ||
| 43 | | | | | | Reset | | ||
| 44 | | |---------|---------|---------|---------| | ||
| 45 | | | | | | + | | ||
| 46 | | |---------|---------|---------|---------| | ||
| 47 | | | | | | - | | ||
| 48 | |-------------|---------|---------|---------|---------| | ||
| 49 | | LOCK | | | | = | | ||
| 50 | \-----------------------------------------------------' | ||
| 51 | */ | ||
| 52 | [_SUB] = LAYOUT( | ||
| 53 | _______, _______, _______, RESET, | ||
| 54 | _______, _______, _______, KC_KP_PLUS, | ||
| 55 | _______, _______, _______, KC_KP_MINUS, | ||
| 56 | KC_LOCK, _______, _______, _______, KC_EQL | ||
| 57 | ), | ||
| 58 | }; | ||
| 59 | |||
| 60 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 61 | // If console is enabled, it will print the matrix position and status of each key pressed | ||
| 62 | /* | ||
| 63 | #ifdef CONSOLE_ENABLE | ||
| 64 | uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed); | ||
| 65 | #endif | ||
| 66 | */ | ||
| 67 | return true; | ||
| 68 | } | ||
| 69 | |||
| 70 | void keyboard_post_init_user(void) { | ||
| 71 | // Customise these values to desired behaviour | ||
| 72 | //debug_enable = true; | ||
| 73 | //debug_matrix = true; | ||
| 74 | //debug_keyboard = true; | ||
| 75 | //debug_mouse = true; | ||
| 76 | } | ||
| 77 | |||
| 78 | void matrix_init_user(void) { | ||
| 79 | |||
| 80 | } | ||
| 81 | |||
| 82 | void matrix_scan_user(void) { | ||
| 83 | |||
| 84 | } | ||
| 85 | |||
| 86 | void led_set_user(uint8_t usb_led) { | ||
| 87 | |||
| 88 | } | ||
| 89 | |||
| 90 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
| 91 | if (index == 0) { | ||
| 92 | if (layer_state && 0x1) { | ||
| 93 | if (clockwise) { | ||
| 94 | tap_code(KC_VOLU); | ||
| 95 | } else { | ||
| 96 | tap_code(KC_VOLD); | ||
| 97 | } | ||
| 98 | } else { | ||
| 99 | if (clockwise) { | ||
| 100 | tap_code(KC_MS_R); | ||
| 101 | } else { | ||
| 102 | tap_code(KC_MS_L); | ||
| 103 | } | ||
| 104 | } | ||
| 105 | } | ||
| 106 | } | ||
