mirror of
https://github.com/qmk/qmk_userspace.git
synced 2025-05-17 04:45:29 -04:00
Further overloaded config keycode
- added bootloader and ploopy bootloader to TOG_CFG - added helper function for the bootloader - Cleaned up keymap
This commit is contained in:
parent
55f7ad027a
commit
64f7b27fa4
2 changed files with 28 additions and 18 deletions
|
@ -40,6 +40,21 @@ void set_default_layer(bool forward) {
|
||||||
set_single_persistent_default_layer(current_base_layer);
|
set_single_persistent_default_layer(current_base_layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// helper function to put ploopy nano into bootloader
|
||||||
|
// my ploopy nano will reset when num/caps/scroll lock is enabled
|
||||||
|
void reset_ploopynano(void) {
|
||||||
|
|
||||||
|
// turn on all three host states
|
||||||
|
if(!host_keyboard_led_state().num_lock) { tap_code(KC_NUM); }
|
||||||
|
if(!host_keyboard_led_state().caps_lock) { tap_code(KC_CAPS); }
|
||||||
|
if(!host_keyboard_led_state().scroll_lock) { tap_code(KC_SCRL); }
|
||||||
|
|
||||||
|
// then turn them off
|
||||||
|
tap_code(KC_NUM);
|
||||||
|
tap_code(KC_CAPS);
|
||||||
|
tap_code(KC_SCRL);
|
||||||
|
}
|
||||||
|
|
||||||
// Customize behavior for existing keycodes or create new ones
|
// Customize behavior for existing keycodes or create new ones
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
|
||||||
|
@ -47,20 +62,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
|
||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
|
|
||||||
// use the host state status to boot the Ploopy Nano
|
|
||||||
// will effectively turn on num lock/caps lock/scroll lock then back off
|
|
||||||
case PN_BOOT:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
if(!host_keyboard_led_state().num_lock) { tap_code(KC_NUM); }
|
|
||||||
if(!host_keyboard_led_state().caps_lock) { tap_code(KC_CAPS); }
|
|
||||||
if(!host_keyboard_led_state().scroll_lock) { tap_code(KC_SCRL); }
|
|
||||||
} else {
|
|
||||||
if(host_keyboard_led_state().num_lock) { tap_code(KC_NUM); }
|
|
||||||
if(host_keyboard_led_state().caps_lock) { tap_code(KC_CAPS); }
|
|
||||||
if(host_keyboard_led_state().scroll_lock) { tap_code(KC_SCRL); }
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// makes scroll lock a hold instead of toggle
|
// makes scroll lock a hold instead of toggle
|
||||||
// enables momentary drag scroll on ploopy nano
|
// enables momentary drag scroll on ploopy nano
|
||||||
case KC_SCRL:
|
case KC_SCRL:
|
||||||
|
@ -202,11 +203,21 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
break;
|
break;
|
||||||
#endif //AUDIO_ENABLE
|
#endif //AUDIO_ENABLE
|
||||||
|
|
||||||
|
|
||||||
|
case MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL):
|
||||||
|
reset_keyboard();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT):
|
||||||
|
reset_ploopynano();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
set_default_layer(true);
|
set_default_layer(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
//https://docs.qmk.fm/#/mod_tap?id=changing-both-tasp-and-hold
|
//https://docs.qmk.fm/#/mod_tap?id=changing-both-tasp-and-hold
|
||||||
//https://getreuer.info/posts/keyboards/triggers/index.html#tap-vs.-long-press
|
//https://getreuer.info/posts/keyboards/triggers/index.html#tap-vs.-long-press
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "features/taphold.h"
|
#include "features/taphold.h"
|
||||||
|
|
||||||
void set_default_layer(bool forward);
|
void set_default_layer(bool forward);
|
||||||
|
void reset_ploopynano(void);
|
||||||
|
|
||||||
#if defined(WPM_ENABLE)
|
#if defined(WPM_ENABLE)
|
||||||
bool isLunaJumping(void);
|
bool isLunaJumping(void);
|
||||||
|
@ -53,8 +54,6 @@ enum keycodes {
|
||||||
TH_SCLN,
|
TH_SCLN,
|
||||||
TH_QUOT,
|
TH_QUOT,
|
||||||
|
|
||||||
PN_BOOT, // Press to enter Ploopy Nano Bootloader
|
|
||||||
|
|
||||||
FWD_TAB, // enables encoder to alt-tab/alt+shift-tab
|
FWD_TAB, // enables encoder to alt-tab/alt+shift-tab
|
||||||
REV_TAB, // alt-tab/alt+shift-tab or ctrl-tab/ctrl+shift tab
|
REV_TAB, // alt-tab/alt+shift-tab or ctrl-tab/ctrl+shift tab
|
||||||
|
|
||||||
|
@ -187,7 +186,7 @@ enum keycodes {
|
||||||
|
|
||||||
|
|
||||||
#define LAYER_NAVIGATION \
|
#define LAYER_NAVIGATION \
|
||||||
KC_ESC, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_CAPS, KC_APP, DM_REC1, DM_PLY1, BASELYR, \
|
KC_ESC, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_CAPS, KC_APP, ___x___, ___x___, ___x___, \
|
||||||
___x___, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_BSPC, _SCAG_MODS________________________, \
|
___x___, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_BSPC, _SCAG_MODS________________________, \
|
||||||
_UCCPR_L___________________________________, KC_DEL, KC_TAB, KC_VOLD, KC_VOLU, KC_MUTE, \
|
_UCCPR_L___________________________________, KC_DEL, KC_TAB, KC_VOLD, KC_VOLU, KC_MUTE, \
|
||||||
___x___, NUM, KC_ENT, _LAYER_TRANS_____________, \
|
___x___, NUM, KC_ENT, _LAYER_TRANS_____________, \
|
||||||
|
@ -211,7 +210,7 @@ enum keycodes {
|
||||||
|
|
||||||
|
|
||||||
#define LAYER_MOUSE_FUNC \
|
#define LAYER_MOUSE_FUNC \
|
||||||
MOU_FUN, QK_BOOT, PN_BOOT, TR_PDPI, TR_SDPI, TOG_CFG, KC_F7, KC_F8, KC_F9, KC_F10, \
|
MOU_FUN, DM_REC1, DM_PLY1, TR_PDPI, TR_SDPI, TOG_CFG, KC_F7, KC_F8, KC_F9, KC_F10, \
|
||||||
_GACS_MODS________________________, TR_DRGS, FWD_CFG, KC_F4, KC_F5, KC_F6, KC_F11, \
|
_GACS_MODS________________________, TR_DRGS, FWD_CFG, KC_F4, KC_F5, KC_F6, KC_F11, \
|
||||||
_______, ___x___, KC_BTN5, KC_BTN4, TR_SNIP, REV_CFG, KC_F1, KC_F2, KC_F3, KC_F12, \
|
_______, ___x___, KC_BTN5, KC_BTN4, TR_SNIP, REV_CFG, KC_F1, KC_F2, KC_F3, KC_F12, \
|
||||||
KC_BTN1, KC_BTN3, KC_BTN2, REV_RGB, FWD_RGB, ___x___, \
|
KC_BTN1, KC_BTN3, KC_BTN2, REV_RGB, FWD_RGB, ___x___, \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue