bosshunts Posted April 10, 2014 Share Posted April 10, 2014 Is it possible to make this program do an action if I press a certain key? For example. If I press 'a', can I make it push 1? I tried to do this: begin if PressKey('a') then PressKey(chr(49)); wait (1000); end. But I had the error "Type Mismatch" Can anyone help? Quote Link to comment Share on other sites More sharing options...
Wanted Posted April 10, 2014 Share Posted April 10, 2014 http://wiki.scar-divi.com/GetCurrentKeyState Quote Link to comment Share on other sites More sharing options...
bosshunts Posted April 10, 2014 Author Share Posted April 10, 2014 I was looking for more of an example. lol Quote Link to comment Share on other sites More sharing options...
slacky Posted April 10, 2014 Share Posted April 10, 2014 PressKey does what it says.. it presses a key. You need to check the STATE of the key.. So GetCurrentKeyState would work fine. begin if GetCurrentKeyState('a') then PressKey(chr(49)); Wait (1000); end. Also, the Wiki contains an example which is as clear as sunny day: begin repeat Wait(500) until GetCurrentKeyState(VK_DOWN); WriteLn('Pressed down'); end. Quote Link to comment Share on other sites More sharing options...