如何在Linux上使用Java应用程序获取数字小键盘箭头 [英] How to get numeric keypad arrows working with java applications on Linux

查看:192
本文介绍了如何在Linux上使用Java应用程序获取数字小键盘箭头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

数字小键盘上的箭头键不适用于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:


  1. 切换到root用户

  2. cd / usr / share / X11 / xkb / symbols

  3. cp keyboard keypad.original ( (以防万一)

  4. 编辑键盘并替换所有出现的 KP_Up KP_Down KP_Left & KP_Right Up Down Left & 正确,分别

  5. 保存

  6. dpkg-reconfigure xkb-data

  7. 重新启动

  1. Switch to root user
  2. cd /usr/share/X11/xkb/symbols
  3. cp keypad keypad.original (just in case)
  4. Edit keypad and replace all occurrences of KP_Up, KP_Down, KP_Left & KP_Right with Up, Down, Left & Right, respectively
  5. Save
  6. dpkg-reconfigure xkb-data
  7. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