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 

Cannot map ALT + ` (tilde button) to Middle Button for game

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
rerail



Joined: 07 Sep 2008
Posts: 5

PostPosted: Sun Sep 07, 2008 5:03 am    Post subject: Cannot map ALT + ` (tilde button) to Middle Button for game Reply with quote

Hi, I'm new to AHK, and I've always been bad at scripting, but I am trying to assign ALT + `(the tilde button) to the middle mouse button for use in a game. I've tried everything I can think of and nothing is succesful.

I have tried the SC code for the ` button, different ways of applying ALT to it, and I've troubleshot different maps using the ` button, and alt-combinations, all of which work fine within the game.

The simplest method I've tried:
MButton::!`

The most complicated method:
MButton::Send {LAlt Down}{sc029}{LAlt Up}

I'm sure I'm overlooking something simple, but would really appreciate help with this problem. It's driving me crazy!!

thanks Smile
Back to top
View user's profile Send private message
Slanter



Joined: 28 May 2008
Posts: 397
Location: Minnesota, USA

PostPosted: Sun Sep 07, 2008 6:11 am    Post subject: Reply with quote

Do you actually want to send a tilde (~) or the grave key (`)? If you're going for the tilde, use
Code:
MButton::!~
Otherwise, the first one you posted should work just fine.
_________________
Unless otherwise stated, all code is untested

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.
Back to top
View user's profile Send private message Visit poster's website
rerail



Joined: 07 Sep 2008
Posts: 5

PostPosted: Sun Sep 07, 2008 6:17 am    Post subject: Reply with quote

I want the grave key, but I tested, and it doesn't matter if it's tilde. So my code is correct then, but it still wont work. I think the problem is combining the ALT with the character? is there a special method for games that I'm not aware of? I did try searching, but don't even know where to begin - its such a seemingly simple problem.

Thanks for replying.
Back to top
View user's profile Send private message
Slanter



Joined: 28 May 2008
Posts: 397
Location: Minnesota, USA

PostPosted: Sun Sep 07, 2008 7:21 am    Post subject: Reply with quote

Maybe something like this?
Code:
MButton::SendPlay, !``

_________________
Unless otherwise stated, all code is untested

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.
Back to top
View user's profile Send private message Visit poster's website
rerail



Joined: 07 Sep 2008
Posts: 5

PostPosted: Sun Sep 07, 2008 7:59 am    Post subject: Reply with quote

hmm.. still no joy..

I've been doing further experimentation, and I can remap to a single keypress, but combining alt with any keypress (tested on F10) is unsuccessful.

I've been scouring the forums, and am beginning to think this may be a game where it wont work. But the forums for the game itself say there is no hack-detection software.

The game is Angels Online, and all I want to do is change weapon with my Middle Button!!
Back to top
View user's profile Send private message
[VxE]



Joined: 07 Oct 2006
Posts: 1496

PostPosted: Sun Sep 07, 2008 8:59 am    Post subject: Reply with quote

Code:
SetKeyDelay, 20, 80
#IfWinActive, YourGame'sWindowTitleHere
  $MButton::Send {LAlt Downtemp}{``}{LAlt Up}
Question
Some games use their own hooks and/or ignore key presses that are released too quickly.
_________________
My Home Thread
More Common Answers: [1]. It's in the FAQ [2]. Ternary ( a ? b : c ) guide [3]. Post code inside [code][/code] tags !
Back to top
View user's profile Send private message
rerail



Joined: 07 Sep 2008
Posts: 5

PostPosted: Sun Sep 07, 2008 7:10 pm    Post subject: Reply with quote

Awesome!!! that worked! Smile You're my hero! Smile Thank you so much

I'm about to look through the help and make sense of it (I'm terrible at scripting

Thanks again!
Back to top
View user's profile Send private message
rerail



Joined: 07 Sep 2008
Posts: 5

PostPosted: Tue Sep 09, 2008 11:46 pm    Post subject: Reply with quote

I have been looking around at examples and scripts and I have 2 questions about that code:

what is $Mbutton? and why does that work where Mbutton doesn't?

why does Downtemp make a difference?

I have tried to find the answers myself, but haven't been able to work it out.

