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

Discuss, ask for help, share ideas, give suggestions, read tutorials, and tell us about bugs you have found with MicroMacro in here.

Do not post RoM-Bot stuff here. There is a subforum for that.
Forum rules
This is a sub-forum for things specific to MicroMacro.

This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
Post Reply
Message
Author
aliex
Posts: 12
Joined: Thu Feb 10, 2011 6:54 am

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

#1 Post by aliex » Fri Feb 11, 2011 12:15 pm

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.

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

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

#2 Post by Administrator » Fri Feb 11, 2011 1:20 pm

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?

aliex
Posts: 12
Joined: Thu Feb 10, 2011 6:54 am

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

#3 Post by aliex » Fri Feb 11, 2011 1:57 pm

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).

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

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

#4 Post by Administrator » Fri Feb 11, 2011 2:28 pm

Try running it in detached mode to see if it works then.

aliex
Posts: 12
Joined: Thu Feb 10, 2011 6:54 am

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

#5 Post by aliex » Sat Feb 12, 2011 10:13 am

Administrator wrote:Try running it in detached mode to see if it works then.
doesnt work either... what now? :/

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

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

#6 Post by Administrator » Sat Feb 12, 2011 2:58 pm

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?

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

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

#7 Post by rock5 » Thu Feb 17, 2011 7:01 am

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?
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

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

#8 Post by Administrator » Thu Feb 17, 2011 4:31 pm

Could be anything, really. The code for handling key modifiers was changed many times, including several fixes and a few times it was broken.

Alkaiser
Posts: 222
Joined: Sat Sep 25, 2010 2:03 pm

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

#9 Post by Alkaiser » Fri Apr 22, 2011 2:06 pm

Given these limitations... is it even possible to type a capitol letter without being able to hold shift down?

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

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

#10 Post by Administrator » Fri Apr 22, 2011 2:34 pm

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.

Alkaiser
Posts: 222
Joined: Sat Sep 25, 2010 2:03 pm

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

#11 Post by Alkaiser » Fri Apr 22, 2011 4:48 pm

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests