From: Craig C. <cra...@ni...> - 2007-10-15 22:11:26
|
Hi, I hate to spam a newsgroup with newbie questions, so if there is a better forum for my question, please point me there and I won't clutter this mailing list again. I'm using Win32::GuiTest v1.50.5 to control a game and want to add a calibration step where the user clicks on certain areas of the screen so my program knows roughly where certain icons will be. The questions below relate to that. 1) Recorder/Win32GuiTest.exe pretty much does what I need. Am I correct in assuming the source code for it is not Perl? If it is Perl, is the source code available? I don't see it in the distribution. 2) I wrote a very short script to see if I could detect mouse clicks and movement. It partially works. Below is the code: #!perl -w use strict; use Win32::GuiTest qw(:ALL :VK); for (my $i=0; $i<=3; $i++) { while (! IsKeyPressed("a")) {}; ## This works #while (! IsKeyPressed(VK_DOWN)) {}; ## This does not work my ($x, $y) = GetCursorPos(); print "Button pressed while mouse at $x, $y\n"; SendKeys"{PAUSE 200}"; } This is supposed to wait for four keypresses of the specified key and print the location of the mouse cursor each time. It works fine when the 'a' key is used, but I can't get any of the VK* keys to work. I've tried VK_LBUTTON, VK_DOWN, and VK_NUMPAD0. Any idea what I'm doing wrong? Is there a better way to wait for a mouse click or a key press? 3) I'd like to use Win32::GuiTest v1.54 or v1.55, but I don't have a C compiler or nmake on my system. Is there a PPM-able version of 1.55? I saw the emails about the latest version being released on CPAN, but PPM still only finds v1.30. Thanks very much, Craig |