是否检测数字键盘的存在/不存在? [英] Detecting the presence/absence of a numeric keypad?

查看:94
本文介绍了是否检测数字键盘的存在/不存在?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以确定是否有数字小键盘连接到系统?台式机键盘通常具有数字键盘,而笔记本电脑通常不具有数字键盘(尽管它们将数字键盘键放在普通键盘中,并通过Num Lock激活).操作系统是否知道小键盘键在物理上是否分开?如果是这样,该信息是否以某种方式公开给程序?

Is it possible to determine whether there is a numeric keypad connected to the system? Desktop keyboards typically have numpads, while laptops typically don't (though they put numpad keys in the normal keyboard, activated with Num Lock). Does the operating system know whether the numpad keys are physically separate? And if so, is that information exposed to programs somehow?

知道这一点对确定适当的默认键绑定很有用.如果该功能不可用,那么我要么必须选择一个保守的默认值(不使用数字键盘),这意味着有些恼人的额外配置步骤才能使具有单独数字键盘的用户获得更好的行为,否则,我将不得不选择一个非默认数字键盘.保守默认并激怒没有小键盘的人...

It would be useful to know this to determine appropriate default key-bindings. If it's not available then I'll either have to pick a conservative default (not using the numpad), which means a slightly irritating extra configuration step to get nicer behaviour for people with separate numpads, or I'll have to pick a non-conservative default and irritate the people without numpads...

推荐答案

我不相信您可以查询键盘功能,但是iirc中有一个数字键盘"键. ;)

I don't believe you can query for keyboard capabilities but iirc there is a "numpad" key. ;)

您应该能够查询Num是打开还是关闭,但是关闭它并不是知道没有数字键盘的一种万无一失的方法.

You should be able to query if Num is on or off, but it being off won't be a foolproof way to know that there is no numeric keypad.

您可能要做的就是检测在数字小键盘上按下的按键,并潜移默化地诱使用户这样做,从而识别出所述特征.

What you could probably do is detect keys being pressed on a numpad and subliminaly trick the user into doing so, which would identify said characteristic.

这篇关于是否检测数字键盘的存在/不存在?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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