Updates to mtdjr userspace and keymaps (#3206)

* slight tweaks to xd75 keymap

* update to config.h to remove undef of solenoid active

* code organization for userspace

* updates to userspace and keymaps

* add rgb to userspace and lets split

* add conditional around rgb functions in userpsace

* move rgb layer changes into layer_state_set_user
pull/3208/head^2
mtdjr 7 years ago committed by Drashna Jaelre
parent f46b1db9f4
commit e8eaf5630c

@ -5,7 +5,6 @@
#define SOLENOID_ENABLE #define SOLENOID_ENABLE
#define SOLENOID_PIN F6 #define SOLENOID_PIN F6
#undef SOLENOID_ACTIVE
#define SOLENOID_ACTIVE true #define SOLENOID_ACTIVE true
#endif #endif

@ -20,8 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "config_common.h" #include "config_common.h"
#define SOLENOID_ENABLE //#define SOLENOID_ENABLE
#define SOLENOID_PIN C6 //#define SOLENOID_PIN C6
/* Use I2C or Serial, not both */ /* Use I2C or Serial, not both */
@ -32,6 +32,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MASTER_LEFT #define MASTER_LEFT
// #define AUDIO_CLICKY
// #define AUDIO_CLICKY_ON
// #define C6_AUDIO
// #define AUDIO_CLICKY_FREQ_RANDOMNESS 0.1f
// #define AUDIO_CLICKY_FREQ_MAX 100.0f
// #define MASTER_RIGHT // #define MASTER_RIGHT
// #define EE_HANDS // #define EE_HANDS

@ -1,6 +1,6 @@
RGBLIGHT_ENABLE = no RGBLIGHT_ENABLE = no
BACKLIGHT_ENABLE = no BACKLIGHT_ENABLE = no
#AUDIO_ENABLE = yes
ifndef QUANTUM_DIR ifndef QUANTUM_DIR
include ../../../../Makefile include ../../../../Makefile
endif endif

@ -26,14 +26,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define SOLENOID_ENABLE #define SOLENOID_ENABLE
#define SOLENOID_PIN F4 #define SOLENOID_PIN F4
#undef RGBLED_NUM
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 8
/* Use I2C or Serial, not both */ /* Use I2C or Serial, not both */
// #define USE_SERIAL #define USE_SERIAL
#define USE_I2C // #define USE_I2C
/* Select hand configuration */ /* Select hand configuration */
// #define MASTER_LEFT #define MASTER_LEFT
// #define _MASTER_RIGHT // #define _MASTER_RIGHT
#define EE_HANDS // #define EE_HANDS
#endif #endif

@ -3,79 +3,53 @@
extern keymap_config_t keymap_config; extern keymap_config_t keymap_config;
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty [_QWERTY] = LAYOUT_kc(
* ,-----------------------------------------. ,-----------------------------------------. // ,-----------------------------. .-----------------------------.
* | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | TAB, Q , W , E , R , T , Y , U , I , O , P ,BSPC,
* |------+------+------+------+------+------| |------+------+------+------+------+------| // |----+----+----+----+----+----| |----+----+----+----+----+----|
* |Esc/~ | A | S | D | F | G | | H | J | K | L | ; | '/" | EXC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT,
* |------+------+------+------+------+------| |------+------+------+------+------+------| // |----+----+----+----+----+----| |----+----+----+----+----+----|
* | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | LSFT, Z , X , C , V , B , N , M ,COMM, DOT,SLSH, ENT,
* |------+------+------+------+------+------| |------+------+------+------+------+------| // |----+----+----+----+----+----| |----+----+----+----+----+----|
* |Adjust| Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Up | Down |Right | LOWR,LCTL,LALT,LGUI,LOWR, SPC, SPC,RASE,LEFT,DOWN, UP ,RGHT
* `-----------------------------------------' '-----------------------------------------' // '-----------------------------' '-----------------------------'
*/
[_QWERTY] = LAYOUT( \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
KC_EXC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT \
), ),
/* Lower [_LOWER] = LAYOUT_kc(
* ,-----------------------------------------. ,-----------------------------------------. // ,-----------------------------. .-----------------------------.
* | ~ | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | TILD, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , DEL,
* |------+------+------+------+------+------| |------+------+------+------+------+------| // |----+----+----+----+----+----| |----+----+----+----+----+----|
* | | | [ | ] | { | } | | | 4 | 5 | 6 | * | \ | xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,LBRC,RBRC,BSLS,
* |------+------+------+------+------+------| |------+------+------+------+------+------| // |----+----+----+----+----+----| |----+----+----+----+----+----|
* |Shift | | | copy |insert| | | | 1 | 2 | 3 | + | - | ,UNDO, CUT,XCPY,XINS,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx, ,
* |------+------+------+------+------+------| |------+------+------+------+------+------| // |----+----+----+----+----+----| |----+----+----+----+----+----|
* |Adjust| Ctrl | Alt | GUI |Lower |Space | |Space |Raise | 0 | . | = | _ | , , , , , , , , , , ,
* `-----------------------------------------' '-----------------------------------------' // '-----------------------------' '-----------------------------'
*/
[_LOWER] = LAYOUT( \
KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \
XXXXXXX, XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, XXXXXXX, KC_4, KC_5, KC_6, KC_ASTR, KC_BSLS, \
_______, XXXXXXX, XXXXXXX, KC_XCPY, KC_XINS, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, KC_PLUS, KC_MINS, \
_______, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_EQL, KC_UNDS \
), ),
[_RAISE] = LAYOUT_kc(
/* Raise // ,-----------------------------. .-----------------------------.
* ,-----------------------------------------. ,-----------------------------------------. GRV,EXLM, AT ,HASH, DLR,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, ,
* | ` | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Bksp | // |----+----+----+----+----+----| |----+----+----+----+----+----|
* |------+------+------+------+------+------| |------+------+------+------+------+------| xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, MINS, EQL,xxxx,LCBR,RCBR,PIPE,
* | | | | | | | | | | | | \ | | | // |----+----+----+----+----+----| |----+----+----+----+----+----|
* |------+------+------+------+------+------| |------+------+------+------+------+------| ,xxxx,xxxx,xxxx,xxxx,xxxx, UNDS,PLUS,xxxx,xxxx,xxxx, ,
* |Shift | | | | | | | | | | | | | // |----+----+----+----+----+----| |----+----+----+----+----+----|
* |------+------+------+------+------+------| |------+------+------+------+------+------| , , , , , , , ,MNXT,VOLD,VOLU,MPLY
* |Adjust| Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Next | Vol- | Vol+ | Play | // '-----------------------------' '-----------------------------'
* `-----------------------------------------' '-----------------------------------------'
*/
[_RAISE] = LAYOUT( \
KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS, KC_PIPE,\
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
), ),
/* Adjust (Lower + Raise) [_ADJUST] = LAYOUT_kc( \
* ,-----------------------------------------. ,-----------------------------------------. // ,-----------------------------. .-----------------------------.
* | | Reset| | | | | | ROOT | PPLY | PSEF | | | Del | xxxx,ROOT,PPLY,PSEF,xxxx,xxxx, RST,STOG,xxxx,xxxx,xxxx, DEL,
* |------+------+------+------+------+------| |------+------+------+------+------+------| // |----+----+----+----+----+----| |----+----+----+----+----+----|
* | | | |Aud on|Audoff| | | F1 | F2 | F3 | F4 | F5 | F6 | RGB,RHUI,RSAI,RVAI, MOD,xxxx, F1 , F2 , F3 , F4 , F5 , F6 ,
* |------+------+------+------+------+------| |------+------+------+------+------+------| // |----+----+----+----+----+----| |----+----+----+----+----+----|
* | | UNDO | CUT | COPY |PASTE | | | F7 | F8 | F9 | F10 | F11 | F12 | RBTH,RHUD,RSAD,RVAD,RMOD,xxxx, F7 , F8 , F9 , F10, F11, F12,
* |------+------+------+------+------+------| |------+------+------+------+------+------| // |----+----+----+----+----+----| |----+----+----+----+----+----|
* | | | | | | | | | | Home | | | End | ,xxxx,xxxx,xxxx, ,xxxx, xxxx, ,xxxx,xxxx,xxxx,xxxx
* `-----------------------------------------' '-----------------------------------------' // '-----------------------------' '-----------------------------'
*/
[_ADJUST] = LAYOUT( \
KC_STOG, KC_ROOT, KC_PPLY, KC_PSEF, _______, _______, RESET, _______, _______, _______, _______, KC_DEL, \
_______, _______, _______, AU_ON, AU_OFF, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, \
_______, KC_UNDO, KC_CUT, KC_XCPY, KC_XINS, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \
_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, _______, _______, KC_END \
) )
}; };