Thanks!
Back to top
View user's profile Send private message
Slanter



Joined: 28 May 2008
Posts: 397
Location: Minnesota, USA

PostPosted: Wed Sep 10, 2008 2:00 am    Post subject: Reply with quote

The Manual wrote:
Hotkey $ Prefix:
This is usually only necessary if the script uses the Send command to send the keys that comprise the hotkey itself, which might otherwise cause it to trigger itself. The exact behavior of the $ prefix varies depending on operating system:

On Windows NT4/2k/XP or later: The $ prefix forces the keyboard hook to be used to implement this hotkey, which as a side-effect prevents the Send command from triggering it. The $ prefix is equivalent to having specified #UseHook somewhere above the definition of this hotkey.

On Windows 95/98/Me: The hotkey is disabled during the execution of its thread and re-enabled afterward. As a side-effect, if #MaxThreadsPerHotkey is set higher than 1, it will behave as though set to 1 for such hotkeys.
From the Hotkey page. Guessing this is just because it forces the script to use the keyboard hook.

The Manual wrote:
The word DownTemp may also be used. Its effect is the same as Down except for the modifer keys (Control/Shift/Alt/Win). In those cases, DownTemp tells subsequent sends that the key is not permanently down, and may be released whenever a keystroke calls for it. For example, Send {Control DownTemp} followed later by Send a would produce a normal "a" keystroke, not a control-A keystroke.
From the Send page. I think this one is like this just so LAlt doesn't get stuck down somehow.
_________________
Unless otherwise stated, all code is untested

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.
Back to top
View user's profile Send private message Visit poster's website
clitzsky
Guest





PostPosted: Thu Oct 16, 2008 9:32 pm    Post subject: Reply with quote

Hi..
i'm also still new here and don't know everything..
but i still can understand about da basically script learned from the tutorial...

i'm also playing angels online..
and i'm also looking on how to make center scroll button mouse can use same function with alt+` when in game..

the code that [VxE] give to rerail that rerail said its work,but i still don't work for me..and i cannot understand it..

Code:
SetKeyDelay, 20, 80
#IfWinActive, Angels Online - Archillies(Malaysia-1)
  $MButton::Send {LAlt Downtemp}{``}{LAlt Up}


is it still have something code i need to put before that code?

pls someone help me..thanx[/code]
Back to top
BioBrain



Joined: 13 Feb 2008
Posts: 15
Location: Jakarta-Indonesia

PostPosted: Fri Oct 17, 2008 12:04 pm    Post subject: Reply with quote

Code:
SetKeyDelay, 20, 80
#IfWinActive, Angels Online - Archillies(Malaysia-1)
  $MButton::SendPlay {LAlt Downtemp}{``}{LAlt Up}


Maybe change Send to SendPlay should work.
_________________
I need knowledge to feed my brain.
Back to top
View user's profile Send private message Yahoo Messenger
Sivvy



Joined: 21 Jul 2008
Posts: 711
Location: Calgary, AB, Canada

PostPosted: Fri Oct 17, 2008 2:32 pm    Post subject: Reply with quote

If you do that, also change:
Code:
SetKeyDelay, 20, 80, Play
#IfWinActive, Angels Online - Archillies(Malaysia-1)
  $MButton::SendPlay {LAlt Downtemp}{``}{LAlt Up}

If that doesn't work, try this:

Code:
SetTitleMatchMode, 2
SetKeyDelay, 20, 80, Play
#IfWinActive, Angels Online
  $MButton::SendPlay {LAlt Downtemp}{``}{LAlt Up}
Back to top
View user's profile Send private message MSN Messenger
Freakjb



Joined: 16 Oct 2008
Posts: 1

PostPosted: Fri Nov 21, 2008 1:25 am    Post subject: Reply with quote

oh thanx a lot guyz..
dat code worked...
juz with one click in center button [scroll button] of da mouse same just like click "alt+~" on keyboard.
but can i know,what code needed to change dat function from one click to scroll up down using scroll button same just like click alt+~..

example:
if i scroll up...same juz like click alt+~
and..
if i scroll down..it also same juz like click alt+~
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
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