]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - keyboards/xd75/keymaps/mtdjr/keymap.c
[Keyboard] XD75 refactor (#5420)
[qmk_firmware.git] / keyboards / xd75 / keymaps / mtdjr / keymap.c
index 696c82ae4fc67d8b898557f079fabb9ceccd8254..e56d918fd5f423eccc8ce4d4663ae81efc01c1ba 100644 (file)
-/* Copyright 2017 Wunder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-#include "xd75.h"
-#include "action_layer.h"
-
-
-enum custom_keycodes {
-  // TD_ESC = 0,
-  TD_LOCK = 0,
-};
-
-// Layers
-#define _QWERTY 0
-#define _LOWER  1
-#define _RAISE  2
-
-
-
-// Shortcuts
-#define KC_____ KC_NO
-#define KC_     KC_TRNS
-#define KC_RST  RESET
-#define KC_RASE MO(_RAISE)
-#define KC_LOWR MO(_LOWER)
-
-// RGB and Backlighting
-#define KC_RGB  RGB_TOG
-#define KC_RHUI RGB_HUI
-#define KC_RHUD RGB_HUD
-#define KC_RSAI RGB_SAI
-#define KC_RSAD RGB_SAD
-#define KC_RVAI RGB_VAI
-#define KC_RVAD RGB_VAD
-#define KC_BLT  BL_TOGG
-#define KC_BLS  BL_STEP
-#define KC_BLI  BL_INC
-#define KC_BLD  BL_DEC
-
-// Tapdance
-//#define KC_EXC TD(TD_ESC)
-#define KC_LOCK TD(TD_LOCK)
-
-// Macros
-#define KC_ROOT M(0)
-#define KC_PPLY M(1)
-#define KC_PSEF M(2)
+#include QMK_KEYBOARD_H
+#include "mtdjr.h"
 
 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 
- [_QWERTY] = KC_KEYMAP(
+ [_QWERTY] = LAYOUT_kc(
 //  .--------------------------------------------------------------------------.
-      ESC, 1  , 2  , 3  , 4  , 5  ,PGUP,PSCR,PGDN, 6  , 7  , 8  , 9  , 0  ,BSPC,
+      EXC, 1  , 2  , 3  , 4  , 5  ,PGUP,MPNT,PGDN, 6  , 7  , 8  , 9  , 0  ,BSPC,
 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
-      TAB, Q  , W  ,  E , R  , T  , INS,BSLS, DEL, Y  , U  , I  , O  , P  ,QUOT,
+      TAB, Q  , W  ,  E , R  , T  , INS,HOME, DEL, Y  , U  , I  , O  , P  ,QUOT,
 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
-     LCTL, A  , S  ,  D , F  , G  ,HOME,PLUS,LOCK, H  , J  , K  , L  ,SCLN, ENT,
+     LCTL, A  , S  ,  D , F  , G  , EQL,ELCK,MINS, H  , J  , K  , L  ,SCLN, ENT,
 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
-     LSFT, Z  , X  ,  C , V  , B  ,LBRC,MINS,RBRC, N  , M  ,COMM, DOT,SLSH,RSFT,
+     LSFT, Z  , X  ,  C , V  , B  ,LBRC,BSLS,RBRC, N  , M  ,COMM, DOT,SLSH,ELCK,
 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
-     LOWR,LCTL,LALT,LGUI,____, SPC,RASE, GRV,LOWR, SPC,____,LEFT,DOWN,UP  ,RGHT
+     LOWR,LCTL,LALT,LGUI,xxxx, SPC,LOWR,RASE,xxxx, SPC, APP,LEFT,DOWN,  UP,RGHT
 //  '----+----+----+----+----+----+----+----+----+----+----+----+----+----+----'
 ),
 
- [_LOWER] = KC_KEYMAP(
+ [_LOWER] = LAYOUT_kc(
 //  .--------------------------------------------------------------------------.
-     ____,  F1,  F2,  F3,  F4,  F5,  F6,____,  F7,  F8,  F9, F10, F11, F12,____,
+     xxxx, F1 , F2 , F3 , F4 , F5 , F6 ,xxxx, F7 , F8 , F9 , F10, F11, F12, DEL,
 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
-     ____,ROOT,PPLY,PSEF,____,____,____,____,____,____,____,____,____,____,____,
+     xxxx,ROOT,PPLY,PSEF,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,
 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
-     ____,____,____,____,____,____,____,____,____,____,____,____,____,____,____,
+     xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,CALC,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,
 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
-     ____,____,____,____,____,____,____,____,____,____,____,____,____,____,MUTE,
+     xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,MUTE,
 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
-         ,____,____,____,____,____,    ,____,    ,MPLY,____,MPRV,VOLD,VOLU,MNXT
+         ,xxxx,xxxx,xxxx,xxxx,xxxx,    ,    ,xxxx,MPLY,xxxx,MNXT,VOLD,VOLU,MNXT
 //  '----+----+----+----+----+----+----+----+----+----+----+----+----+----+----'
 ),
 
-[_RAISE] = KC_KEYMAP(
+[_RAISE] = LAYOUT_kc(
 //  .--------------------------------------------------------------------------.
-     ____,____,____,____,____,____,____,____,____,____,____,____,____,____,____,
+     xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,
 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
-     ____,____,____,____, RST,____,____,____,____,____,____,____,____,____,____,
+     xxxx,xxxx,xxxx,xxxx, RST,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,
 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
-     CAPS,____,____,____,____,____,____, BLI,____,____,____,____,____,____,____,
+     CAPS,xxxx,xxxx,xxxx,xxxx,xxxx, BLI,xxxx, BLD,xxxx,xxxx,xxxx,XLCK,xxxx,xxxx,
 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
-      RGB,RHUI,RHUD,RSAI,RSAD,RVAI,RVAD, BLD,____,____,____,____,BTN1,BTN2,____,
+      RGB,RHUI,RHUD,RSAI,RSAD,RVAI,RVAD,xxxx,xxxx,xxxx,xxxx,xxxx,BTN1,MS_U,BTN2,
 //  |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
-         ,____,____,____,____,____,    ,____,    ,____,____,MS_L,MS_D,MS_U,MS_R
+         ,xxxx,xxxx,xxxx,xxxx,xxxx,    ,    ,xxxx,xxxx,xxxx,xxxx,MS_L,MS_D,MS_R
 //  '----+----+----+----+----+----+----+----+----+----+----+----+----+----+----'
 )
 };
 
-qk_tap_dance_action_t tap_dance_actions[] = {
-  //Tap once for left ctrl, twice for ESC
-  //[TD_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_LCTL, KC_ESC),
-  [TD_LOCK] = ACTION_TAP_DANCE_DOUBLE(KC_END, LGUI(KC_L))
-};
 void led_set_user(uint8_t usb_led) {
     if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
         capslock_led_on();
@@ -115,21 +53,3 @@ void led_set_user(uint8_t usb_led) {
         capslock_led_off();
     }
 }
-
-
-const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
-  if (record->event.pressed) {
-    switch(id) {
-      case 0:
-          SEND_STRING("sudo su -\n");
-          return false; break;
-      case 1:
-          SEND_STRING("puppet apply /etc/puppetlabs/code/environments/production/manifests/site.pp\n");
-          return false; break;
-      case 2:
-          SEND_STRING("ps -ef | grep ");
-          return false; break;
-    }
-  }
-  return MACRO_NONE;
-};