! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Sticky Keys gets deactivated randomly
Status:
RESOLVED: FIXED
Product:
Xfce4-settings
Component:
Accessibility Settings

Comments

Description charlie-tca 2010-03-12 20:23:17 CET
This bug was reported on Ubuntu Launchpad as: 
https://bugs.launchpad.net/bugs/192934

I'm currently using Xubuntu 7.10, running Xfce version 4.4.1. The bug is that I've enabled Sticky Keys in the Accessibility options using the Xfce4 Settings Manager (Setting > Keyboard Settings > Accessibility), and yet, very randomly, Sticky Keys gets disabled on its own. This is unlike the bug related to Sticky Keys in the GNOME version, which only happens after bootup. Sticky Keys can get disabled at ANY point of time while using the system, and it's not caused by any specific instance (starting a particular program, etc). The strange thing is that when I go to the same place again, the Sticky Keys option is still activated. Deactivating, and then again activating Sticky Keys solves the problem, but it can occur again during the same session.

This bug has been confirmed in xfce4-settings 4.6.4 in Xubuntu Lucid Lynx, the development version as of 2010-03-12.

There are no errors in ~/.xsession-error log file. It simply quits working after a undetermined period of time.
Comment 1 Rob 2011-01-11 22:36:06 CET
I am disabled (quadriplegic) and use the accessibility functions as I rely on them to operate my computer.  I just installed a new distribution of Fedora 14 XFCE spin.  I right-clicked on the desktop and followed the applications->preferences->accessibility menu and activated the accessibility sticky keys and mouse keys.

If I leave the computer for any length of time both the sticky keys and mouse keys time out and stop working.  I have consistently time this and it is a 2 minute time out.

All of the check boxes (use sticky keys, lock sticky keys, deactivate sticky keys if two keys are pressed and use mouse emulation) remain checked.

The way I get them working again is to clear the Use sticky keys and Use mouse keys check boxes and recheck them.

If I new how to get to the source code I'd offer to help fix this.

Hope this helps,
Rob
Comment 2 Yves-Alexis Perez editbugs 2011-02-24 14:44:22 CET
The sticky keys aren't disabled randomly, they get disabled after 2 minutes without keyboard activity. This is because sticky keys is an xkb property which is “expirable” and the default timeout is 120s:


yaperez@oban: xkbset q exp 
AccessX Timeout = 120
Upon Expiry Audible Bell will be: Unchanged
Upon Expiry Repeat Keys will be: Unchanged
Upon Expiry Mouse-Keys will be: Off
Upon Expiry Mouse-Keys Acceleration will be: Unchanged
Upon Expiry Accessibility Features (AccessX) will be: Unchanged
Upon Expiry Sticky-Keys will be: Off
Upon Expiry Two Keys Mask will be: Unchanged
Upon Expiry Latch to Lock Mask will be: Unchanged
Upon Expiry Slow-Keys will be: Off
Upon Expiry Bounce-Keys will be: Off
Upon Expiry AccessX Feedback will be: Unchanged
Upon Expiry Use Fixed Pitch Bell will be: Unchanged
Upon Expiry Beep when LED changes will be: Off
Upon Expiry Beep on Controls on/off will be: Unchanged
Upon Expiry Beep if Slow/Bounce-Keys about to be turned off will be: Unchanged
Upon Expiry Beep on Slow-Key Press will be: Unchanged
Upon Expiry Beep on Slow-Key Accept will be: Unchanged
Upon Expiry Beep on Slow-Key Reject will be: Unchanged
Upon Expiry Beep on Slow-Key Release will be: Unchanged
Upon Expiry Beep on Bounce-Key Reject will be: Unchanged
Upon Expiry Beep on Sticky-Key Actions will be: Unchanged
Upon Expiry Keyboard Overlay 1 will be: Unchanged
Upon Expiry Keyboard Overlay 2 will be: Unchanged
Upon Expiry Ignore Group Lock will be: Unchanged

