aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt W <hellmitre@gmail.com>2021-03-25 04:55:01 -0700
committerGitHub <noreply@github.com>2021-03-25 22:55:01 +1100
commit2cd684f8e0385d97f09a2d08cd9c5f8b2e77845a (patch)
tree1bf0c853b46b9102281c667f81a4b135c8555254
parentc4d05010cb4dad42740d67003bf66b67e10fe854 (diff)
downloadqmk_firmware-2cd684f8e0385d97f09a2d08cd9c5f8b2e77845a.tar.gz
qmk_firmware-2cd684f8e0385d97f09a2d08cd9c5f8b2e77845a.zip
add massdrop/alt/hlmtre keymap, add .exe to gitignore (#12191)
* add massdrop/alt/hlmtre keymap, add .exe to gitignore * changes request in PR (license header and fix gitignore) Co-authored-by: Matt Weller <matthew.weller@nvih.org>
-rw-r--r--keyboards/massdrop/alt/keymaps/hlmtre/keymap.c131
1 files changed, 131 insertions, 0 deletions
diff --git a/keyboards/massdrop/alt/keymaps/hlmtre/keymap.c b/keyboards/massdrop/alt/keymaps/hlmtre/keymap.c
new file mode 100644
index 000000000..5c2111ccd
--- /dev/null
+++ b/keyboards/massdrop/alt/keymaps/hlmtre/keymap.c
@@ -0,0 +1,131 @@
1/* Copyright 2021 hlmtre
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
17#include QMK_KEYBOARD_H
18
19enum alt_keycodes {
20 U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active
21 U_T_AGCR, //USB Toggle Automatic GCR control
22 DBG_TOG, //DEBUG Toggle On / Off
23 DBG_MTRX, //DEBUG Toggle Matrix Prints
24 DBG_KBD, //DEBUG Toggle Keyboard Prints
25 DBG_MOU, //DEBUG Toggle Mouse Prints
26 MD_BOOT, //Restart into bootloader after hold timeout
27};
28
29const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
30 [0] = LAYOUT_65_ansi_blocker(
31 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \
32 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_HOME, \
33 MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \
34 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \
35 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \
36 ),
37 [1] = LAYOUT_65_ansi_blocker(
38 KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_MUTE, \
39 _______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO, KC_INS, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \
40 _______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \
41 _______, RGB_TOG, _______, _______, _______, MD_BOOT, NK_TOGG, DBG_TOG, _______, _______, _______, _______, KC_VOLU, KC_VOLD, \
42 _______, _______, _______, KC_MPLY, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT \
43 ),
44 /*
45 [X] = LAYOUT(
46 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
47 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
48 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
49 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
50 _______, _______, _______, _______, _______, _______, _______, _______, _______ \
51 ),
52 */
53};
54
55#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT))
56#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL))
57#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT))
58
59bool process_record_user(uint16_t keycode, keyrecord_t *record) {
60 static uint32_t key_timer;
61
62 switch (keycode) {
63 case U_T_AUTO:
64 if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
65 TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode");
66 }
67 return false;
68 case U_T_AGCR:
69 if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
70 TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode");
71 }
72 return false;
73 case DBG_TOG:
74 if (record->event.pressed) {
75 TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode");
76 }
77 return false;
78 case DBG_MTRX:
79 if (record->event.pressed) {
80 TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix");
81 }
82 return false;
83 case DBG_KBD:
84 if (record->event.pressed) {
85 TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard");
86 }
87 return false;
88 case DBG_MOU:
89 if (record->event.pressed) {
90 TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse");
91 }
92 return false;
93 case MD_BOOT:
94 if (record->event.pressed) {
95 key_timer = timer_read32();
96 } else {
97 if (timer_elapsed32(key_timer) >= 500) {
98 reset_keyboard();
99 }
100 }
101 return false;
102 case RGB_TOG:
103 if (record->event.pressed) {
104 switch (rgb_matrix_get_flags()) {
105 case LED_FLAG_ALL: {
106 rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
107 rgb_matrix_set_color_all(0, 0, 0);
108 }
109 break;
110 case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): {
111 rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
112 rgb_matrix_set_color_all(0, 0, 0);
113 }
114 break;
115 case LED_FLAG_UNDERGLOW: {
116 rgb_matrix_set_flags(LED_FLAG_NONE);
117 rgb_matrix_disable_noeeprom();
118 }
119 break;
120 default: {
121 rgb_matrix_set_flags(LED_FLAG_ALL);
122 rgb_matrix_enable_noeeprom();
123 }
124 break;
125 }
126 }
127 return false;
128 default:
129 return true; //Process all other keycodes normally
130 }
131}