VK_SHIFT sticks down till i press it manually
okay well im working on something where i need to use VK_SHIFT well ill show u what i have right now...
Code:
#include <windows.h> // Win32 API function support
INT APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int nShowCmd)
{
// TODO: Now we will perform what we want to do
{
HWND hParent = FindWindow(NULL, "Untitled - Notepad"); // Find window
if (hParent) // Valid window handle?
{
SetForegroundWindow(hParent); // Show the window
SetFocus(hParent); // Set window focus to new window
// Loop through twenty-five
for (int l = 0; l < 25; l++)
{
keybd_event(VK_SHIFT, NULL, KEYEVENTF_EXTENDEDKEY, NULL); // Key down
keybd_event(0x32, NULL, KEYEVENTF_EXTENDEDKEY, NULL); // Key down
keybd_event(0x32, NULL, KEYEVENTF_KEYUP, NULL); // Key up
keybd_event(VK_SHIFT, NULL, KEYEVENTF_KEYUP, NULL); // Key up
}
}
else
return 0; // Invalid window handle; exit
}
return 0;
}
yeah and that will go to a notepad thingy and type a bunch of @@@@@@@@@ and umm then shift is still being held down like if i type something after the program ends shift is stuck down untill i hit it again and i was wondering how to fix this?