Simulate Keypress
Posted: Sun Aug 25, 2013 1:01 pm
hey, I've been trying to work out this problem, if someone could help me would be much appreciated
I came across this
on rawKeyDown theKeyNumber
put theKeyNumber
pass rawKeyDown
end rawKeyDown
(which gives me the key number for the designated key)
so I tried the script below hoping it would work but I guess im doing it wrong.
on mouseUp
rawKeyDown 65289 ( but just gives error (button "Button": execution error at line 2 (Handler: can't find handler) near "rawKeyDown", char 1)
end mouseUp
but what Im trying to do is when I click the button in my program it launches a exe file, then I need to simulate a key press so it will do a few tasks like a macro.
some of the keys I need to work are alt, (65513) and tab (65289) for example.
and if possible to have the code press alt & tab at same time.
im trying to work through the livecode lessons and university at the moment but any help with this would help a lot.
Thanks
I came across this
on rawKeyDown theKeyNumber
put theKeyNumber
pass rawKeyDown
end rawKeyDown
(which gives me the key number for the designated key)
so I tried the script below hoping it would work but I guess im doing it wrong.
on mouseUp
rawKeyDown 65289 ( but just gives error (button "Button": execution error at line 2 (Handler: can't find handler) near "rawKeyDown", char 1)
end mouseUp
but what Im trying to do is when I click the button in my program it launches a exe file, then I need to simulate a key press so it will do a few tasks like a macro.
some of the keys I need to work are alt, (65513) and tab (65289) for example.
and if possible to have the code press alt & tab at same time.
im trying to work through the livecode lessons and university at the moment but any help with this would help a lot.
Thanks