#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
?
#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
?
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: