Skip to content

Commit

Permalink
configure trackpoints separately from mice
Browse files Browse the repository at this point in the history
there needs to be a better way to identify trackpoints though.

related: WayfireWM#1349
  • Loading branch information
lilydjwg committed Feb 1, 2024
1 parent 1355c06 commit 76a33fd
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
34 changes: 34 additions & 0 deletions metadata/input.xml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,40 @@
</desc>
</option>
</group>
<!-- Trackpoint configuration -->
<group>
<_short>Trackpoint</_short>
<_long>Configure the trackpoint.</_long>
<!-- libinput configuration -->
<option name="trackpoint_accel_profile" type="string">
<_short>Trackpoint acceleration profile</_short>
<_long>Sets the pointer acceleration profile.</_long>
<default>default</default>
<desc>
<value>default</value>
<_name>Default</_name>
</desc>
<desc>
<value>none</value>
<_name>None</_name>
</desc>
<desc>
<value>adaptive</value>
<_name>Adaptive</_name>
</desc>
<desc>
<value>flat</value>
<_name>Flat</_name>
</desc>
</option>
<option name="trackpoint_cursor_speed" type="double">
<_short>Trackpoint cursor speed</_short>
<_long>Changes the pointer acceleration.</_long>
<default>0.0</default>
<min>-1.0</min>
<max>1.0</max>
</option>
</group>
<!-- Cursor configuration -->
<group>
<_short>Cursor</_short>
Expand Down
7 changes: 7 additions & 0 deletions src/core/seat/pointing-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ void wf::pointing_device_t::config_t::load()
mouse_cursor_speed.load_option("input/mouse_cursor_speed");
touchpad_cursor_speed.load_option("input/touchpad_cursor_speed");
touchpad_scroll_speed.load_option("input/touchpad_scroll_speed");
trackpoint_cursor_speed.load_option("input/trackpoint_cursor_speed");

touchpad_tap_enabled.load_option("input/tap_to_click");
touchpad_dwt_enabled.load_option("input/disable_touchpad_while_typing");
Expand All @@ -25,6 +26,7 @@ void wf::pointing_device_t::config_t::load()

mouse_accel_profile.load_option("input/mouse_accel_profile");
touchpad_accel_profile.load_option("input/touchpad_accel_profile");
trackpoint_accel_profile.load_option("input/trackpoint_accel_profile");

touchpad_click_method.load_option("input/click_method");
touchpad_scroll_method.load_option("input/scroll_method");
Expand Down Expand Up @@ -139,6 +141,11 @@ void wf::pointing_device_t::update_options()
libinput_device_config_scroll_set_natural_scroll_enabled(dev,
(bool)config.touchpad_natural_scroll_enabled);
}
} else if (strcasestr(libinput_device_get_name(dev), "trackpoint"))
{
libinput_device_config_accel_set_speed(dev,
config.trackpoint_cursor_speed);
set_libinput_accel_profile(dev, config.trackpoint_accel_profile);
} else
{
libinput_device_config_accel_set_speed(dev,
Expand Down
2 changes: 2 additions & 0 deletions src/core/seat/pointing-device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ struct pointing_device_t : public input_device_impl_t
wf::option_wrapper_t<std::string> tablet_motion_mode;
wf::option_wrapper_t<double> touchpad_cursor_speed;
wf::option_wrapper_t<double> touchpad_scroll_speed;
wf::option_wrapper_t<double> trackpoint_cursor_speed;
wf::option_wrapper_t<std::string> touchpad_click_method;
wf::option_wrapper_t<std::string> touchpad_scroll_method;
wf::option_wrapper_t<std::string> touchpad_accel_profile;
wf::option_wrapper_t<std::string> mouse_accel_profile;
wf::option_wrapper_t<std::string> trackpoint_accel_profile;
wf::option_wrapper_t<bool> touchpad_tap_enabled;
wf::option_wrapper_t<bool> touchpad_dwt_enabled;
wf::option_wrapper_t<bool> touchpad_dwmouse_enabled;
Expand Down

0 comments on commit 76a33fd

Please sign in to comment.