mate-desktop / mate-settings-daemon

MATE settings daemon
https://mate-desktop.org
GNU General Public License v2.0
43 stars 47 forks source link

media-keys: Add support for XF86TouchpadOn/Off #238

Closed zhangxianwei8 closed 5 years ago

zhangxianwei8 commented 5 years ago

Using hard-coded keys.

This requires new keycodes added to X.org in: https://bugs.freedesktop.org/show_bug.cgi?id=31300

Ported from gnome-settings-daemon: https://github.com/GNOME/gnome-settings-daemon/commit/1c8f64d1dc6beb7d27a6dce74fa29e27e8c34583

raveit65 commented 5 years ago

Which version of xorg server does have this code?

lukefromdc commented 5 years ago

I don't think my laptop has a key for this, and desktops don't have touchpads so someone else will need to test this

raveit65 commented 5 years ago

I have a touchpad , np. The question is more if all distros use this needed Xorg version. Commit is from 2017. I am sure we need to add a condition for this.

zhangxianwei8 commented 5 years ago

Which version of xorg server does have this code?

See the patch https://cgit.freedesktop.org/xorg/proto/x11proto/commit/?id=5d3428de974d15357b0ad407f4c5222cfaa8f9f3, which merged very early.

I have tested on Lenovo E43 laptop, which has a touchpad Functional key(F6). @raveit65 @lukefromdc

raveit65 commented 5 years ago

I see gnome commit is from 2010, so it is save to use.

raveit65 commented 5 years ago

Which keyboard key are you using to enable/disable touchpad?

zhangxianwei8 commented 5 years ago

The keyboard key is F6.

zhangxianwei8 commented 5 years ago

Looking at this: img_3232

lukefromdc commented 5 years ago

On converted Chromebooks you don't get the normal functions keys, and some but not all of the keys marked to do various functions in Chrome in fact seem to operate ONLY as function keys. At least this is what I've gotten with a sample size of one machine. Just getting rid of ChromeOS (all the way rid of it) and Debian Unstable installed was hard enough.

zhangxianwei8 commented 5 years ago

Not all laptops have this key. This PR just fixes those have disable/enable touchpad hotkey.

'xev' command catches input event: KeyRelease event, serial 34, synthetic NO, window 0x2200001, root 0x18e, subw 0x0, time 16014751, (640,472), root:(646,557), state 0x0, keycode 201 (keysym 0x1008ffb1, XF86TouchpadOff), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False

KeyPress event, serial 37, synthetic NO, window 0x2200001, root 0x18e, subw 0x0, time 16016039, (640,472), root:(646,557), state 0x0, keycode 200 (keysym 0x1008ffb0, XF86TouchpadOn), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False

Then mate-settings-daemon handles it to display OSD, tested on Fedora29 beta: screenshot at 2018-10-01 03-32-49

raveit65 commented 5 years ago

Thank you

AnterCreeper commented 1 year ago

Help! Also the key is worked, the OSD displayed, but the function doesn't work. at Debian 11 bullseye But, touchpad can be toggled through dconf write /org/mate/desktop/peripherals/touchpad/touchpad-enabled true/false