Im making A program in which c++ presses keys on the keyboard automatically for me. I have done this with every key on the keyboard. It works perfectly EXCEPT for when i am trying to use square brackets '['. If i tell the computer to print out a square bracket, it prints out the square bracket as expected, but it also presses the windows start button, therefore opening the start menu? After some debugging i found that the start menu only popped up after the SendInput function was used to RELEASE THE KEY not when it was pressed. So my question is WHY is this happening? PS Before anyone asks, my code is 100% correct for every key so i know the method i am using works.
ip.ki.wVk = VK_OEM_4; // this is the '[' key
ip.ki.dwFlags = 0;
SendInput(1, &ip, sizeof(INPUT)); // the key has been pressed
ip.ki.dwFlags = KEYEVENTF_KEYUP;
SendInput(1, &ip, sizeof(INPUT)); // the key is released, THE START MENU POPS UP!