After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 594831 - Fn-F8 should disable/enable touch points
Fn-F8 should disable/enable touch points
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: plugins
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on: 600951 602986
Blocks:
 
 
Reported: 2009-09-11 04:40 UTC by Jonathan Blandford
Modified: 2010-02-15 14:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-Add-touchpad_enabled-gconf-key.patch (5.08 KB, patch)
2009-10-27 05:36 UTC, Peter Hutterer
committed Details | Review
0002-Add-keybinding-schema-to-enable-disable-touchpad.patch (3.04 KB, patch)
2009-10-27 05:39 UTC, Peter Hutterer
reviewed Details | Review
0001-Add-keybinding-schema-to-enable-disable-touchpad.patch (3.22 KB, patch)
2009-10-28 02:10 UTC, Peter Hutterer
none Details | Review
0001-Display-a-dialog-box-when-enabling-disabling-the-tou.patch (119.74 KB, patch)
2009-11-27 01:54 UTC, Peter Hutterer
committed Details | Review
0001-Add-keybinding-schema-to-enable-disable-touchpad.patch (3.46 KB, patch)
2009-11-27 03:00 UTC, Peter Hutterer
committed Details | Review

Description Jonathan Blandford 2009-09-11 04:40:33 UTC
On my thinkpad, I have an Fn-F8 key, which should cycle between the touchpoint/touchpad being on and off.  We have the gconf keys for that; we should also listen for that keypress to toggle them.
Comment 1 Peter Hutterer 2009-10-05 00:13:18 UTC
libX11-1.3 now provides XF86TouchpadToggle and xkeyboard-config 1.7 by default on FK22 (keycode 200 with evdev).

This means now we just need g-s-d to listen to that keysym
Comment 2 Peter Hutterer 2009-10-27 05:36:23 UTC
Created attachment 146315 [details] [review]
0001-Add-touchpad_enabled-gconf-key.patch

Add touchpad_enabled gconf key.

Boolean key that toggles the "Device Enabled" property on all touchpad
devices. If TRUE, touchpads are enabled, otherwise, all touchpads are
disabled.

Touchpad disabled with this key will be visible to other X Input clients but
cannot send events unless re-enabled.
Comment 3 Peter Hutterer 2009-10-27 05:39:12 UTC
Created attachment 146316 [details] [review]
0002-Add-keybinding-schema-to-enable-disable-touchpad.patch

Add keybinding schema to enable/disable touchpad


Not sure about this patch tbh. The integration seems a bit off, it's not quite as well contained to the touchpad parts as the other patch. There's string duplication for the touchpad key and the key doesn't show up in the keyboard shortcuts dialog. If you can help me what's missing here, that'd be much appreciated. Thanks.
Comment 4 Jens Granseuer 2009-10-27 17:42:01 UTC
Review of attachment 146316 [details] [review]:

If you want the shortcut to appear in the keybindings preferences you need to patch the control-center as well. There's a config file containing all built-in (i.e. handled by g-s-d) shortcuts in capplets/keybindings/00-multimedia-key.xml.in. Apart from the minor nitpicks below the patch looks fine to me.

