我创建了一个表格,我有一个bind "f4" for pausing music。当我使用另一个程序时,我可以使用keybind但only when I am using the form,即。谷歌Chrome,and attempted to use f4 for pausing music, the program ignores my key's responds。
如何在使用其他程序时让我的表单响应我的键盘?
希望现在有一个更好的解决方案,但我总是在计时器上使用Win32的GetAsyncKeyState完成此操作。 Import code and Samples
您可以使用Keyboard Hooks执行类似的操作。不幸的是,代码是旧的本机代码。您必须从托管应用程序调用非托管代码。
我尽量避免使用非托管代码,但对于你来说,它可能是一个选项:qazxsw poi