Linux 单键按下触发多键组合
我知道可以在线订购新键盘,但现在事实证明这个问题很难,我对此完全着迷。
许多旧的笔记本电脑键盘在佩戴时会形成一致的短路,导致按下单个键时多个键都会做出反应。例如,在我妹妹的电脑上,如果你按“r”,系统会输出“vr”,“i”会输出“,i”等等。
假设用户不是 vim/emacs 高级用户,键盘似乎仍然可以挽救。看来,如果更改键盘驱动程序,按下“r”键会导致计算机接受“退格键r”,“v”就会消失,不再那么麻烦。
Xmodmap XKB 和其他系统似乎假设每个按键都会产生一个命令。有人了解缺失的链接吗?一次按键可以产生多个字符?堆栈中似乎有很多地方可以实现这一点,但没有一个地方有特别清晰的记录。另一个有趣的事实是,你不能在 ubuntu 键盘快捷键编辑器中强制执行此操作,ubuntu 会阻止你在其中输入更改,前提是“这将导致无法键入”。
在 xev 中进行黑客攻击表明,计算机认为当您按下并释放“r”时,它会获得“v”的按键事件,然后是“r”的按键事件,然后是“v”的按键事件,然后是“r”的按键事件。如果您可以更改配置以忽略第一次按键(如果在按下下一个按键之前没有相应的按键释放),那么这也可以。
I understand that new keyboards can be ordered online, but now that this problem has proven to be hard I am completely fascinated by it.
Many old laptop keyboards as they wear develop consistent shorts which cause multiple keys to react when a single key is pressed. For example, on my little sister's computer if you press "r" the system outputs "vr", "i" outputs ",i" and so-on.
Assuming the user is not a vim/emacs power user, the keyboard still seems salvageable. It seems that if the keyboard driver was changed so that pressing the "r" key resulted in the computer accepting "backspace r" the "v" would disappear and not be such a hassle anymore.
Xmodmap XKB and other systems seem to assume that each single key depression will result in a single command. Does anybody understand the missing link where more than one character can come from a single keypress? There seem to be many places in the stack where this can be pulled off, but none of them are particularly clearly documented. Another fun fact is that you can't force this in the ubuntu keyboard shortcuts editor, ubuntu will stop you from entering the changes there under the premise that "this will make it impossible to type."
Hacking around in xev shows that the computer believes that when you hit and release 'r' that it gets a keypress event for 'v' then a keypress event for 'r' then a keyrelease event for 'v' then one for 'r'. If you could change the configuration to ignore a first keypress if there is no corresponding key release before the next key is pressed, that would work too.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论