Page 1 of 1

Alternative to keyboardPress( key.VK_1, key.VK_ALT ); ?

Posted: Fri Feb 11, 2011 12:15 pm
by aliex
Hey Guys...

i get stuck at the point when i want my script to press two keys at the same time.

keyboardPress( key.VK_1, key.VK_LSHIFT ); for example doesnt work for me.

it seems that he only recognizes the "1".

what other possibilities are there to send a two-key-command to the game?

i also tried keyboardHold with both keys and released them. no effect, only the "1" was send.

Re: Alternative to keyboardPress( key.VK_1, key.VK_ALT ); ?

Posted: Fri Feb 11, 2011 1:20 pm
by Administrator
This usually works:

Code: Select all

keyboardHold(key.VK_SHIFT);
keyboardPress(key.VK_1);
keyboardRelease(key.VK_SHIFT);
But, it may or may not work for specific games in attached mode. Did you call attach() or attachKeyboard()? Have you called keyboardSetDelay() to try increasing the delay to 100ms or so?

Re: Alternative to keyboardPress( key.VK_1, key.VK_ALT ); ?

Posted: Fri Feb 11, 2011 1:57 pm
by aliex
Administrator wrote:This usually works:

Code: Select all

keyboardHold(key.VK_SHIFT);
keyboardPress(key.VK_1);
keyboardRelease(key.VK_SHIFT);
But, it may or may not work for specific games in attached mode. Did you call attach() or attachKeyboard()? Have you called keyboardSetDelay() to try increasing the delay to 100ms or so?
i called attach() and keyboardSetDelay(100).

Re: Alternative to keyboardPress( key.VK_1, key.VK_ALT ); ?

Posted: Fri Feb 11, 2011 2:28 pm
by Administrator
Try running it in detached mode to see if it works then.

Re: Alternative to keyboardPress( key.VK_1, key.VK_ALT ); ?

Posted: Sat Feb 12, 2011 10:13 am
by aliex
Administrator wrote:Try running it in detached mode to see if it works then.
doesnt work either... what now? :/

Re: Alternative to keyboardPress( key.VK_1, key.VK_ALT ); ?

Posted: Sat Feb 12, 2011 2:58 pm
by Administrator
I don't know. Every game is programmed differently, so it's hard to write one set of code that works for everything. What game is this even for?

Re: Alternative to keyboardPress( key.VK_1, key.VK_ALT ); ?

Posted: Thu Feb 17, 2011 7:01 am
by rock5
Isn't it worth mentioning that you have to have an up to date micromacro because in some older versions the modifier didn't work? Or was that just for Runes of Magic?

Re: Alternative to keyboardPress( key.VK_1, key.VK_ALT ); ?

Posted: Thu Feb 17, 2011 4:31 pm
by Administrator
Could be anything, really. The code for handling key modifiers was changed many times, including several fixes and a few times it was broken.

Re: Alternative to keyboardPress( key.VK_1, key.VK_ALT ); ?

Posted: Fri Apr 22, 2011 2:06 pm
by Alkaiser
Given these limitations... is it even possible to type a capitol letter without being able to hold shift down?

Re: Alternative to keyboardPress( key.VK_1, key.VK_ALT ); ?

Posted: Fri Apr 22, 2011 2:34 pm
by Administrator
Yes and no. Yes, it is possible to send a character itself. However, rarely does this actually work beyond text editors. Games tend to use DirectInput, which goes by key events and not character events, meaning it wouldn't work.

For this reason, it is recommended you first try using SHIFT as the key modifier, and then try using keyHold and keyRelease prior and after the keyPress for the character you want.

Re: Alternative to keyboardPress( key.VK_1, key.VK_ALT ); ?

Posted: Fri Apr 22, 2011 4:48 pm
by Alkaiser
I'm trying to have micromacro input a secondary password for Runes of Magic. The secondary password has one upper case letter. I tried keyboardHold/keyboardRelease(key.VK_SHIFT) and keyboardPress( key.VK_V, key.VK_SHIFT ) but nothing works. It seems only one key can be pressed at a time.