::: plugins/media-keys/gsd-media-keys-manager.c
@@ +617,3 @@
+{
+        GConfClient *client = manager->priv->conf_client;
+        const char *key = "/desktop/gnome/peripherals/touchpad/touchpad_enabled";

I'd prefer a define for this key, too.

@@ +945,3 @@
                 break;
+        case TOUCHPAD_KEY:
+                do_touchpad_action(manager);

Please add a space here.
Comment 5 Bastien Nocera 2009-10-27 22:36:29 UTC
Move this addition to before the media playback keys:
+        TOUCHPAD_KEY,
         HANDLED_KEYS

I don't think we want that key showing up in the keybindings UI, so no need for a control-center patch.
Comment 6 Peter Hutterer 2009-10-27 23:35:12 UTC
(In reply to comment #4)
> ::: plugins/media-keys/gsd-media-keys-manager.c
> @@ +617,3 @@
> +{
> +        GConfClient *client = manager->priv->conf_client;
> +        const char *key =
> "/desktop/gnome/peripherals/touchpad/touchpad_enabled";
> 
> I'd prefer a define for this key, too.

this is what I meant with the key duplication, the define for this key is part of the first patch but it is in plugins/mouse/gsd-mouse-manager.c.

gsd-media-keys-manager.c doesn't have any defines for keys yet, e.g. do_www_action and do_media_action use the keys as a hardcoded string. so having the key as a char string seems more consistent with the current stuff.
of course, I can simply replace the const char* with a #define (if that is what you meant anyway).

Just let me know what to do and I'll prepare the patch.
Comment 7 Jens Granseuer 2009-10-27 23:53:34 UTC
(In reply to comment #6)
> of course, I can simply replace the const char* with a #define (if that is what
> you meant anyway).

Yeah, that's what I meant. I don't see a good way to avoid the duplication in this case.
Comment 8 Peter Hutterer 2009-10-28 02:10:10 UTC
Created attachment 146403 [details] [review]
0001-Add-keybinding-schema-to-enable-disable-touchpad.patch

Updated patch, changes to previous patch:
- touchpad key moved up to before the media keys in the enum, the schema and the keys[HANDLED_KEYS] array.
- const char* changed to a #define
- space after do_touchpad_action
Comment 9 Jonathan Blandford 2009-10-28 02:16:29 UTC
Just to add to this, it would be worthwhile adding some user feedback, when this is triggered.  For example, Lenovo pops up an on-screen-display informing you that it changed and giving you the chance to cancel if you hit it accidentally.
Comment 10 Bastien Nocera 2009-10-28 14:23:18 UTC
Then we'd need an icon for it. I must admit that, yes, adding a popup for it is definitely a blocker, otherwise we'll get bug reports about it.
Comment 11 Peter Hutterer 2009-11-27 01:54:12 UTC
Created attachment 148569 [details] [review]
0001-Display-a-dialog-box-when-enabling-disabling-the-tou.patch

Shows an OSD when disabling/enabling the touchpad. Patch applies on top of the other two.

The actual code changes are quite small, most of the patch is adding the various icons. The icon itself was taken from gnome-icon-theme, with the X overlay from gnome-bluetooth, the Makefile.am resembles what the xrandr plugin does.
Comment 12 Bastien Nocera 2009-11-27 02:16:28 UTC
Move that to the top of the file just below the includes, and we should be good.
+#define TOUCHPAD_ENABLED_KEY "/desktop/gnome/peripherals/touchpad/touchpad_enabled"

The other patch look good to me. Jens?
Comment 13 Peter Hutterer 2009-11-27 03:00:06 UTC
Created attachment 148572 [details] [review]
0001-Add-keybinding-schema-to-enable-disable-touchpad.patch

Changes to previous version:
- define moved up to top of the file (see hunk 4)

Feel free to squash those patches into one before committing, I mostly kept them separate for easier review.
Comment 14 Jens Granseuer 2009-11-27 16:35:08 UTC
One question, though: bug 602986 says the icon has been added to g-i-t. I suppose that means we don't need to ship it with g-s-d, then?
Comment 15 Peter Hutterer 2009-11-29 23:07:18 UTC
the icon in gnome-icon-theme adds it to the 'devices' icon list. what we need in g-s-d seems to be the icons in 'actions', and we need the disable one with the little red cross in addition. (The need for the icons to be in 'actions' seems to be a requirement from the OSD, I didn't dig further into that since it makes sense for this anyway)

so the touchpad-enable icons are is the same as the input-touchpad icon in g-i-t. This introduces duplication which isn't ideal but until we have a way to programmatically overlay icons with the red X that duplication seems unavoidable.
Comment 16 Tobias Wolf 2009-12-01 16:26:24 UTC
The original bug description explains that Fn-F8 is a three-way toggle between trackpoint and touchpad. The key is even printed with a split trackpoint|touchpad pictogram.

I would like to be able to toggle the touchpad off, but leave the trackpoint on.
Comment 17 Peter Hutterer 2009-12-01 22:56:48 UTC
It's a three-way toggle in windows and that is a pure software decision. This patch does not disable the trackpoint, regardless of the state of the touchpad.

I wonder about the usefulness of disabling the trackpoint. The touchpad is easily triggered accidentally and with tapping on that can be quite annoying.
But the trackpoint? Even a relatively hard accidental touch doesn't move the cursor by much and it doesn't change focus so the impact is quite minimal. I don't quite see why disabling the trackpoint is needed at all other than to have the same behaviour as windows.
Comment 18 Tobias Wolf 2009-12-02 01:52:53 UTC
Fair enough, I can’t think of a straight-forward and common scenario where one would want to disable the stick either. 

As long as the trackpoint remains enabled my own needs are satisfied.
Comment 19 Matthias Clasen 2010-02-15 14:00:48 UTC
Ping, anything holding this up, still ?

It would be nice to have...