What should xfce4-settings-helper do is to ask for no expiration at all or let the user precise the delay after which it should be disable (I think the former is what usually people want).
Comment 3 Yves-Alexis Perez editbugs 2011-02-24 17:56:14 CET
Created attachment 3512 
set stickykeys property not expirable
Comment 4 Yves-Alexis Perez editbugs 2011-02-24 17:56:44 CET
Attached patch fix the problems.
Comment 5 Nick Schermer editbugs 2011-02-24 20:20:09 CET
Does it make sense to make this configurable? A checkbox or is it even possible to control the timeout?
Comment 6 Yves-Alexis Perez editbugs 2011-02-24 20:21:36 CET
(In reply to comment #5)
> Does it make sense to make this configurable? A checkbox or is it even possible
> to control the timeout?

I guess so since the xkb default is to have a 2 min timeout, but I have to admit I fail to see why.
Comment 7 Jérôme Guelfucci editbugs 2011-02-24 22:23:13 CET
For me, it does not make sense to add yet another option for this. There are already three sticky keys options which allow fine-tuning, it's enough IMO.
Comment 8 charlie-tca 2011-02-24 23:18:20 CET
While I agree there should be enough options, there is no option that I can find that says, I am using sticky keys, leave them on for me. Having to hit a key every two minutes when I am already having problems hitting the right keys (the normal reason a user uses sticky keys) does not help that user.
Comment 9 Jérôme Guelfucci editbugs 2011-02-24 23:26:14 CET
I'm not denying that. If was not clear enough, we should just apply Corsac's patch to remove the timeout and not add any additional option. That way, if a user checks 'Use sticky keys', he'll have sticky keys all the time, just as he asked.
Comment 10 Nick Schermer editbugs 2011-02-24 23:44:24 CET
Ok, lets apply it then. For the record, I agree as well, just trying to make people think about it for a bit.

Applied in 38e24bb.
Comment 11 Rob 2011-03-08 14:41:09 CET
While I agree with Jerome that it should not be optional to set time-outs (if you turn them on you expect them to stay on), being a disabled user, two options that would be extremely helpful are:

1) audible beeps when stickykeys are pressed.
   a) beep once when the shift key is pressed, beep again when locking the shift key and a lower tone beep when releasing the shift key.
   b) different tone for both the control key and the alt key.

2) a visual map in the taskbar showing the state of stickykeys.
   a) an icon in the taskbar with a box that turns black when the control key is pressed and cleared when released.
   b) another box for the alt key.
   c) a longer box for the shift key.

These may be current options but if they are they are not clearly configurable.
Comment 12 amcnabb-xfce 2011-03-29 07:50:22 CEST
I'm not really familiar with the internals of xfce4-settings, but it looks at first glance like commit 38e24bb only gets rid of the 120 second timeout for sticky keys. Am I mistaken? I came across this problem because I noticed the timeout for mouse keys, and I just want to make sure that the bug is fixed for mousekeys, too, and not just for sticky keys. Thanks.
Comment 13 Yves-Alexis Perez editbugs 2011-03-29 07:59:28 CEST
(In reply to comment #12)
> I'm not really familiar with the internals of xfce4-settings, but it looks at
> first glance like commit 38e24bb only gets rid of the 120 second timeout for
> sticky keys. Am I mistaken? I came across this problem because I noticed the
> timeout for mouse keys, and I just want to make sure that the bug is fixed for
> mousekeys, too, and not just for sticky keys. Thanks.

This bug report was only against sticky keys, not about mouse keys. It seems that the Mouse Key settings has an expiration time of 120s too so the same would apply indeed. 

Expanding my patch to disable mouse key expiry time shouldn't be too hard if you want to try.
Comment 14 amcnabb-xfce 2011-03-29 08:08:34 CEST
Comment #1 mentioned mouse keys, so I had hoped that the mouse keys and sticky keys would get dealt with together.  Would it work to just repeat the line "SET_FLAG (mask, XkbAccessXTimeoutMask);" a few lines down?  It's not quite clear to me what the axt_ctrls_* lines in the patch do, and I'm not quite sure where to look for xkb documentation.  A simple Google search didn't help too much.
Comment 15 amcnabb-xfce 2011-03-29 08:10:54 CEST
Also, from the "xkbset q exp" output you posted, it looks like slow-keys and bounce-keys will have the same timeout problem as sticky-keys and mouse-keys.
Comment 16 Yves-Alexis Perez editbugs 2011-03-29 08:31:41 CEST
(In reply to comment #14)
> Comment #1 mentioned mouse keys, so I had hoped that the mouse keys and sticky
> keys would get dealt with together.  Would it work to just repeat the line
> "SET_FLAG (mask, XkbAccessXTimeoutMask);" a few lines down?  It's not quite
> clear to me what the axt_ctrls_* lines in the patch do, and I'm not quite sure
> where to look for xkb documentation.  A simple Google search didn't help too
> much.

It'd be more something like that (untested, not even compiled so I don't attach it):


diff --git a/xfsettingsd/accessibility.c b/xfsettingsd/accessibility.c
index 3bf5f21..3c9dccc 100644
--- a/xfsettingsd/accessibility.c
+++ b/xfsettingsd/accessibility.c
@@ -187,8 +187,8 @@ xfce_accessibility_helper_set_xkb (XfceAccessibilityHelper *helper,
         /* we always change this, so add it to the mask */
         SET_FLAG (mask, XkbControlsEnabledMask);
 
-        /* if setting sticky keys, we set expiration too */
-        if (HAS_FLAG (mask, XkbStickyKeysMask))
+        /* if setting sticky keys or mouse keys, we set expiration too */
+        if (HAS_FLAG (mask, XkbStickyKeysMask) || HAS_FLAG(mask, XkbMouseKeyMask))
           SET_FLAG (mask, XkbAccessXTimeoutMask);
 
         /* add the mouse keys values mask if needed */
@@ -278,6 +278,8 @@ xfce_accessibility_helper_set_xkb (XfceAccessibilityHelper *helper,
             if (xfconf_channel_get_bool (helper->channel, "/MouseKeys", FALSE))
             {
                 SET_FLAG (xkb->ctrls->enabled_ctrls, XkbMouseKeysMask);
+                UNSET_FLAG (xkb->ctrls->axt_ctrls_mask, XkbMouseKeysMask);
+                UNSET_FLAG (xkb->ctrls->axt_ctrls_values, XkbMouseKeysMask);
 
                 /* get values */
                 delay = xfconf_channel_get_int (helper->channel, "/MouseKeys/Delay", 160);
@@ -308,6 +310,8 @@ xfce_accessibility_helper_set_xkb (XfceAccessibilityHelper *helper,
             {
                 UNSET_FLAG (xkb->ctrls->enabled_ctrls, XkbMouseKeysMask);
                 UNSET_FLAG (mask, XkbMouseKeysAccelMask);
+                SET_FLAG (xkb->ctrls->axt_ctrls_mask, XkbMouseKeysMask);
+                UNSET_FLAG (xkb->ctrls->axt_ctrls_values, XkbMouseKeysMask);
 
                 xfsettings_dbg (XFSD_DEBUG_ACCESSIBILITY, "mousekeys disabled");
             }

Basically, when setting some flag which has an expiracy, tell that we will touch the timeout mask (this is the first SET_FLAG) and then configure the expiracy itself (disable it when activating the setting and enabling it when disabling the setting).

I don't have time to dig up the documentation for that (I remember it was a bit painful) but the same kind of thing would apply to other “expiracy” settings, so feel free to test that. Sorry, I really don't have time right now to do that.
Comment 17 amcnabb-xfce 2011-03-29 19:54:31 CEST
Created attachment 3588 
fix for sticky keys, slow keys, bounce keys, and mouse keys

I am attaching a patch based on Yves-Alexis' initial patch. This should work for sticky keys, slow keys, bounce keys, and mouse keys. I've tested it with mouse keys, and it seems to work.
Comment 18 amcnabb-xfce 2011-03-29 19:55:42 CEST
By the way, would someone be willing to reopen the bug until the patch is applied? Thanks!
Comment 19 Jérôme Guelfucci editbugs 2011-03-30 18:28:09 CEST
Thanks for your work, the patch looks ok. Would mind rebasing it against current git master branch?

Thanks in advance!
Comment 20 Maks Verver 2011-03-31 21:53:15 CEST
Created attachment 3592 
fix for accessibility features rebased to HEAD
Comment 21 Maks Verver 2011-03-31 21:56:01 CEST
(In reply to comment #19)
> Thanks for your work, the patch looks ok. Would mind rebasing it against
> current git master branch?

I've attached a patch that should apply cleanly to the current HEAD but is otherwise identical to amcnabb's patch (thanks for that, by the way!)
Comment 22 amcnabb-xfce 2011-03-31 23:02:13 CEST
Maks, you're welcome for the patch, and thanks for doing the rebasing.
Comment 23 Jérôme Guelfucci editbugs 2011-03-31 23:24:16 CEST
Pushed to git master and xfce-4.8, thank you both for your work!
Comment 24 Nick Schermer editbugs 2011-05-19 09:19:07 CEST
*** Bug 5661 has been marked as a duplicate of this bug. ***

Bug #6305

Reported by:
charlie-tca
Reported on: 2010-03-12
Last modified on: 2011-05-19
Duplicates (1):
  • 5661 Mouse Emulation spontaneously turns off

People

Assignee:
Stephan Arts
CC List:
7 users

Version

Attachments

Additional information