aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGriffin J Rademacher <frdrckblrgnsnrf@gmail.com>2019-10-04 15:56:01 -0400
committernoroadsleft <18669334+noroadsleft@users.noreply.github.com>2019-10-04 12:56:01 -0700
commit93bce832555f0f34b2b9a681a7d5d0dbe4462a26 (patch)
tree91ee0f83a891a810b04836a9aad6f212006a9397
parentb0b433f3cf3d20ddcd10a2897646208c785e26c9 (diff)
downloadqmk_firmware-93bce832555f0f34b2b9a681a7d5d0dbe4462a26.tar.gz
qmk_firmware-93bce832555f0f34b2b9a681a7d5d0dbe4462a26.zip
[Keymap] :world_map: Adds massdrop/alt/favorable-mutation keymap (#6893)
Features: * Tap space for space, hold for cmd * Tap caps lock for esc, hold for ctrl * Dedicated key for entering default mode of yabai window manager * Who needs arrow keys, anyways??? * Method for clearing all stuck-down mods
-rw-r--r--keyboards/massdrop/alt/keymaps/favorable-mutation/README.md14
-rw-r--r--keyboards/massdrop/alt/keymaps/favorable-mutation/config.h28
-rw-r--r--keyboards/massdrop/alt/keymaps/favorable-mutation/keymap.c147
3 files changed, 189 insertions, 0 deletions
diff --git a/keyboards/massdrop/alt/keymaps/favorable-mutation/README.md b/keyboards/massdrop/alt/keymaps/favorable-mutation/README.md
new file mode 100644
index 000000000..9b0ad513b
--- /dev/null
+++ b/keyboards/massdrop/alt/keymaps/favorable-mutation/README.md
@@ -0,0 +1,14 @@
1### Massdrop Alt Layout
2
3This layout is for the [Massdrop Alt
4Keyboard](https://drop.com/buy/massdrop-alt-mechanical-keyboard)
5and targets MacOS machines.
6
7Some features:
8
9* Tap space for space, hold for cmd
10* Tap caps lock for esc, hold for ctrl
11* Dedicated key for entering default mode of [yabai window
12manager](https://github.com/koekeishiya/yabai)
13* Who needs arrow keys, anyways???
14* Method for clearing all stuck-down mods
diff --git a/keyboards/massdrop/alt/keymaps/favorable-mutation/config.h b/keyboards/massdrop/alt/keymaps/favorable-mutation/config.h
new file mode 100644
index 000000000..1893f2ba6
--- /dev/null
+++ b/keyboards/massdrop/alt/keymaps/favorable-mutation/config.h
@@ -0,0 +1,28 @@
1/*
2Copyright 2019 Griffin Rademacher <contact@griffin-rademacher.info>
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
18#pragma once
19
20// toggle one-shot layer keys after this many presses
21#define ONESHOT_TAP_TOGGLE 3
22
23// set time held before Mod-Tap key sends mod code
24#define TAPPING_TERM 1000
25
26// permissive hold: if holding down a Mod-Tap key while pressing another, it
27// acts as a mod, even within the tapping term
28#define PERMISSIVE_HOLD
diff --git a/keyboards/massdrop/alt/keymaps/favorable-mutation/keymap.c b/keyboards/massdrop/alt/keymaps/favorable-mutation/keymap.c
new file mode 100644
index 000000000..873d18449
--- /dev/null
+++ b/keyboards/massdrop/alt/keymaps/favorable-mutation/keymap.c
@@ -0,0 +1,147 @@
1#include QMK_KEYBOARD_H
2
3enum alt_keycodes {
4 U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active
5 U_T_AGCR, //USB Toggle Automatic GCR control
6 DBG_TOG, //DEBUG Toggle On / Off
7 DBG_MTRX, //DEBUG Toggle Matrix Prints
8 DBG_KBD, //DEBUG Toggle Keyboard Prints
9 DBG_MOU, //DEBUG Toggle Mouse Prints
10 MD_BOOT, //Restart into bootloader after hold timeout
11 HK_COSL, //Clear held-down keys
12};
13
14#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode
15#define CTL_ESC LCTL_T(KC_ESC)
16#define TP_LSFT OSM(MOD_LSFT)
17#define TP_RSFT OSM(MOD_RSFT)
18#define TP_LALT OSM(MOD_LALT)
19#define TP_RALT OSM(MOD_RALT)
20#define KC_YBAI LCTL(KC_SPC)
21#define GUI_SPC LGUI_T(KC_SPC)
22#define KC_SPOT LGUI(KC_SPC)
23
24//TODO default layer vim-like binds that work with WM, i to type??? this leads
25//to layers of vim modes - what's the best way to deal with that?
26//also need to deal with shift not working for other mods, add to shift layer
27//most likely
28//
29//TODO tap/toggle for layers
30
31keymap_config_t keymap_config;
32
33const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
34 [0] = LAYOUT(
35 KC_GRV, 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_SPOT,
36 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,
37 CTL_ESC, 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_MUTE,
38 TP_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_VOLU, KC_MPLY,
39 TP_LALT, TG(2), KC_YBAI, GUI_SPC, TP_RALT, TG(1), KC_MRWD, KC_VOLD, KC_MFFD
40 ),
41 [1] = LAYOUT(
42 KC_ESC, 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_DEL,
43 _______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO,U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_HOME,
44 _______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, KC_MRWD, KC_MFFD, _______, _______, _______, _______, KC_PGUP,
45 _______, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, DBG_TOG, _______, _______, _______, _______, KC_UP, KC_PGDN,
46 _______, _______, _______, HK_COSL, _______, TG(1), KC_LEFT, KC_DOWN, KC_RGHT
47 ),
48 /*
49 [X] = LAYOUT(
50 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
51 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
52 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
53 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
54 _______, _______, _______, _______, _______, _______, _______, _______, _______
55 ),
56 */
57};
58
59// Runs just one time when the keyboard initializes.
60void matrix_init_user(void) {
61};
62
63// Runs constantly in the background, in a loop.
64void matrix_scan_user(void) {
65};
66
67#define MODS_SHIFT (get_mods() & MOD_MASK_SHIFT)
68#define MODS_CTRL (get_mods() & MOD_MASK_CTRL)
69#define MODS_ALT (get_mods() & MOD_MASK_ALT)
70
71bool process_record_user(uint16_t keycode, keyrecord_t *record) {
72 static uint32_t key_timer;
73
74 switch (keycode) {
75 case HK_COSL:
76 clear_keyboard();
77 reset_oneshot_layer();
78 return true;
79 case U_T_AUTO:
80 if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
81 TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode");
82 }
83 return false;
84 case U_T_AGCR:
85 if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
86 TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode");
87 }
88 return false;
89 case DBG_TOG:
90 if (record->event.pressed) {
91 TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode");
92 }
93 return false;
94 case DBG_MTRX:
95 if (record->event.pressed) {
96 TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix");
97 }
98 return false;
99 case DBG_KBD:
100 if (record->event.pressed) {
101 TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard");
102 }
103 return false;
104 case DBG_MOU:
105 if (record->event.pressed) {
106 TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse");
107 }
108 return false;
109 case MD_BOOT:
110 if (record->event.pressed) {
111 key_timer = timer_read32();
112 } else {
113 if (timer_elapsed32(key_timer) >= 500) {
114 reset_keyboard();
115 }
116 }
117 return false;
118 case RGB_TOG:
119 if (record->event.pressed) {
120 switch (rgb_matrix_get_flags()) {
121 case LED_FLAG_ALL: {
122 rgb_matrix_set_flags(LED_FLAG_KEYLIGHT);
123 rgb_matrix_set_color_all(0, 0, 0);
124 }
125 break;
126 case LED_FLAG_KEYLIGHT: {
127 rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
128 rgb_matrix_set_color_all(0, 0, 0);
129 }
130 break;
131 case LED_FLAG_UNDERGLOW: {
132 rgb_matrix_set_flags(LED_FLAG_NONE);
133 rgb_matrix_disable_noeeprom();
134 }
135 break;
136 default: {
137 rgb_matrix_set_flags(LED_FLAG_ALL);
138 rgb_matrix_enable_noeeprom();
139 }
140 break;
141 }
142 }
143 return false;
144 default:
145 return true; //Process all other keycodes normally
146 }
147}