]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/xd75/keymaps/mtdjr/keymap.c
Add mtdjr keymaps for Iris, Let's Split, TADA68, XD75, and handwired dox (#3058)
[qmk_firmware.git] / keyboards / xd75 / keymaps / mtdjr / keymap.c
1 /* Copyright 2017 Wunder
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 "xd75.h"
17 #include "action_layer.h"
18
19
20 enum custom_keycodes {
21   // TD_ESC = 0,
22   TD_LOCK = 0,
23 };
24
25 // Layers
26 #define _QWERTY 0
27 #define _LOWER  1
28 #define _RAISE  2
29
30
31
32 // Shortcuts
33 #define KC_____ KC_NO
34 #define KC_     KC_TRNS
35 #define KC_RST  RESET
36 #define KC_RASE MO(_RAISE)
37 #define KC_LOWR MO(_LOWER)
38
39 // RGB and Backlighting
40 #define KC_RGB  RGB_TOG
41 #define KC_RHUI RGB_HUI
42 #define KC_RHUD RGB_HUD
43 #define KC_RSAI RGB_SAI
44 #define KC_RSAD RGB_SAD
45 #define KC_RVAI RGB_VAI
46 #define KC_RVAD RGB_VAD
47 #define KC_BLT  BL_TOGG
48 #define KC_BLS  BL_STEP
49 #define KC_BLI  BL_INC
50 #define KC_BLD  BL_DEC
51
52 // Tapdance
53 //#define KC_EXC TD(TD_ESC)
54 #define KC_LOCK TD(TD_LOCK)
55
56 // Macros
57 #define KC_ROOT M(0)
58 #define KC_PPLY M(1)
59 #define KC_PSEF M(2)
60
61 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
62
63  [_QWERTY] = KC_KEYMAP(
64 //  .--------------------------------------------------------------------------.
65       ESC, 1  , 2  , 3  , 4  , 5  ,PGUP,PSCR,PGDN, 6  , 7  , 8  , 9  , 0  ,BSPC,
66 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
67       TAB, Q  , W  ,  E , R  , T  , INS,BSLS, DEL, Y  , U  , I  , O  , P  ,QUOT,
68 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
69      LCTL, A  , S  ,  D , F  , G  ,HOME,PLUS,LOCK, H  , J  , K  , L  ,SCLN, ENT,
70 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
71      LSFT, Z  , X  ,  C , V  , B  ,LBRC,MINS,RBRC, N  , M  ,COMM, DOT,SLSH,RSFT,
72 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
73      LOWR,LCTL,LALT,LGUI,____, SPC,RASE, GRV,LOWR, SPC,____,LEFT,DOWN,UP  ,RGHT
74 //  '----+----+----+----+----+----+----+----+----+----+----+----+----+----+----'
75 ),
76
77  [_LOWER] = KC_KEYMAP(
78 //  .--------------------------------------------------------------------------.
79      ____,  F1,  F2,  F3,  F4,  F5,  F6,____,  F7,  F8,  F9, F10, F11, F12,____,
80 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
81      ____,ROOT,PPLY,PSEF,____,____,____,____,____,____,____,____,____,____,____,
82 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
83      ____,____,____,____,____,____,____,____,____,____,____,____,____,____,____,
84 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
85      ____,____,____,____,____,____,____,____,____,____,____,____,____,____,MUTE,
86 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
87          ,____,____,____,____,____,    ,____,    ,MPLY,____,MPRV,VOLD,VOLU,MNXT
88 //  '----+----+----+----+----+----+----+----+----+----+----+----+----+----+----'
89 ),
90
91 [_RAISE] = KC_KEYMAP(
92 //  .--------------------------------------------------------------------------.
93      ____,____,____,____,____,____,____,____,____,____,____,____,____,____,____,
94 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
95      ____,____,____,____, RST,____,____,____,____,____,____,____,____,____,____,
96 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
97      CAPS,____,____,____,____,____,____, BLI,____,____,____,____,____,____,____,
98 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
99       RGB,RHUI,RHUD,RSAI,RSAD,RVAI,RVAD, BLD,____,____,____,____,BTN1,BTN2,____,
100 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
101          ,____,____,____,____,____,    ,____,    ,____,____,MS_L,MS_D,MS_U,MS_R
102 //  '----+----+----+----+----+----+----+----+----+----+----+----+----+----+----'
103 )
104 };
105
106 qk_tap_dance_action_t tap_dance_actions[] = {
107   //Tap once for left ctrl, twice for ESC
108   //[TD_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_LCTL, KC_ESC),
109   [TD_LOCK] = ACTION_TAP_DANCE_DOUBLE(KC_END, LGUI(KC_L))
110 };
111 void led_set_user(uint8_t usb_led) {
112     if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
113         capslock_led_on();
114     } else {
115         capslock_led_off();
116     }
117 }
118
119
120 const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
121   if (record->event.pressed) {
122     switch(id) {
123       case 0:
124           SEND_STRING("sudo su -\n");
125           return false; break;
126       case 1:
127           SEND_STRING("puppet apply /etc/puppetlabs/code/environments/production/manifests/site.pp\n");
128           return false; break;
129       case 2:
130           SEND_STRING("ps -ef | grep ");
131           return false; break;
132     }
133   }
134   return MACRO_NONE;
135 };