hello all, i am creating a simple macro program and have stumbled uppon a few small problems...
number 1, i can emulate special chars such as '/' (VK_SLASH)
i have tried a number of ways to fix this buy cant get it working,
VK_SLASH returns as an undeclared identifier so i have tried:
keybd_event('/',0,0,0);
and have also tried above with a toupper(), and also with a vk_shift before it, cant get it to work tho
my second problem, is i cant figure out how to press and hold a key with code.
i have tried:
Code:
keybd_event(key,0,0,0);
Sleep(10000);
keybd_event(key, 0, KEYEVENTF_KEYUP, 0);
but that only presses the key once then waits 10 sec then moves on.
i have tried it in a for loop too
Code:
for(int i=0; i<10000; i++)
{
keybd_event(key,0,0,0);
}
keybd_event(key, 0, KEYEVENTF_KEYUP, 0);
and also:
for(int i=0; i<10000; i++)
{
keybd_event(key,0,0,0);
keybd_event(key, 0, KEYEVENTF_KEYUP, 0);
}
(trying every possible solution)
all that does is press the key 10,000 times super fast, its not the same as holding it down. technically i could be the same as holding it down as far as text programs are concerned, but all it causes are freezes/slowdown in graphical hands free presentations.
thx in advance for any light shed on my problem.