问题描述
是否可以通过编程方式找出计算机具有哪种键盘(即,键位于何处,以及在哪些位置存在额外的键)?
Is there a way to programmatically find out what kind of keyboard a computer has (i.e. where keys are located, and what extra keys are present in which locations)?
如果键盘不是非常标准的,则可以接受一些错误,但总的来说,重点是构建一个类似于屏幕的键盘应用程序,该应用程序可以高精度地在屏幕上动态绘制键盘布局.
A little error is acceptable, if the keyboard is very non-standard, but in general, the point is to construct an on-screen keyboard-like application that can dynamically draw the keyboard layout on the screen, with high accuracy.
推荐答案
没有机制可以使键盘告诉Windows物理布局. Windows版本的屏幕键盘osk.exe易于查看.似乎可以猜测机器的外形(笔记本电脑还是台式机),但是在我的笔记本电脑上,它与键盘的布局不匹配.
There is no mechanism by which a keyboard can tell Windows what its physical layout looks like. Easy to see with the Windows version of an on-screen keyboard, osk.exe. It seems to be able to guess the form-factor of the machine (laptop vs desktop) but on my laptop it doesn't match the layout of the keyboard.
使用osk.exe布局作为模板,这样没人可以抱怨您的匹配不正确.
Use the osk.exe layout as a template so nobody can complain that yours doesn't match well.
这篇关于以编程方式获取物理键盘布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!