使用 GetKeyState(VK_CAPITAL) & 1 在 Linux 中
#include <windows.h>
int main() {
if ( !GetKeyState(VK_CAPITAL) & 1 ) {
printf("caps off");
}
else
printf("caps on");
return 0;
}
但仅限于 Windows 如何
在 Linux 中使用 gcc 执行此操作?
什么是& 1
在 GetKeyState(VK_CAPITAL) & 1 ?
#include <windows.h>
int main() {
if ( !GetKeyState(VK_CAPITAL) & 1 ) {
printf("caps off");
}
else
printf("caps on");
return 0;
}
but limited to windows only
how to do this in linux with gcc ?
what is & 1
in GetKeyState(VK_CAPITAL) & 1
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于基于 X11 的桌面的最常见情况:
确保您具有 X11 开发标头并使用以下方式进行编译:
从桌面中的控制台窗口运行它:
For the most common case of an X11-based desktop:
Make sure you have the X11 development headers and compile with:
Run it from a console window in your desktop: