物理键盘按键的一致标签...可能吗?
我发现 Windows VK_OEM_X 值倾向于引用不同的物理键,这使得它们对于与本地化无关的游戏控件毫无用处。
我正在考虑通过硬编码直接使用扫描码,但这是我的最后手段。
是否有其他方法可以使用 Windows 引用 101 键* 键盘上的物理键?
编辑我还需要使用远东键盘,它们在空格键旁边有额外的按钮。
例如:如果我想在源代码中使用“/”键,我可以引用“!”法语键盘上的键。我不关心按键本身实际打印的内容,也不尝试将按键序列转换为字符。我只是在寻找一个标准的标签系统,不需要针对不同键盘的大量扫描代码库,更不用说检测所使用的键盘类型了。
I have found that the Windows VK_OEM_X values have a tendency to refer to different physical keys, which makes them useless for localization-agnostic game controls.
I am thinking about using scan codes directly by hard-coding them, but that is my last resort.
Is there any other way to reference the physical keys on a 101-key* keyboard using Windows?
edit I also have need to work with far-eastern keyboards, which have the extra buttons next to the space bar.
For example: If I want the '/' key in my source code, I could be referring to the '!' key on a French keyboard. I don't care about what is actually printed on the key itself, nor am I trying to convert key sequences to characters. I am just looking for a standard labeling system that does not require a massive library of scan codes for different keyboards, let alone detecting the type of keyboard being used.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不这么认为。如果有人确定的话,他可能就是这个系列的作者 。
让用户控制按键绑定,将其默认为用户最常使用的 3 个键盘,否则进行提示?
I don't think so. If anyone knows for sure, it is probably the author of this series.
Let the user's control the key bindings, default them for whatever 3 keyboards your users use most commonly, and prompt otherwise?