| View previous topic :: View next topic |
| Author |
Message |
rerail
Joined: 07 Sep 2008 Posts: 5
|
Posted: Sun Sep 07, 2008 5:03 am Post subject: Cannot map ALT + ` (tilde button) to Middle Button for game |
|
|
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  |
|
| Back to top |
|
 |
Slanter
Joined: 28 May 2008 Posts: 397 Location: Minnesota, USA
|
Posted: Sun Sep 07, 2008 6:11 am Post subject: |
|
|
Do you actually want to send a tilde (~) or the grave key (`)? If you're going for the tilde, use 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 |
|
 |
rerail
Joined: 07 Sep 2008 Posts: 5
|
Posted: Sun Sep 07, 2008 6:17 am Post subject: |
|
|
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 |
|
 |
Slanter
Joined: 28 May 2008 Posts: 397 Location: Minnesota, USA
|
Posted: Sun Sep 07, 2008 7:21 am Post subject: |
|
|
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 |
|
 |
rerail
Joined: 07 Sep 2008 Posts: 5
|
Posted: Sun Sep 07, 2008 7:59 am Post subject: |
|
|
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 |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 1496
|
Posted: Sun Sep 07, 2008 8:59 am Post subject: |
|
|
| Code: | SetKeyDelay, 20, 80
#IfWinActive, YourGame'sWindowTitleHere
$MButton::Send {LAlt Downtemp}{``}{LAlt Up} |
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 |
|
 |
rerail
Joined: 07 Sep 2008 Posts: 5
|
Posted: Sun Sep 07, 2008 7:10 pm Post subject: |
|
|
Awesome!!! that worked! You're my hero! 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 |
|
 |
rerail
Joined: 07 Sep 2008 Posts: 5
|
Posted: Tue Sep 09, 2008 11:46 pm Post subject: |
|
|
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 |
|
 |
Slanter
Joined: 28 May 2008 Posts: 397 Location: Minnesota, USA
|
Posted: Wed Sep 10, 2008 2:00 am Post subject: |
|
|
| 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 |
|
 |
clitzsky Guest
|
Posted: Thu Oct 16, 2008 9:32 pm Post subject: |
|
|
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
|
Posted: Fri Oct 17, 2008 12:04 pm Post subject: |
|
|
| 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 |
|
 |
Sivvy
Joined: 21 Jul 2008 Posts: 711 Location: Calgary, AB, Canada
|
Posted: Fri Oct 17, 2008 2:32 pm Post subject: |
|
|
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 |
|
 |
Freakjb
Joined: 16 Oct 2008 Posts: 1
|
Posted: Fri Nov 21, 2008 1:25 am Post subject: |
|
|
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 |
|
 |
|