@ -1,3 +1,5 @@
ifndef QUANTUM_DIR ifndef QUANTUM_DIR
include ../../../../Makefile include ../../../../Makefile
endif endif
RGBLIGHT_ENABLE = yes

@ -1,35 +1,33 @@
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H
#include "mtdjr.h" #include "mtdjr.h"
#define KC_LOCK TD(TD_ENDLOCK)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = KC_KEYMAP( [_QWERTY] = KC_KEYMAP(
// .--------------------------------------------------------------------------. // .--------------------------------------------------------------------------.
EXC, 1 , 2 , 3 , 4 , 5 ,PGUP,xxxx,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,xxxx, SPC, SPC,RASE,SPC, SPC,xxxx,LEFT,DOWN,UP ,RGHT LOWR,LCTL,LALT,LGUI,xxxx, SPC,LOWR,RASE,xxxx, SPC, APP,LEFT,DOWN, UP,RGHT
// '----+----+----+----+----+----+----+----+----+----+----+----+----+----+----' // '----+----+----+----+----+----+----+----+----+----+----+----+----+----+----'
), ),
[_LOWER] = KC_KEYMAP( [_LOWER] = KC_KEYMAP(
// .--------------------------------------------------------------------------. // .--------------------------------------------------------------------------.
xxxx, F1, F2, F3, F4, F5, F6,xxxx, F7, F8, F9, F10, F11, F12, DEL, xxxx, F1 , F2 , F3 , F4 , F5 , F6 ,xxxx, F7 , F8 , F9 , F10, F11, F12, DEL,
// |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----| // |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
xxxx,ROOT,PPLY,PSEF,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,ROOT,PPLY,PSEF,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,
// |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----| // |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
xxxx,xxxx,xxxx,xxxx,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,
// |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----| // |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,MUTE, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,MUTE,
// |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----| // |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, ,xxxx,MPLY,xxxx,MPRV,VOLD,VOLU,MNXT ,xxxx,xxxx,xxxx,xxxx,xxxx, , ,xxxx,MPLY,xxxx,MNXT,VOLD,VOLU,MNXT
// '----+----+----+----+----+----+----+----+----+----+----+----+----+----+----' // '----+----+----+----+----+----+----+----+----+----+----+----+----+----+----'
), ),
@ -39,11 +37,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----| // |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
xxxx,xxxx,xxxx,xxxx, RST,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx, RST,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,
// |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----| // |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
CAPS,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, BLI,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, CAPS,xxxx,xxxx,xxxx,xxxx,xxxx, BLI,xxxx, BLD,xxxx,xxxx,xxxx,XLCK,xxxx,xxxx,
// |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----| // |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
RGB,RHUI,RHUD,RSAI,RSAD,RVAI,RVAD, BLD,xxxx,xxxx,xxxx,xxxx,BTN1,BTN2,xxxx, RGB,RHUI,RHUD,RSAI,RSAD,RVAI,RVAD,xxxx,xxxx,xxxx,xxxx,xxxx,BTN1,MS_U,BTN2,
// |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----| // |----+----+----+----+----+----+----+----+----+----+----+----+----+----+----|
,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, ,xxxx,xxxx,xxxx,MS_L,MS_D,MS_U,MS_R ,xxxx,xxxx,xxxx,xxxx,xxxx, , ,xxxx,xxxx,xxxx,xxxx,MS_L,MS_D,MS_R
// '----+----+----+----+----+----+----+----+----+----+----+----+----+----+----' // '----+----+----+----+----+----+----+----+----+----+----+----+----+----+----'
) )
}; };

@ -2,20 +2,58 @@
#ifdef SOLENOID_ENABLE #ifdef SOLENOID_ENABLE
#include "solenoid.h" #include "solenoid.h"
#endif
void solenoid_buzz_on(void); #ifndef RGB_MODE
void solenoid_buzz_off(void); #define RGB_MODE 16
void solenoid_dwell_minus(void); #endif
void solenoid_dwell_plus(void); #ifndef RGB_HUE
void solenoid_toggle(void); #define RGB_HUE 285
void solenoid_stop(void);
void solenoid_fire(void);
void solenoid_check(void);
void solenoid_setup(void);
void matrix_init_user(void);
void matrix_scan_user(void);
#endif #endif
// Tap Dance Definitions
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, KC_ESC),
[TD_ALTLOCK] = ACTION_TAP_DANCE_DOUBLE(KC_RALT, LGUI(KC_L)),
[TD_ENDLOCK] = ACTION_TAP_DANCE_DOUBLE(KC_END, LGUI(KC_L)),
[TD_PRINT] = ACTION_TAP_DANCE_DOUBLE(LGUI(LSFT(KC_3)), LGUI(LSFT(KC_4))),
};
// Macros
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
if (record->event.pressed) {
switch(id) {
case ROOT:
SEND_STRING("sudo su -\n");
return false; break;
case PPLY:
SEND_STRING("puppet apply /etc/puppetlabs/code/environments/production/manifests/site.pp\n");
return false; break;
case PSEF:
SEND_STRING("ps -ef | grep ");
return false; break;
}
}
return MACRO_NONE;
};
void matrix_init_user(void) {
#ifdef RGBLIGHT_ENABLE
rgblight_enable_noeeprom();
rgblight_mode_noeeprom(RGB_MODE);
rgblight_sethsv (RGB_HUE, 255, 255);
#endif
#ifdef SOLENOID_ENABLE
solenoid_setup();
#endif
}
void matrix_scan_user(void) {
#ifdef SOLENOID_ENABLE
solenoid_check();
#endif
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef SOLENOID_ENABLE #ifdef SOLENOID_ENABLE
if (record->event.pressed) { if (record->event.pressed) {
@ -71,7 +109,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) { if (record->event.pressed) {
solenoid_dwell_minus(); solenoid_dwell_minus();
} }
#endif #endif
break; break;
case SOLENOID_DWELL_PLUS: case SOLENOID_DWELL_PLUS:
#ifdef SOLENOID_ENABLE #ifdef SOLENOID_ENABLE
@ -85,53 +123,35 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) { if (record->event.pressed) {
solenoid_buzz_on(); solenoid_buzz_on();
} }
#endif #endif
break; break;
case SOLENOID_BUZZ_OFF: case SOLENOID_BUZZ_OFF:
#ifdef SOLENOID_ENABLE #ifdef SOLENOID_ENABLE
if (record->event.pressed) { if (record->event.pressed) {
solenoid_buzz_off(); solenoid_buzz_off();
} }
#endif #endif
break; break;
} }
return true; return true;
}; };
uint32_t layer_state_set_user(uint32_t state) {
//Tap Dance Definitions #ifdef RGBLIGHT_ENABLE
qk_tap_dance_action_t tap_dance_actions[] = { switch (biton32(state)) {
[TD_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, KC_ESC), case _RAISE:
[TD_ALTLOCK] = ACTION_TAP_DANCE_DOUBLE(KC_RALT, LGUI(KC_L)), rgblight_sethsv_noeeprom (240, 255, 255);
[TD_ENDLOCK] = ACTION_TAP_DANCE_DOUBLE(KC_END, LGUI(KC_L)), break;
//[TD_PRNT] = ACTION_TAP_DANCE_DOUBLE(PRINT, PRINT_SEL) case _LOWER:
}; rgblight_sethsv_noeeprom (0, 255, 255);
break;
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case _ADJUST:
if (record->event.pressed) { rgblight_sethsv_noeeprom (0, 0, 255);
switch(id) { break;
case 0: default:
SEND_STRING("sudo su -\n"); rgblight_sethsv_noeeprom (RGB_HUE, 255, 255);
return false; break; break;
case 1: }
SEND_STRING("puppet apply /etc/puppetlabs/code/environments/production/manifests/site.pp\n"); return state;
return false; break; }
case 2: #endif
SEND_STRING("ps -ef | grep ");
return false; break;
case 3: // control + insert
return MACRO(D(LCTL), T(INS), U(LCTL), END);
break;
case 4: // shift + insert
return MACRO(D(LSFT), T(INS), U(LSFT), END);
break;
case 5: // control + alt + delete
return MACRO(D(LCTL), D(RALT), T(DEL), U(LCTL), U(LALT), END);
break;
case 6: // lgui + L
return MACRO(D(LGUI), T(L), U(LGUI), END);
break;
}
}
return MACRO_NONE;
};

