如何在GUI中检测不在GUI中的箭头键? [英] how can I detect arrow keys in java console not in GUI?

查看:198
本文介绍了如何在GUI中检测不在GUI中的箭头键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写应用程序,我需要检测其中的箭头键。
C ++具有getch()函数。
我们想要获取输入,然后添加对ASCII值的检查。

I'm writing an application and I need to detect arrow keys inside it. C++ has the getch() function. We want to take the input and then add a check on ASCII values.

我们如何检测输入箭头键?
谢谢

How can we detect input arrow keys? Thanks

推荐答案

我写了一个Java类 RawConsoleInput 使用 JNA 调用Windows和Unix的操作系统功能。它可用于读取箭头键,但Windows和Unix上的字符代码不同。

I have written a Java class RawConsoleInput that uses JNA to call operating system functions of Windows and Unix. It can be used to read the arrow keys, but the character codes are different on Windows and Unix.

这篇关于如何在GUI中检测不在GUI中的箭头键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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