diff options
author | Andreas Wettstein <wettstein509@solnet.ch> | 2014-02-15 17:36:51 +0100 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2015-09-29 12:21:34 -0400 |
commit | 5447ac45bc090e8f3269979af4db55f619c5f278 (patch) | |
tree | 6c1b3c435bf5ed7f7c138e05bb64739e6e09541b /xkb | |
parent | fbac451724f7e1b8ce6b6e0505cc33ccd41c5158 (diff) |
xkb: Suppress autorepeat for Set and Lock of Mods, Groups, and Controls
The autorepeat for these actions was not correctly implemented, as the key
repeat would be mistakenly interpreted as key releases. Rather than fixing
this, this change simply disables autorepeat for Set/Lock actions, for two
reasons:
- Autorepeating Set/Lock keys make complicate the interactions of actions.
- Autorepeating Set/Lock keys have no apparent benefit, but hurt in the real
world for layouts such as de(neo): Neo has a Level5 shift on the LSGT key,
and a Level5 lock on Level5 of the same key. This is unusable if LSGT
autorepeats. However, disabling autorepeat for key LSGT completely is not
ideal for users that have a "usual" layout besides Neo, where LSGT carries
symbols.
Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'xkb')
-rw-r--r-- | xkb/xkbActions.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c index 9dd1cbd3b..96190601d 100644 --- a/xkb/xkbActions.c +++ b/xkb/xkbActions.c @@ -181,6 +181,7 @@ _XkbFilterSetState(XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction *pAction) { if (filter->keycode == 0) { /* initial press */ + AccessXCancelRepeatKey(xkbi, keycode); filter->keycode = keycode; filter->active = 1; filter->filterOthers = ((pAction->mods.mask & XkbSA_ClearLocks) != 0); @@ -354,6 +355,9 @@ static int _XkbFilterLockState(XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction *pAction) { + if (filter->keycode == 0) /* initial press */ + AccessXCancelRepeatKey(xkbi, keycode); + if (pAction && (pAction->type == XkbSA_LockGroup)) { if (pAction->group.flags & XkbSA_GroupAbsolute) xkbi->state.locked_group = XkbSAGroup(&pAction->group); @@ -678,6 +682,7 @@ _XkbFilterControls(XkbSrvInfoPtr xkbi, ctrls = xkbi->desc->ctrls; old = *ctrls; if (filter->keycode == 0) { /* initial press */ + AccessXCancelRepeatKey(xkbi, keycode); filter->keycode = keycode; filter->active = 1; filter->filterOthers = 0; |