[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#564327: a solution



Hi

I don't know about OP, but at least the later poster will likely find the following useful.

I got the commands working as desired by clearing Control and Mod1 _after_ resetting the code.

I too got the error message [1] when I ran `xmodmap .Xmodmap', and I too got it working correctly when I ran `xmodmap .Xmodmap' once more. As can be seen from the output of `xmodmap -pm', for some reason, mere reassigning of keycodes sets Mod1 and Control too. (Note, however, that doing the same thing via keysyms does not do it.) So, you need to clear Mod1 and Control _after_ the reassigning, and _then_ populate the Mod1 and Control yourself.

Command: setxkbmap -layout us -variant dvp ; xmodmap .Xmodmap
~/.Xmodmap fragment [2] fails with error [1], fragment [3] succeeds.

[1]:
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  118 (X_SetModifierMapping)
  Value in failed request:  0x17
  Serial number of failed request:  18
  Current serial number in output stream:  18

[2]:
clear Mod1
clear Control
keycode 64 = Control_L
keycode 108 = Control_R
keycode 37 = Alt_L
keycode 105 = Alt_R
add Mod1 = Alt_L Alt_R
add Control = Control_L Control_R

[3]:
keycode 64 = Control_L
keycode 108 = Control_R
keycode 37 = Alt_L
keycode 105 = Alt_R
clear Mod1
clear Control
add Mod1 = Alt_L Alt_R
add Control = Control_L Control_R

Additional information: As mentioned above, using keysyms, instead of keycodes, avoids the problem. So, .Xmodmap fragment [4] succeeds. Also, the workaround provided in [5] (sleep for 15s) did not work for me.

[4]:
clear Mod1
clear Control
keysym Alt_L = Control_L
keysym Alt_R = Control_R
keysym Control_L = Alt_L
keysym Control_R = Alt_R
add Mod1 = Alt_L Alt_R
add Control = Control_L Control_R

[5]:
https://bbs.archlinux.org/viewtopic.php?id=147823

Reply to: