WaitKeyDown doesn't work

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
zopita
Newbie
Posts: 19
Joined: Wed Feb 18, 2009 5:45 pm
Location: Spain

WaitKeyDown doesn't work

Post by zopita » Thu Feb 24, 2011 2:39 pm

I need to use WaitKeyDown command but I have problems. I tried with keys "complex" (106, buttonleft for example) and also keys simple as x. The macro stops, but it doesnt work when I press the key.

I write code like this:

WaitKeyDown>VK106
WaitKeyDown>x

I have seen that there are enough questions on this subject but I have not found an answer. ¿Can you help me?

¡Thanks!

User avatar
JRL
Automation Wizard
Posts: 3524
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Feb 24, 2011 9:31 pm

Does the following work for you?

Code: Select all

message>With focus on this window press%CRLF%        AND HOLD%CRLF%%CRLF%%tab%a
WaitKeyDown>a
mdl>%CRLF%%CRLF%%CRLF%%tab%a%CRLF%%CRLF%       Was pressed

zopita
Newbie
Posts: 19
Joined: Wed Feb 18, 2009 5:45 pm
Location: Spain

Problems continue

Post by zopita » Mon Mar 07, 2011 11:19 am

Hi JRL,

Your code (as WaitKeyDown) works sometimes. I reinstalled Macro Scheduler but I still have problems. If I can fix the macro I'm telling you.

Thank you very much for your reply :)

Win XP, Macro Scheduler 11/01/1912 (both legal)

zopita
Newbie
Posts: 19
Joined: Wed Feb 18, 2009 5:45 pm
Location: Spain

Correcting tests whith WaitKeyDown. Send accented characters

Post by zopita » Tue Mar 08, 2011 9:32 am

Hi JRL,

I've done. I must to press more time. I chose the right arrow key because it is "invisible. "
Here you can see my first trial http://www.youtube.com/watch?v=lZEHTf42EEY. It is made with Word + MacroScheduler + CamStudio. Thanks for your help.

Another question. If the Send command contains accented characters (very common in Spanish) returns the ascii code. For example, for "párrafo" I have to write:

Send>p
ascii>225
send>rrafo

because the command

Send>párrafo returns p225rrafo

Paradoxically, the most special Spanish character (ñ) works correctly:

send>moñoño returns moñoño

I would be happy if I could avoid using the command ascii>

Thanks again (and thanks to Google translator ...)

Gloria

User avatar
Marcus Tettmar
Site Admin
Posts: 7394
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Mar 08, 2011 10:16 am

I don't know why the accented chars aren't working for you. This works fine for me:

SetFocus>notepad*
Send>párrafo

If I open Notepad and run that script then párrafo gets correctly written into the Notepad window. Accented and unicode characters are supported in Macro Scheduler.

But which version are you running? Maybe you have an older version?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

zopita
Newbie
Posts: 19
Joined: Wed Feb 18, 2009 5:45 pm
Location: Spain

Macro Scheduler 6 works fine

Post by zopita » Tue Mar 08, 2011 11:41 am

I'm running MacroScheduler 11.1.12. I tried it with an older version (6.2.3e) and works properly.

Maybe it's a Bill Gates joke... I will use ascii command.

Thanks, Marcus.

Gloria

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts