mirror of
https://github.com/qmk/qmk_userspace.git
synced 2025-07-05 11:20:35 -04:00
Tandem checkin for ploopyco overhaul
- Added build option for new ploopy nano build - Added ploopy nano userspace keymap - Removed old drag scroll detection. OLED graphic tied to scroll lock - REmoved old scroll lock and dpi custom keycodes used for Lkbm keymap - overrode num/scroll lock. It is now a hold instead of a toggle - Added custom keycode to turn on all locks to tell ploopy nano to enter bootloader - refactored variables based on learnings from ploopy rebase - minor tweaks to keymap - pressing numlock cycles through dpi settings - pressing scroll lock enters momentary drag scroll
This commit is contained in:
parent
c1803bf38e
commit
c2008065ae
10 changed files with 104 additions and 74 deletions
|
@ -2,21 +2,12 @@
|
|||
|
||||
// Keeps track of base layer so we can make one key to cycle through them
|
||||
// instead of making a key for each one */
|
||||
static uint8_t current_base_layer = _DEFAULT_LAYER_1;
|
||||
|
||||
// Should keep track of the Ploopy Nano drag scroll mode
|
||||
// There is a possibility of this being out of sync
|
||||
static bool drag_scroll_enabled = false;
|
||||
static uint8_t current_base_layer = FIRST_DEFAULT_LAYER;
|
||||
|
||||
// Luna Pet Variables
|
||||
static bool isJumping = false;
|
||||
static bool showedJump = true;
|
||||
|
||||
|
||||
|
||||
// Allows the OLED code to get the drag scroll mode
|
||||
bool drag_scroll_is_enabled(void) { return drag_scroll_enabled; }
|
||||
|
||||
// Allows the OLED code to see when space bar is pressed
|
||||
bool isLunaJumping(void) { return isJumping; }
|
||||
bool isJumpShown(void) { return showedJump; }
|
||||
|
@ -24,14 +15,51 @@ bool isJumpShown(void) { return showedJump; }
|
|||
// Allows the OLED code to clear the space bar status when render is complete
|
||||
void setLunaJumped(void) { showedJump = true;}
|
||||
|
||||
|
||||
|
||||
// Hold Navigation and Number to get Symbol
|
||||
layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _NAVIGATION, _NUMBER, _SYMBOL); }
|
||||
|
||||
|
||||
// Customize behavior for existing keycodes or create new ones
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
||||
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
|
||||
// enables momentary drag scroll on ploopy nano
|
||||
case KC_SCRL:
|
||||
if (record->event.pressed) {
|
||||
tap_code(KC_SCRL);
|
||||
} else {
|
||||
tap_code(KC_SCRL);
|
||||
}
|
||||
return false;
|
||||
|
||||
// makes num lock a hold instead of toggle
|
||||
// prevents accidental ploopy nano going into bootloader
|
||||
case KC_NUM:
|
||||
if (record->event.pressed) {
|
||||
tap_code(KC_NUM);
|
||||
} else {
|
||||
tap_code(KC_NUM);
|
||||
}
|
||||
return false;
|
||||
|
||||
case KC_SPC:
|
||||
if (record->event.pressed) {
|
||||
isJumping = true;
|
||||
|
@ -45,7 +73,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
case BASELYR:
|
||||
if (record->event.pressed) {
|
||||
|
||||
current_base_layer = (current_base_layer + 1) % NUM_BASE_LAYER;
|
||||
current_base_layer = (current_base_layer + 1) % NUM_DEFAULT_LAYERS;
|
||||
set_single_persistent_default_layer(current_base_layer);
|
||||
|
||||
}
|
||||
|
@ -54,34 +82,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
case RBSELYR:
|
||||
if (record->event.pressed) {
|
||||
|
||||
current_base_layer = (current_base_layer - 1) % NUM_BASE_LAYER;
|
||||
current_base_layer = (current_base_layer - 1) % NUM_DEFAULT_LAYERS;
|
||||
set_single_persistent_default_layer(current_base_layer);
|
||||
|
||||
}
|
||||
return false;
|
||||
|
||||
case PN_DRGS:
|
||||
if (record->event.pressed) {
|
||||
|
||||
//tap numlock twice to toggle ploopy nano drag scroll
|
||||
// double_tap(KC_NUM, KC_NUM, WAIT_DELAY);
|
||||
double_tap(KC_NUM, WAIT_DELAY);
|
||||
|
||||
//I realize this may not work for the Charybdis nano
|
||||
drag_scroll_enabled = !drag_scroll_enabled;
|
||||
|
||||
}
|
||||
return false;
|
||||
|
||||
case PN_PDPI:
|
||||
if (record->event.pressed) {
|
||||
|
||||
//tap capslock twice to cycle ploopy nano pointer DPI
|
||||
//double_tap(KC_CAPS, KC_CAPS, WAIT_DELAY);
|
||||
double_tap(KC_CAPS, WAIT_DELAY);
|
||||
|
||||
}
|
||||
return false;
|
||||
|
||||
//https://docs.qmk.fm/#/mod_tap?id=changing-both-tasp-and-hold
|
||||
//https://getreuer.info/posts/keyboards/triggers/index.html#tap-vs.-long-press
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue