I have this as the first line of my script.
OnEvent>KEY_DOWN,VK_F1,,GetDataPos
Then I have this subroutine.
SRT>GetDataPos
GetCursorPos>nXPos,nYPos
Let>Dialog1.Caption=Robo:%nXPos%,%nYPos%
End>GetDataPos
I run the script and move the mouse somewhere on the screen, press F1 and nothing. I put a breakpoint in the subroutine and repeat as above and nothing. The subroutine isn't getting called. I can't see why not.
Any help appreciated.
KEY_DOWN Event
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Do you have anything else in your script? If not it will exit before you can blink your eyes, so it won't do anything.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Good catch JRL. Yes, it should be as JRL posted it. Sorry I missed the obvious.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
That worked, thanks. I seem to have found that in the script at the SRT end it doesn't return to wherever it was when the KEY_DOWN event happened. I had to add a Goto after the SRT end to force flow back to my loop. Is that normal behaviour or have I missed something about event traps?JRL wrote:I couldn't make this work with your syntax. I've always used the form VK(number) so in the case of F1 it will be VK112. Also even with VK112 in the line I also need a value in the parameter after the VK for the . Try this and see what happens.
OnEvent>KEY_DOWN,VK112,0,GetDataPos
Anyway, thanks very much for your help.