如何在Linux上使用Java应用程序获取数字小键盘箭头 [英] How to get numeric keypad arrows working with java applications on Linux
问题描述
数字小键盘上的箭头键不适用于Linux上的Java应用程序。奇怪的是,Home,End,PgUp,PgDn,Ins,Del都可以工作。
The arrow keys on the numeric keypad do not work with Java applications on Linux. Strangely enough, the Home, End, PgUp, PgDn, Ins, Del all work.
使用Intellij进行编程时,这尤其令人讨厌。
This is especially annoying when using Intellij for programming.
如何使箭头键工作?
推荐答案
键盘上的物理键映射到使用 xkb 的密码。以下是我在Linux的Debian派生词上使用java应用程序(如Intellij)的数字键的方法:
Physical keys on a keyboard are mapped to key codes using xkb. Here's how I got numeric keys working with java applications (like Intellij) on a Debian derivative of Linux:
- 切换到root用户
- cd / usr / share / X11 / xkb / symbols
- cp keyboard keypad.original ( (以防万一)
- 编辑键盘并替换所有出现的 KP_Up , KP_Down , KP_Left & KP_Right Up , Down , Left & 正确,分别
- 保存
- dpkg-reconfigure xkb-data
- 重新启动
- Switch to root user
- cd /usr/share/X11/xkb/symbols
- cp keypad keypad.original (just in case)
- Edit keypad and replace all occurrences of KP_Up, KP_Down, KP_Left & KP_Right with Up, Down, Left & Right, respectively
- Save
- dpkg-reconfigure xkb-data
- Reboot
现在,数字小键盘将发出常规箭头键代码而不是java无法识别,数字键盘,箭头,键码。
Now the numeric keypad will emit the regular, arrow, key codes and not the java-unrecognised, numeric keypad, arrow, key codes.
这篇关于如何在Linux上使用Java应用程序获取数字小键盘箭头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!