From fa935f17408d7373b9419bf19b9cecc48f363765 Mon Sep 17 00:00:00 2001 From: jakobst1n Date: Sat, 27 Jan 2024 00:17:50 +0100 Subject: ps2 --- config/includes/combos.dtsi | 183 ++++++++++++++++++++++++++++++++++++++++ config/includes/mouse_keys.dtsi | 15 ++++ config/includes/mouse_tp.dtsi | 142 +++++++++++++++++++++++++++++++ 3 files changed, 340 insertions(+) create mode 100644 config/includes/combos.dtsi create mode 100644 config/includes/mouse_keys.dtsi create mode 100644 config/includes/mouse_tp.dtsi (limited to 'config/includes') diff --git a/config/includes/combos.dtsi b/config/includes/combos.dtsi new file mode 100644 index 0000000..f24cffb --- /dev/null +++ b/config/includes/combos.dtsi @@ -0,0 +1,183 @@ +#define COMBO_TERM_FAST 35 +#define COMBO_TERM_SLOW 40 +#define COMBO_PRIOR_IDLE 100 + +/ { + combos { + compatible = "zmk,combos"; + + combo_bracket_v_round_l { + timeout-ms = ; + require-prior-idle-ms = ; + key-positions = ; + layers = ; + bindings = <&kp LPAR>; + }; + + combo_bracket_v_round_r { + timeout-ms = ; + require-prior-idle-ms = ; + key-positions = ; + layers = ; + bindings = <&kp RPAR>; + }; + + combo_bracket_v_square_l { + timeout-ms = ; + require-prior-idle-ms = ; + key-positions = ; + layers = ; + bindings = <&kp LBKT>; + }; + + combo_bracket_v_square_r { + timeout-ms = ; + require-prior-idle-ms = ; + key-positions = ; + layers = ; + bindings = <&kp RBKT>; + }; + + combo_bracket_v_curly_l { + timeout-ms = ; + require-prior-idle-ms = ; + key-positions = ; + layers = ; + bindings = <&kp LBRC>; + }; + + combo_bracket_v_curly_r { + timeout-ms = ; + require-prior-idle-ms = ; + key-positions = ; + layers = ; + bindings = <&kp RBRC>; + }; + + combo_bracket_v_angled_l { + timeout-ms = ; + require-prior-idle-ms = ; + key-positions = ; + layers = ; + bindings = <&kp LT>; + }; + + combo_bracket_v_angled_r { + timeout-ms = ; + require-prior-idle-ms = ; + key-positions = ; + layers = ; + bindings = <&kp GT>; + }; + + combo_capsword { + timeout-ms = ; + require-prior-idle-ms = ; + key-positions = ; + layers = ; + +#ifdef HAS_CAPSLOCK + bindings = <&caps_word_capslock >; +#else + bindings = <&caps_word>; +#endif + }; + + combo_return { + timeout-ms = ; + require-prior-idle-ms = ; + key-positions = ; + layers = ; + bindings = <&kp RET>; + }; + + combo_bspc { + timeout-ms = ; + require-prior-idle-ms = ; + key-positions = ; + layers = ; + bindings = <&kp BSPC>; + }; + + // combo_grave { + // timeout-ms = ; + // require-prior-idle-ms = ; + // key-positions = ; + // layers = <>; + // bindings = <&kp GRAVE>; + // }; + + // combo_md_code_block { + // timeout-ms = ; + // require-prior-idle-ms = ; + // key-positions = ; + // layers = <>; + // bindings = <&m_type_md_code_block>; + // }; + + combo_tog_nav_word { + timeout-ms = ; + require-prior-idle-ms = ; + key-positions = ; + layers = ; + + #ifdef HAS_UROB + bindings = <&nav_word>; + #else + bindings = <&tog NAV_WORD>; + #endif + + }; + + combo_tog_num_word { + timeout-ms = ; + require-prior-idle-ms = ; + key-positions = ; + layers = ; + + #ifdef HAS_UROB + bindings = <&num_word>; + #else + bindings = <&tog NUM_WORD>; + #endif + + }; + +#ifdef HAS_MOUSE_TP + combo_tog_mouse_settings_l { + timeout-ms = ; + // require-prior-idle-ms = ; + key-positions = ; + layers = ; + bindings = <&tog MOUSE_SET>; + }; + + combo_tog_mouse_settings_r { + timeout-ms = ; + // require-prior-idle-ms = ; + key-positions = ; + layers = ; + bindings = <&tog MOUSE_SET>; + }; +#endif + +#ifdef HAS_MOUSE_KEYS + combo_tog_mouse_keys_l { + timeout-ms = ; + // require-prior-idle-ms = ; + key-positions = ; + layers = ; + bindings = <&tog MOUSE_KEYS>; + }; + + combo_tog_mouse_keys_r { + timeout-ms = ; + // require-prior-idle-ms = ; + key-positions = ; + layers = ; + bindings = <&tog MOUSE_KEYS>; + }; +#endif + + }; +}; diff --git a/config/includes/mouse_keys.dtsi b/config/includes/mouse_keys.dtsi new file mode 100644 index 0000000..aa98ed4 --- /dev/null +++ b/config/includes/mouse_keys.dtsi @@ -0,0 +1,15 @@ +#ifdef HAS_MOUSE_KEYS + #include +#endif + + +// Below are settings and behavior defines for mouse keys. +&mmv { + acceleration-exponent = <1>; // Default: 1 + time-to-max-speed-ms = <300>; // Default: 300 +}; + +&msc { + acceleration-exponent = <0>; // Default: 0 + time-to-max-speed-ms = <300>; // Default: 300 +}; diff --git a/config/includes/mouse_tp.dtsi b/config/includes/mouse_tp.dtsi new file mode 100644 index 0000000..52856ca --- /dev/null +++ b/config/includes/mouse_tp.dtsi @@ -0,0 +1,142 @@ +#ifdef HAS_MOUSE_TP + #include + + /* + * Key Behaviors to adjust settings + */ + + // They key codes below can be used to adjust the TP settings at runtime + // without needing to recompile the firmware. + // + // The values will be logged and saved in the config on the controller flash + // after 60s (CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE). + // + // On boot the settings will be restored again. + // + // If you prefer a more explicit way of configuration, you can also hardcode + // these settings in `&mouse_ps2`. + // + // If you set these settings in `&mouse_ps2`, you will still be able to + // adjust the values during runtime with these key codes, but after + // restarting the board the values in `&mouse_ps2` will be restored and not + // the ones stored in the flash using the key codes. + + + // How sensitive the trackpoint is + #define U_MSS_TP_S_I &mms MS_TP_SENSITIVITY_INCR + #define U_MSS_TP_S_D &mms MS_TP_SENSITIVITY_DECR + + + // The maximum speed the trackpoint will accelerate to + #define U_MSS_TP_V6_I &mms MS_TP_VALUE6_INCR + #define U_MSS_TP_V6_D &mms MS_TP_VALUE6_DECR + + + // I am not quite sure tbh... default seems fine. + #define U_MSS_TP_NI_I &mms MS_TP_NEG_INERTIA_INCR + #define U_MSS_TP_NI_D &mms MS_TP_NEG_INERTIA_DECR + + + // How hard you have to press to activate the "Press To Select" feature that + // lets you tap or press on the trackpoint to click. + // + // Not all trackpoints support it and you have to enable + // `tp-press-to-select;` in `&mouse_ps2` first. + #define U_MSS_TP_PT_I &mms MS_TP_PTS_THRESHOLD_INCR + #define U_MSS_TP_PT_D &mms MS_TP_PTS_THRESHOLD_DECR + + + // If you mess up the settings, you can use this key code to clear the + // settings from flash and re-set the default values on the TP. + // + // Make sure to wait at least CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE seconds (60 + // by default) before restarting the board to ensure the settings are + // written to flash storage. + #define U_MSS_RESET &mms MS_RESET + + + // If you prefer to set the settings in `&mouse_ps2`, you can use the key + // codes above to find the settings you like the most and then press this + // key code to output the settings to the log. + // + // Then you can add those values to `&mouse_ps2` + #define U_MSS_LOG &mms MS_LOG + + + /* + * Driver-specific configuration + */ + + &mouse_ps2 { + // Enables scroll wheel on mouse devices supporting the Intellimouse + // extension. + // scroll-mode; + + + // Disables clicking. Useful when using a PS2 driver that is prone to + // erros in transmissions to reduce accidental clicks. + // disable-clicking; + + // The frequency at which the mouse samples and sends data (in hz). + // The default rate is 100. You can try lowering it if you experience + // connection errors. + // + // Higher values than 100 are no improvement in my experience, but will + // increase battery life and potentially errors in transmissions. + // + // These values are allowed: 10,20,40,60,80,100,200 + // sampling-rate = <60>; + + + // Enable clicking by tapping on the TP. Not all TPs support this. + // tp-press-to-select; + // tp-press-to-select-threshold = <10>; + + + // How sensitive the TP is (Default: 128) + tp-sensitivity = <135>; + + + // The maximum mouse movement speed the TP will accelarate to (Default: 97) + tp-val6-upper-speed = <182>; + + + // Not quite sure what it does tbh :) (Default: 6) + tp-neg-inertia = <6>; + + + // Adjusts axis settings on the TP + // Works only on some trackpoints, but may be properly considered by the + // trackpoint's acceleration features (which may or may not have an + // impact). Alternatively consider achieving the same effect using the + // `zmk,input-configs` feature. + // tp-xy-swap; + // tp-x-invert; + // tp-y-invert; + + }; + + /* + * Input Config + */ + + &mouse_ps2_config { + xy-swap; + x-invert; + y-invert; + + // Set the layer that should automatically activate when the mouse is + // moving. + layer-toggle = ; + + // How long the mouse needs to move for before the layer is activated (to + // avoid accidental activations while typing) (Default: 250) + layer-toggle-delay-ms = <250>; + + // How long to wait, after the last mouse movement, before deactivating + // the layer (Default: 250) + layer-toggle-timeout-ms = <250>; + }; + + +#endif -- cgit v1.2.3