Bug 93576 - xmodmap clears lock key without ensuring lock state
Summary: xmodmap clears lock key without ensuring lock state
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: App/xmodmap (show other bugs)
Version: 7.7 (2012.06)
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-04 14:29 UTC by chrysn
Modified: 2018-08-10 20:32 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description chrysn 2016-01-04 14:29:37 UTC
xmodmap is frequently used to rebind keyboard modifiers (eg. use the caps lock
key as a control key instead), but leaves the user with no way of ensuring the
now untoggleable state.

for example, assume the following configuration script:

    setxkbmap -layout us
    xmodmap -e 'clear Lock' -e 'keysym Caps_Lock = Control_L' -e 'add Control = Control_L'

this is racy against the use of the caps lock key -- when pressed between the
calls (or in a startup situation, before .Xmodmap is read), caps lock is on,
without any way for the user to turn it off again.

given that xmodmap already takes care not to get into odd situation with
pressed keys ('please release the following keys within 2 seconds'), i think
that equal care should be taken with modes.

my suggested behavior is that at least the `clear` command (maybe even the
`remove` of the last occurrence of a key) should (in sequence of my decreasing
preference, possibly in combination)

* inspect the `clear` command for an additional argument that specifies whether
  the associated mode should stay "on" or "off" (defaulting to "off"?)

* warn the user that a functionality is removed without providing a way of
  setting it in an indeterminate state, hinting at one of the below

* provide an explicit xmodmap command to set the lock state (a la
  XkbLockModifiers)

* reference an external command to be used after invoking xmodmap to set the
  states
Comment 1 GitLab Migration User 2018-08-10 20:32:32 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/app/xmodmap/issues/1.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.