diff --git a/main.cpp b/main.cpp index 2e8513f..e855b27 100644 --- a/main.cpp +++ b/main.cpp @@ -17,6 +17,7 @@ int getKeyboardType(){ setlocale(LC_ALL, "Rus"); + printf("Keyboard type: "); switch(GetKeyboardType(0)){ case 1: printf(" 83-key keyboard for IBM PC/XT-compatible computers\n"); @@ -48,12 +49,24 @@ int getKeyboardType(){ int getKeyboardState(BYTE massive[256]){ - if (GetKeyboardState(massive) == 0){ + + if (GetKeyboardState(massive) == 0) + { printf("KS - Error\n"); } - else{ + else + { printf("KS - notError\n"); } + + if (massive[VK_CONTROL] & 0x80) + { + printf("CONTROL has been pressed\n"); + } + else + { + printf("CONTROL not been pressed\n"); + } return 0; } int getAsyncKeyState(){ @@ -79,20 +92,23 @@ int getCursorPos(){ } return 0; } -int setKeyboardState(BYTE massive[256]){//переделать - LPBYTE key = 0; - SetKeyboardState(key); - - +int setKeyboardState(){//переделать + BYTE state[256]; + state[VK_CONTROL] = 0x80; + SetKeyboardState(state); + getKeyboardState(state); + return 0; } int systemParametersInfo(){//передалтьV PVOID parametr; UINT uint; - if (SystemParametersInfo(SPI_GETBEEP, uint, parametr, uint) == 0){ + if (SystemParametersInfo(SPI_GETBEEP, uint, parametr, uint) ==0) + { printf("SPI - Error\n"); } - else { + else + { printf("SPI - notError\n"); } return 0; @@ -138,16 +154,16 @@ int clipCursour(){//переделатьV } int main() { + BYTE massive[256]; setlocale(LC_ALL, "Rus"); getKeyboardType(); getKeyboardState(massive); getCursorPos(); - setKeyboardState(massive); + setKeyboardState(); systemParametersInfo(); setCarietBlinkTime(); setSystemParametrsInfo(); - //getAsyncKeyState(); //clipCursour(); return 0; }