<middleEmulation></middleEmulation>
<disableWhileTyping></disableWhileTyping>
<clickMethod></clickMethod>
+ <scrollMethod></scrollMethod>
<sendEventsMode></sendEventsMode>
<calibrationMatrix></calibrationMatrix>
<scrollFactor>1.0</scrollFactor>
The default method depends on the touchpad hardware.
+*<libinput><device><scrollMethod>* [none|twofinger|edge]
+ Configure the method by which physical movements on a touchpad are
+ mapped to scroll events.
+
+ The scroll methods available are:
+ - *twofinger* - Scroll by two fingers being placed on the surface of the
+ touchpad, then moving those fingers vertically or horizontally.
+ - *edge* - Scroll by moving a single finger along the right edge
+ (vertical scroll) or bottom edge (horizontal scroll).
+ - *none* - No scroll events will be produced.
+
+ The default method depends on the touchpad hardware.
+
*<libinput><device><sendEventsMode>* [yes|no|disabledOnExternalMouse]
Optionally enable or disable sending any device events.
<middleEmulation></middleEmulation>
<disableWhileTyping></disableWhileTyping>
<clickMethod></clickMethod>
+ <scrollMethod></scrollMethod>
<sendEventsMode></sendEventsMode>
<calibrationMatrix></calibrationMatrix>
<scrollFactor>1.0</scrollFactor>
int middle_emu; /* -1 or libinput_config_middle_emulation_state */
int dwt; /* -1 or libinput_config_dwt_state */
int click_method; /* -1 or libinput_config_click_method */
+ int scroll_method; /* -1 or libinput_config_scroll_method */
int send_events_mode; /* -1 or libinput_config_send_events_mode */
bool have_calibration_matrix;
double scroll_factor;
l->middle_emu = -1;
l->dwt = -1;
l->click_method = -1;
+ l->scroll_method = -1;
l->send_events_mode = -1;
l->have_calibration_matrix = false;
l->scroll_factor = 1.0;
} else {
wlr_log(WLR_ERROR, "invalid clickMethod");
}
+ } else if (!strcasecmp(nodename, "scrollMethod")) {
+ if (!strcasecmp(content, "none")) {
+ state->current_libinput_category->scroll_method =
+ LIBINPUT_CONFIG_SCROLL_NO_SCROLL;
+ } else if (!strcasecmp(content, "edge")) {
+ state->current_libinput_category->scroll_method =
+ LIBINPUT_CONFIG_SCROLL_EDGE;
+ } else if (!strcasecmp(content, "twofinger")) {
+ state->current_libinput_category->scroll_method =
+ LIBINPUT_CONFIG_SCROLL_2FG;
+ } else {
+ wlr_log(WLR_ERROR, "invalid scrollMethod");
+ }
} else if (!strcasecmp(nodename, "sendEventsMode")) {
state->current_libinput_category->send_events_mode =
get_send_events_mode(content);
libinput_device_config_click_set_method(libinput_dev, dc->click_method);
}
+ if (dc->scroll_method < 0) {
+ wlr_log(WLR_INFO, "scroll method not configured");
+ } else if (dc->scroll_method != LIBINPUT_CONFIG_SCROLL_NO_SCROLL
+ && (libinput_device_config_scroll_get_methods(libinput_dev)
+ & dc->scroll_method) == 0) {
+ wlr_log(WLR_INFO, "scroll method not supported");
+ } else {
+ wlr_log(WLR_INFO, "scroll method configured");
+ libinput_device_config_scroll_set_method(libinput_dev, dc->scroll_method);
+ }
+
if ((dc->send_events_mode != LIBINPUT_CONFIG_SEND_EVENTS_ENABLED
&& (libinput_device_config_send_events_get_modes(libinput_dev)
& dc->send_events_mode) == 0)