In c++ how do i check if a key is pressed ( not GetAsyncKeyState/GetKeyState because when I hold it down it spams the command)
bobo bobo bobo
Code:int main()
{
while (1)
{
if (GetAsyncKeyState(VK_INSERT)) {
//Command
}
}
}
Printable View
In c++ how do i check if a key is pressed ( not GetAsyncKeyState/GetKeyState because when I hold it down it spams the command)
bobo bobo bobo
Code:int main()
{
while (1)
{
if (GetAsyncKeyState(VK_INSERT)) {
//Command
}
}
}
dude that is simple code
Code:
int main()
{
bool pressed = false;
while (1)
{
if (GetAsyncKeyState(VK_INSERT) && !pressed) {
pressed = true;
//Command
} else {
pressed = false;
}
}
}