mirror of
https://github.com/qmk/qmk_userspace.git
synced 2025-07-08 04:35:34 -04:00
Added Host State Auto Mouse
- added mouse layer to userspace - Ploopy Nano now turns on num lock when pointer is moved - When the keyboard detects num lock it turns the mouse layer on - cleaned up unused key overrides and combos - Rules.mk was redone to drastically reduce memory footprint - merged all config files into the main one - made a clever way to have two _user functions in the userspace - revised drag scroll bind for comfort - removed dpi toggle functionality for nano for now. Need to find way to add it back
This commit is contained in:
parent
1f8602a49c
commit
169f363763
25 changed files with 309 additions and 486 deletions
|
@ -29,14 +29,17 @@ bool combo_should_trigger(uint16_t combo_index, combo_t *combo, uint16_t keycode
|
|||
switch (combo_index) {
|
||||
|
||||
|
||||
case MOUSE_BUTTON1:
|
||||
// case MOUSE_BUTTON1:
|
||||
// case MOUSE_BUTTON2:
|
||||
// case MOUSE_BUTTON3:
|
||||
// case MOUSE_BUTTON4:
|
||||
// case MOUSE_BUTTON5:
|
||||
|
||||
case MOUSE_DRGTOG:
|
||||
if ( get_highest_layer(layer_state | default_layer_state) > FIRST_DEFAULT_LAYER ) return false;
|
||||
if (( get_highest_layer(layer_state | default_layer_state) != FIRST_DEFAULT_LAYER )
|
||||
&& ( get_highest_layer(layer_state | default_layer_state) != _MOUSE )) {
|
||||
return false;
|
||||
}
|
||||
|
||||
default:
|
||||
return true;
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
#include "t4corun.h"
|
||||
|
||||
|
||||
const uint16_t PROGMEM mou_btn1_combo[] = { KC_D, KC_F, COMBO_END };
|
||||
//const uint16_t PROGMEM mou_btn1_combo[] = { KC_D, KC_F, COMBO_END };
|
||||
//const uint16_t PROGMEM mou_btn2_combo[] = { KC_S, KC_D, COMBO_END };
|
||||
//const uint16_t PROGMEM mou_btn3_combo[] = { KC_F, KC_G, COMBO_END };
|
||||
//const uint16_t PROGMEM mou_btn4_combo[] = { KC_F, KC_R, COMBO_END };
|
||||
//const uint16_t PROGMEM mou_btn5_combo[] = { KC_T, KC_G, COMBO_END };
|
||||
const uint16_t PROGMEM mou_drg_combo[] = { KC_X, KC_C, COMBO_END };
|
||||
const uint16_t PROGMEM mou_drg_combo[] = { KC_X, KC_V, COMBO_END };
|
||||
|
||||
|
||||
const uint16_t PROGMEM key_ent_combo[] = { KC_C, KC_V, COMBO_END };
|
||||
|
@ -16,7 +16,7 @@ const uint16_t PROGMEM key_tab_combo[] = { KC_J, KC_K, COMBO_END };
|
|||
|
||||
|
||||
enum combos {
|
||||
MOUSE_BUTTON1,
|
||||
// MOUSE_BUTTON1,
|
||||
// MOUSE_BUTTON2,
|
||||
// MOUSE_BUTTON3,
|
||||
// MOUSE_BUTTON4,
|
||||
|
@ -34,7 +34,7 @@ uint16_t COMBO_LEN = COMBO_LENGTH;
|
|||
|
||||
|
||||
combo_t key_combos[COMBO_LENGTH] = {
|
||||
[MOUSE_BUTTON1] = COMBO(mou_btn1_combo, KC_BTN1),
|
||||
// [MOUSE_BUTTON1] = COMBO(mou_btn1_combo, KC_BTN1),
|
||||
// [MOUSE_BUTTON2] = COMBO(mou_btn2_combo, KC_BTN2),
|
||||
// [MOUSE_BUTTON3] = COMBO(mou_btn3_combo, KC_BTN3),
|
||||
// [MOUSE_BUTTON4] = COMBO(mou_btn4_combo, KC_BTN4),
|
||||
|
|
15
users/t4corun/features/hoststateautomouse.c
Normal file
15
users/t4corun/features/hoststateautomouse.c
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include "hoststateautomouse.h"
|
||||
|
||||
|
||||
// keyboard side code to simulate auto mouse between ploopy nano and qmk keyboard
|
||||
// nano pointer movement activates auto mouse layer, which toggles numlock
|
||||
// when num lock is enabled, keyboard turns on mouse layer
|
||||
bool led_update_user(led_t led_state) {
|
||||
if(host_keyboard_led_state().num_lock) {
|
||||
layer_on(_MOUSE);
|
||||
} else if (!host_keyboard_led_state().num_lock) {
|
||||
layer_off(_MOUSE);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
3
users/t4corun/features/hoststateautomouse.h
Normal file
3
users/t4corun/features/hoststateautomouse.h
Normal file
|
@ -0,0 +1,3 @@
|
|||
#pragma once
|
||||
|
||||
#include "t4corun.h"
|
|
@ -29,9 +29,6 @@ const key_override_t f10_override = ko_make_with_layers(MOD_MASK_CSA, K
|
|||
const key_override_t f11_override = ko_make_with_layers(MOD_MASK_CSA, KC_DOT, KC_F11, 1<<_NUMBER);
|
||||
const key_override_t f12_override = ko_make_with_layers(MOD_MASK_CSA, KC_MINS, KC_F12, 1<<_NUMBER);
|
||||
|
||||
const key_override_t mb2_override = ko_make_with_layers(MOD_MASK_CTRL, KC_BTN2, KC_BTN4, 1<<_NUMBER);
|
||||
const key_override_t mb3_override = ko_make_with_layers(MOD_MASK_ALT, KC_BTN3, KC_BTN5, 1<<_NUMBER);
|
||||
|
||||
#if defined(HAPTIC_ENABLE)
|
||||
const key_override_t hfnext_override = ko_make_with_layers(MOD_MASK_SHIFT, TR_HNXT, HF_PREV, 1<<_CONFIG);
|
||||
const key_override_t hfconu_override = ko_make_with_layers(MOD_MASK_SHIFT, TR_HCNU, HF_COND, 1<<_CONFIG);
|
||||
|
@ -57,8 +54,6 @@ const key_override_t **key_overrides = (const key_override_t *[]) {
|
|||
&f10_override,
|
||||
&f11_override,
|
||||
&f12_override,
|
||||
&mb2_override,
|
||||
&mb3_override,
|
||||
|
||||
#if defined(HAPTIC_ENABLE)
|
||||
&hfnext_override,
|
||||
|
|
|
@ -42,9 +42,12 @@ void render_layer_state(uint8_t col, uint8_t line, bool moveCursor) {
|
|||
case _SYMBOL:
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYER_4), false);
|
||||
break;
|
||||
case _CONFIG:
|
||||
case _MOUSE:
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYER_5), false);
|
||||
break;
|
||||
case _CONFIG:
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYER_6), false);
|
||||
break;
|
||||
default:
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYER_1), false);
|
||||
break;
|
||||
|
@ -62,7 +65,8 @@ void render_layer_state_list(uint8_t col, uint8_t line, bool moveCursor) {
|
|||
oled_write_P(PSTR(OLED_RENDER_LAYER_2), get_highest_layer(layer_state) == _NAVIGATION);
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYER_3), get_highest_layer(layer_state) == _NUMBER);
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYER_4), get_highest_layer(layer_state) == _SYMBOL);
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYER_5), get_highest_layer(layer_state) == _CONFIG);
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYER_5), get_highest_layer(layer_state) == _MOUSE);
|
||||
oled_write_P(PSTR(OLED_RENDER_LAYER_6), get_highest_layer(layer_state) == _CONFIG);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
# define OLED_RENDER_LAYER_2 "Navigation"
|
||||
# define OLED_RENDER_LAYER_3 "Number "
|
||||
# define OLED_RENDER_LAYER_4 "Symbol "
|
||||
# define OLED_RENDER_LAYER_5 "Config "
|
||||
# define OLED_RENDER_LAYER_5 "Mouse "
|
||||
# define OLED_RENDER_LAYER_6 "Config "
|
||||
#else
|
||||
//128x32 are ? x 5 char wide
|
||||
# define OLED_RENDER_DEFAULT_LAYER1 "Qwrty"
|
||||
|
@ -22,7 +23,8 @@
|
|||
# define OLED_RENDER_LAYER_2 " Nav "
|
||||
# define OLED_RENDER_LAYER_3 " Num "
|
||||
# define OLED_RENDER_LAYER_4 " Sym "
|
||||
# define OLED_RENDER_LAYER_5 " Cfg "
|
||||
# define OLED_RENDER_LAYER_5 " Mou "
|
||||
# define OLED_RENDER_LAYER_6 " Cfg "
|
||||
#endif
|
||||
|
||||
void render_oled_128x64(void);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue