gpt4 book ai didi

linux - linux/input.h 键码布局是否独立?

转载 作者:太空宇宙 更新时间:2023-11-04 10:20:13 25 4
gpt4 key购买 nike

例如,在 input.h 中,KEY_D 等于 32。在 QWERTY 键盘上,D 是主行左数第三个“可打印”键。在 DVORAK 键盘上,相同的键被标记为 E。因此,如果我在 DVORAK 键盘上按 E,我会得到 KEY_D (32) 还是 KEY_E (18)?

最佳答案

您将获得KEY_D。这些值是键的抽象,因为它们被放置在典型的物理键盘上(参见 ISO 9995 ),在从所有接口(interface)细节(参见例如 three PC scancode sets 和其他网格)中抽象出来之后。但这还没有考虑其他布局,既没有像 AZERTY 这样的国家布局,也没有像 Dvorak 这样的特殊布局。它们在下一层实现,其中独立的键码受修饰符影响并转换为结果字符串和事件。

USB“HID使用表”document明确地说:

Note A general note on Usages and languages: Due to the variation of keyboards from language to language, it is not feasible to specify exact key mappings for every language. Where this list is not specific for a key function in a language, the closest equivalent key position should be used, so that a keyboard may be modified for a different language by simply printing different keycaps. One example is the Y key on a North American keyboard. In Germany this is typically Z. Rather than changing the keyboard firmware to put the Z Usage into that place in the descriptor list, the vendor should use the Y Usage on both the North American and German keyboards. This continues to be the existing practice in the industry, in order to minimize the number of changes to the electronics to accommodate other languages.

因此,即使您的键盘最初是 Dvorak,您也会得到 KEY_D。如果满足(大多数 XKB 布局源使用此表示法),您可以将其视为“通用”KEY_C03(再次参见 ISO9995 键名称)。

关于linux - linux/input.h 键码布局是否独立?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44218131/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com