Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to filter libinput by device #77

Closed
1 task done
z0rc opened this issue May 10, 2018 · 3 comments
Closed
1 task done

Option to filter libinput by device #77

z0rc opened this issue May 10, 2018 · 3 comments

Comments

@z0rc
Copy link
Contributor

z0rc commented May 10, 2018

Prerequisites

Description

libinput-debug-events by default catches all events, in addition to touchpad events there are keyboard, mouse and more. libinput-debug-events allows to filter those out by using --device option. This filtering allows to consume less CPU time by fusuma+libinput-debug-events. For example, when I plug mouse to laptop and move it relatively quickly in constant manner fusuma and libinput-debug-events consume about 10-15% of single CPU core. libinput-debug-events --device ... allows to ignore mouse events and effectively consume zero CPU time on mouse movements.

This option is a bit tricky, as user have to know device name before hand. So maybe we can add an advanced option to define libinput-debug-events launch parameters?

Versions

fusuma: b1ab717
OS: Kubuntu 17.10
libinput: 1.8.4

@z0rc
Copy link
Contributor Author

z0rc commented May 11, 2018

A bit more clarification.

Seems there is a code that tries to enable filtering at https://github.com/iberianpig/fusuma/blob/master/lib/fusuma.rb#L56-L58. But in my case it doesn't work because usually I'm booting laptop with dock station enabled and mouse attached. At this case Devices class has 3 names (2 for mouse, doh), here is relevant libinput list-devices output:

Device:           DLL075B:01 06CB:76AF Touchpad
Kernel:           /dev/input/event20
Group:            8
Seat:             seat0, default
Size:             101x57mm
Capabilities:     pointer 
Tap-to-click:     disabled
Tap-and-drag:     enabled
Tap drag lock:    disabled
Left-handed:      disabled
Nat.scrolling:    disabled
Middle emulation: disabled
Calibration:      n/a
Scroll methods:   *two-finger edge 
Click methods:    *button-areas clickfinger 
Disable-w-typing: enabled
Accel profiles:   none
Rotation:         n/a

Device:           Logitech G700 Laser Mouse
Kernel:           /dev/input/event8
Group:            10
Seat:             seat0, default
Capabilities:     pointer 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      disabled
Nat.scrolling:    disabled
Middle emulation: disabled
Calibration:      n/a
Scroll methods:   button
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   flat *adaptive
Rotation:         n/a

Device:           Logitech G700 Laser Mouse
Kernel:           /dev/input/event9
Group:            10
Seat:             seat0, default
Capabilities:     keyboard pointer 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      n/a
Nat.scrolling:    disabled
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   n/a
Rotation:         n/a

Maybe in addition to filtering out devices that don't have Nat.scrolling, we can filter out devices with mouse (case insensitive) in Device name? Or switch to other criteria for detecting touchpad? For example only touchpad has Size field in my case.

@iberianpig
Copy link
Owner

Thanks for your suggestion!
I will remove the device that doesn't include Size:.

@iberianpig
Copy link
Owner

iberianpig commented Jun 24, 2018

@z0rc --device= option is available 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants