summaryrefslogtreecommitdiff
path: root/config/includes/mouse_tp.dtsi
blob: 6345cf4f88118c92e465c3ddc568535eb777db90 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#ifdef HAS_MOUSE_TP
  #include <dt-bindings/zmk/mouse_settings.h>

 /*
  * 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 = <MOUSE_TP>;

    // 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 = <1000>;
  };


#endif