Page 1 of 1
Rule for keyboardHold and key.VK_ALT
Posted: Tue Mar 16, 2010 9:47 pm
by el_dios85
Hello,
I want to ask, when we do a multiclient, multiclient1 and multiclient2, multiclient1 have the function keyboardHold(key.VK_ALT), and then we switch to multiclient2, why the function keyboardHold(key.VK_ALT) dont work. If we go back to multiclient1 it works. I assume keyboardHold(key.VK_ALT) only work on active window. Is it true? Is there any way to make the function work in unactive window?
Thanks
Re: Rule for keyboardHold and key.VK_ALT
Posted: Tue Mar 16, 2010 10:29 pm
by Administrator
You send it as the modifier to a key press.
Code: Select all
keyboardPress(key.VK_SOMETHING, key.VK_ALT);
Re: Rule for keyboardHold and key.VK_ALT
Posted: Wed Mar 17, 2010 7:49 am
by el_dios85
I try keyboardPress(key.VK_1, key.VK_ALT);
and keyboardPress(key.VK_ALT, key.VK_1);
the error is the same.
182: Wrong number of parameters supplied to keyboardPress().
this is my code before
--keyboardHold(key.VK_ALT); -- The A key will be held down
--yrest(50);
--keyboardPress(key.VK_1);
--yrest(50);
--keyboardRelease(key.VK_ALT); -- The A key is now released
--keyboardBufferClear();
Re: Rule for keyboardHold and key.VK_ALT
Posted: Wed Mar 17, 2010 10:25 pm
by Administrator
You're using an outdated version, then. Redownload.
Re: Rule for keyboardHold and key.VK_ALT
Posted: Thu Mar 18, 2010 9:17 am
by el_dios85
Now I use micromacro v.1.0
It didnt work.
I have try
---------------
keyboardPress(key.VK_1, key.VK_ALT);
---------------
keyboardSetDelay(100);
keyboardPress( key.VK_V, key.VK_CTRL );
--In my game (Perfect World), it only write v on chat box, I already copy "0" so it must paste "0"
---------------
Is there any clue?
Thanks
Re: Rule for keyboardHold and key.VK_ALT
Posted: Fri Mar 19, 2010 4:49 am
by el_dios85
I have try
---------------
keyboardPress(key.VK_ALT, key.VK_1);
---------------
keyboardPress(key.VK_1, key.VK_ALT);
---------------
keyboardSetDelay(100);
keyboardPress( key.VK_V, key.VK_CTRL );
--Still write "v"
---------------
Re: Rule for keyboardHold and key.VK_ALT
Posted: Fri Mar 19, 2010 9:18 am
by Administrator
Code: Select all
keyboardPress(key.VK_V, key.VK_CONTROL)
This should do it. If not, then it's a problem with the way the game was programmed, I think.
Re: Rule for keyboardHold and key.VK_ALT
Posted: Fri Mar 19, 2010 8:21 pm
by el_dios85
keyboardPress(key.VK_V, key.VK_CONTROL); --This work but
keyboardPress(key.VK_V, key.VK_ALT) -- dont work
keyboardPress(key.VK_V, key.VK_LALT) -- dont work
keyboardPress(key.VK_V, key.VK_RALT) -- dont work
so the function keyboardHold is active on active window only and not active on multiclient that unactive?
Is that right?
Re: Rule for keyboardHold and key.VK_ALT
Posted: Fri Mar 19, 2010 8:59 pm
by Administrator
keyboardHold() works in attached mode, but not with modifiers. You can hold VK_CONTROL, VK_ALT, and VK_SHIFT, but it doesn't always work with key combinations. That is, holding VK_ALT and pressing A will not necessarily result in ALT+A. This entirely depends on how the game's input handler was programmed.
What is ALT+V supposed to do, anyways? Have you tried using VK_MENU instead of VK_ALT?
Re: Rule for keyboardHold and key.VK_ALT
Posted: Fri Mar 19, 2010 10:53 pm
by el_dios85
I'm sory I mean keyboardPress(key.VK_1, key.VK_ALT).
ALT + 1 is the shortcut for attack monster.
thanks
Re: Rule for keyboardHold and key.VK_ALT
Posted: Sat Mar 27, 2010 9:06 pm
by el_dios85
Hello, may I ask again?
In my game the function
=====================================================
--code1
keyboardHold(key.VK_ALT); -- The A key will be held down
yrest(50);
keyboardPress(key.VK_1);
yrest(50);
keyboardRelease(key.VK_ALT); -- The A key is now released
keyboardBufferClear();
===================================================== work
--code2
keyboardPress(key.VK_1, key.VK_ALT); -- didnt work
--code3
keyboardPress( key.VK_V, key.VK_CTRL ); -- work
Is there any possiblilities code1 work and code2 didnt work?
Re: Rule for keyboardHold and key.VK_ALT
Posted: Sat Mar 27, 2010 9:10 pm
by Administrator
That is entirely because of the way the game reads input. Holding ALT and then using keyboardPress() does not generate a ALT+key message as only the key was sent (while the ALT hold was separate). There's nothing that can be done about that.
In the second example, try using key.VK_MENU instead of key.VK_ALT with the attached executable.
Re: Rule for keyboardHold and key.VK_ALT
Posted: Tue Mar 30, 2010 6:39 pm
by el_dios85
Thank you, I have try VK_MENU and it didnt work. But I think the problem is from the game. I want to start a new topic about Mouse Control. see you