@ -3,61 +3,79 @@
#include "quantum.h" #include "quantum.h"
#define _QWERTY 0 // Layers
#define _LOWER 1 enum user_enum {
#define _RAISE 2 // Layers
#define _SUPER 3
#define _ADJUST 16
enum user_layers {
QWERTY = SAFE_RANGE, QWERTY = SAFE_RANGE,
LOWER, LOWER,
RAISE, RAISE,
SUPER, SUPER,
ADJUST, ADJUST,
// Solenoid
SOLENOID_TOG,
SOLENOID_DWELL_MINUS,
SOLENOID_DWELL_PLUS,
SOLENOID_BUZZ_ON,
SOLENOID_BUZZ_OFF,
}; };
// Macro / Send String
enum user_macros {
ROOT,
PPLY,
PSEF,
};
// TapDance
enum user_tapdance { enum user_tapdance {
TD_ENDLOCK, TD_ENDLOCK,
TD_ALTLOCK, TD_ALTLOCK,
TD_PRINT,
TD_ESC, TD_ESC,
}; };
enum user_solenoid {
SOLENOID_TOG,
SOLENOID_DWELL_MINUS,
SOLENOID_DWELL_PLUS,
SOLENOID_BUZZ_ON,
SOLENOID_BUZZ_OFF,
};
#define KC_STOG SOLENOID_TOG // Layers
#define KC_SDM SOLENOID_DWELL_MINUS #define _QWERTY 0
#define KC_SDP SOLENOID_DWELL_PLUS #define _LOWER 1
#define KC_SBON SOLENOID_BUZZ_ON #define _RAISE 2
#define KC_SBOF SOLENOID_BUZZ_OFF #define _SUPER 3
#define _ADJUST 16
// Macros
#define KC_ROOT M(ROOT)
#define KC_PPLY M(PPLY)
#define KC_PSEF M(PSEF)
// Tapdance
#define KC_EXC TD(TD_ESC)
#define KC_ELCK TD(TD_ENDLOCK)
#define KC_ALCK TD(TD_ALTLOCK)
#define KC_MPNT TD(TD_PRINT)
// Custom Keycodes
#define KC_ KC_TRNS #define KC_ KC_TRNS
#define _______ KC_TRNS #define _______ KC_TRNS
#define XXXXXXX KC_NO #define XXXXXXX KC_NO
#define KC_xxxx KC_NO #define KC_xxxx KC_NO
#define KC_LOWR LOWER #define KC_LOWR LOWER
#define KC_RASE RAISE #define KC_RASE RAISE
#define KC_SUPR SUPER #define KC_SUPR SUPER
#define KC_RST RESET #define KC_RST RESET
// TapDance Keycodes // Key Combos
#define KC_EXC TD_ESC #define KC_XCPY LCTL(KC_INS)
#define KC_XINS LSFT(KC_INS)
#define KC_CAD LCTL(LALT(KC_DEL))
#define KC_XCAD LCTL(LALT(KC_DEL))
#define KC_XLCK LGUI(KC_L)
// Macro Declarations // Solenoid
#define KC_ROOT M(0) #define KC_STOG SOLENOID_TOG
#define KC_PPLY M(1) #define KC_SDM SOLENOID_DWELL_MINUS
#define KC_PSEF M(2) #define KC_SDP SOLENOID_DWELL_PLUS
#define KC_XCPY M(3) #define KC_SBON SOLENOID_BUZZ_ON
#define KC_XINS M(4) #define KC_SBOF SOLENOID_BUZZ_OFF
#define KC_CAD M(5)
#define UM_LOCK M(6)
// RGB and Backlighting // RGB and Backlighting
#define KC_RGB RGB_TOG #define KC_RGB RGB_TOG
@ -67,10 +85,17 @@ enum user_solenoid {
#define KC_RSAD RGB_SAD #define KC_RSAD RGB_SAD
#define KC_RVAI RGB_VAI #define KC_RVAI RGB_VAI
#define KC_RVAD RGB_VAD #define KC_RVAD RGB_VAD
#define KC_MOD RGB_MOD
#define KC_RMOD RGB_RMOD
#define KC_RPLN RGB_M_P
#define KC_RBTH RGB_M_B
#define KC_BLT BL_TOGG #define KC_BLT BL_TOGG
#define KC_BLS BL_STEP #define KC_BLS BL_STEP
#define KC_BLI BL_INC #define KC_BLI BL_INC
#define KC_BLD BL_DEC #define KC_BLD BL_DEC
#define KC_BLB BL_BRTG
#define KC_BLON BL_ON
#define KB_BLOF BL_OFF
#endif #endif

@ -4,13 +4,17 @@
#include <timer.h> #include <timer.h>
#include "pincontrol.h" #include "pincontrol.h"
#define SOLENOID_DEFAULT_DWELL 12 #define SOLENOID_DEFAULT_DWELL 12
#define SOLENOID_MAX_DWELL 100 #define SOLENOID_MAX_DWELL 100
#define SOLENOID_MIN_DWELL 4 #define SOLENOID_MIN_DWELL 4
#ifndef SOLENOID_ACTIVE #ifndef SOLENOID_ACTIVE
#define SOLENOID_ACTIVE false #define SOLENOID_ACTIVE false
#endif #endif
//#define SOLENOID_PIN F6 #ifndef SOLENOID_PIN
#define SOLENOID_PIN F6
#endif
bool solenoid_enabled = SOLENOID_ACTIVE; bool solenoid_enabled = SOLENOID_ACTIVE;
bool solenoid_on = false; bool solenoid_on = false;
@ -92,12 +96,4 @@ void solenoid_setup(void) {
pinMode(SOLENOID_PIN, PinDirectionOutput); pinMode(SOLENOID_PIN, PinDirectionOutput);
} }
void matrix_init_user(void) {
solenoid_setup();
}
void matrix_scan_user(void) {
solenoid_check();
}
#endif #endif

Loading…
Cancel
Save