AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with wheel down and wheel up please help
Goto page 1, 2  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
fenix



Joined: 16 Sep 2006
Posts: 21

PostPosted: Fri Oct 12, 2007 4:45 pm    Post subject: Problem with wheel down and wheel up please help Reply with quote

SendMode Input

setbatchlines, -1

WheelDown::sendinput {down}
WheelUp::sendinput {up}

ok so thats my script, it works in windows but when i tab in game (warcraft 3) the wheel down doesnt work
Back to top
View user's profile Send private message
daonlyfreez



Joined: 16 Mar 2005
Posts: 745
Location: Berlin

PostPosted: Fri Oct 12, 2007 4:52 pm    Post subject: Reply with quote

Many times AHK's hotkeys do not work in DirectX/OpenGL games. On scripting the settings/in-game console you might have luck however. Depends.

Confused
_________________
(sorry, homesite offline atm)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
fenix



Joined: 16 Sep 2006
Posts: 21

PostPosted: Fri Oct 12, 2007 4:57 pm    Post subject: Reply with quote

not sure i understand what you mean....
no console in warcraft 3..
Back to top
View user's profile Send private message
fenix



Joined: 16 Sep 2006
Posts: 21

PostPosted: Fri Oct 12, 2007 5:21 pm    Post subject: Reply with quote

weird part is it works in other games so not sure it has anything to do with direct x
Back to top
View user's profile Send private message
Guest






PostPosted: Fri Oct 12, 2007 5:28 pm    Post subject: Reply with quote

hmm doesnt work in quake so i guess you are right... what do i do :/
Back to top
Guest






PostPosted: Fri Oct 12, 2007 9:44 pm    Post subject: Reply with quote

please help :/
Back to top
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Sat Oct 13, 2007 1:09 am    Post subject: Reply with quote

please research the use of controlsend in games.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
fenix



Joined: 16 Sep 2006
Posts: 21

PostPosted: Sat Oct 13, 2007 1:19 am    Post subject: Reply with quote

i have spend atleast 5 hours searching forums and autohotkey help for info with no luck so far =/

edit: hmm been looking into this controle send, dont really understand how it works..
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 2558
Location: Australia, Qld

PostPosted: Sat Oct 13, 2007 5:38 am    Post subject: Reply with quote

Often SetKeyDelay is the answer. See the manual for usage.
Quote:
SetKeyDelay [, Delay, PressDuration, Play]

SetKeyDelay wrote:
Certain games and other specialized applications may require a delay inside each keystroke; that is, after the press of the key but before its release.
Back to top
View user's profile Send private message
fenix



Joined: 16 Sep 2006
Posts: 21

PostPosted: Sat Oct 13, 2007 5:15 pm    Post subject: Reply with quote

im such a noob, could you please tell me excatly how to modify my script so it works?
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 2558
Location: Australia, Qld

PostPosted: Sun Oct 14, 2007 2:22 am    Post subject: Reply with quote

Try
Code:
SetKeyDelay, , 50

Quote:
Note: SetKeyDelay is not obeyed by SendInput; there is no delay between keystrokes in that mode. This same is true for Send when SendMode Input is in effect.

Also try using SendPlay instead of Send (assuming you don't have SendMode,Play.) To set key delay for SendPlay (may not be necessary):
Quote:
SendPlay does not use the standard settings of SetKeyDelay and SetMouseDelay. Instead, it defaults to no delay at all, which can be changed as shown in the following examples:
Code:
SetKeyDelay, 0, 10, Play  ; Note that both 0 and -1 are the same in SendPlay mode.
SetMouseDelay, 10, Play
Back to top
View user's profile Send private message
fenix



Joined: 16 Sep 2006
Posts: 21

PostPosted: Sun Oct 14, 2007 10:30 am    Post subject: Reply with quote

like this?
____

SetMouseDelay, 10, Play

WheelDown::sendplay {down 5}


Wheelup::sendplay {up 5}

____

Didnt work Sad
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 2558
Location: Australia, Qld

PostPosted: Sun Oct 14, 2007 12:54 pm    Post subject: Reply with quote

No.
Quote:
SetMouseDelay
Sets the delay that will occur after each mouse movement or click.
This refers to MouseMove, MouseClick, Click, etc. (simulating mouse input), not mouse hotkeys. You are sending keyboard input, so try SetKeyDelay. Also, 10 milliseconds may not be enough.

It can be called from the auto-execute section to set the default:
Code:
SetKeyDelay, , 50, Play

or in the hotkey itself:
Code:
WheelDown::
  SetKeyDelay, , 50, Play
  sendplay {down 5}
return
Note that it is the second parameter, PressDuration, not Delay.

Then again, looking at this script for Warcraft III, it doesn't seem to need anything special for Send to work. It seems to use the default send mode (SendEvent) - have you tried your script without SendMode Input, and Send or SendEvent instead of SendInput?

Rereading your original post, you say wheel down doesn't work. Does that mean
Code:
WheelUp::sendinput {up}
does work? And WheelDown should send {down} but doesn't? Confused
Back to top
View user's profile Send private message
Guest






PostPosted: Sun Oct 14, 2007 6:32 pm    Post subject: Reply with quote

no neather of them work
Back to top
Guest






PostPosted: Sun Oct 14, 2007 6:36 pm    Post subject: Reply with quote

WheelDown::
SetKeyDelay, , 50, Play
sendplay {down 5}
return

that worked! thank you so much Very Happy even worked with 10 instead of 50
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group