qbjim Oct 26, 2013 @ 6:16pm
How to: Work around keyboard mapping problems (quickfire gadgets, shift key, extra mouse buttons) using AutoHotkey
What's the problem?
  • Cannot use shift as a modifier key for mappings (e.g. in previous games you could map right click to counter and shift+right click to instant takedown).
  • Cannot remap quick fire gadgets (e.g. have to use double tap on 1 instead of q to get quickfire baterang). Personally I find this unbearable!
  • Cannot use fourth and fifth buttons on mouse in keyboard mappings (not everyone has this problem). (Here the third button is clicking the scroll wheel.)
Update: The second and third problems are now fixed in the game! So most of the script is no longer needed, and I've commented it out. I recommend remapping the quickfire keys and mapping to the extra mouse buttons directly in the game. However this is still useful for mapping combinations with the shift key (I use various shift+mouse button for special combo moves, and shift+1-6 to get to the later gadgets).


What's the solution (well, workaround)?
  • Download AutoHotkey[www.autohotkey.com]
  • Create a new script, and paste the text at the bottom of this post into it
  • Remap a few keys in game: Grapnel to L, the instant takedown etc to U,I,O,P.
  • Run the script every time before you play the game (and exit it afterwards).

Anything else to note?
  • As it is, this script is set up to use my personal favourite mappings, which may not suit everyone. For instance, all the combat special combos are mapped to shift+mouse button, which is not exactly the same as Arkham City defaults. But it's fairly easy to tweak the file.
  • Of course, the in-game prompts will be wrong.
  • This seems a bit unlikely, but maybe using this in multiplayer could be construed as cheating, since you can use quickfire gadgets more easily. Use your own judgment.

Where's the script then!?
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

#IfWinActive Batman

; Quick fire controls
;q::Send 11 ; baterang
;^q::Send 11 ; baterang (while crouching)
;*+q::Send 44 ; multi-baterang (use shift+q)
;*f::Send 22 ; batclaw
;*c::Send 33 ; explosive gel
;*e::Send -- ; ??
;*r::Send 55 ; ??

; Alternative gadget shortcuts e.g. shift+2 instead of 8
*+1::Send 7
*+2::Send 8
*+3::Send 9
*+4::Send 0
*+5::Send -
*+6::Send {=}

; Third and fourth mouse buttons
;XButton1::Send {l Down} ; grapnel - you must have remapped to L in game!
;XButton1 Up::Send {l Up} ; map down/up presses separately to allow holding ledge
;^XButton1::Send {l Down} ; grapnel, also allow if crouching
;^XButton1 Up::Send {l Up}
; *XButton2::Send 11 ; quick baterang on other button

; Special combo moves (instant takedown etc)
; You must have remapped these to UIOP in game!
*+RButton::Send U
*+LButton::Send I
*+MButton::Send P
*+XButton1::Send O

; Because I've used q, e, f for gadgets, we need some other way
; of navigating the tab screen. I've chosen , and . (below < and >)
; f and r is used for changing floors on the map inside some buildings
;,::Send q
;.::Send e
;/::Send f
;'::Send r
Last edited by qbjim; Jan 4 @ 11:24am
Showing 1-15 of 15 comments
< >
BLADE. Oct 27, 2013 @ 3:29am 
Thanks bunch. The gadget shortcuts saved me.
fightah Oct 27, 2013 @ 9:35am 
Thanks.
Rysenberg Oct 27, 2013 @ 9:40am 
Brilliant mate! I have auto hotkey, but am totally clueless when it comes to writing scripts.
qbjim Oct 27, 2013 @ 10:35am 
I've made a small update to the script. Q and E are used for navigating the tab menu (map, WayneTech, etc), so I've also mapped keys to those (, and .) so that it's still possible to navigate it when those keys are remapped.
fAg.Siegfried Oct 27, 2013 @ 11:15am 
Bump.
Tadian Oct 27, 2013 @ 12:11pm 
Holding the Grapple (hang on a ledge instead of jumping over) doenst work with XButton1. Do you have a solution for this?

//EDIT
After a few tries I managed to make it work. But it looks a bit sloppy to me, I have no idea of AutoHotKey btw :D

Maybe someone has a better solution?

//EDIT 2
Ok... now it doesnt work anymore. No idea why it did in the first place...

XButton1::
while GetKeyState("XButton1","P")
{
if GetKeyState("XButton1","P")
Send {l down}
else
send {l up}
}

// EDIT 3
Seems to work now :)
XButton1::
while GetKeyState("XButton1","P")
Send {l down}
send {l up}
Last edited by Tadian; Oct 27, 2013 @ 12:47pm
qbjim Oct 27, 2013 @ 2:34pm 
Fantastic, thanks Tadian! I've now updated the post (I did it in a slightly different way to you).

I had no idea that you could this. I knew you could make this choice back in Arkham Asylum - you would always hang if you pressed nothing else, and to jump up too you also had to hold space. I assume they noticed too many people forgetting how to make that choice so they changed it to decide automatically in Arkham City, but I didn't realise you could override the choice.
Rysenberg Oct 27, 2013 @ 7:40pm 
You seem very crafty with AH. Could you tell me how to add a line that lets one keypress = pressing LMB+RMB together?

This is for remote control batarang U-turns.

Thanks!
qbjim Oct 30, 2013 @ 2:38pm 
If it were keyboard presses, I think you'd want to simulate the up and down presses separately, like this:

*x::Send {a Down}{b Down}{b Up}{a Up}

The star at the start means do it even if there are other keys like shift held down.

I guess with mouse clicks you want to do something similar, but I don't have any experience. I seem to remember reading that you need to pass in coordinates for where the click goes, so maybe there's some problems there. But maybe games ignore that anyway, so I'd say give (0,0) a go and see if that works (if not, you'll soon know because it'll make the camera jerk suddenly).
qbjim Nov 6, 2013 @ 11:15am 
Hi everyone, I've updated the script again. I added two extra keys that map to F and R because you need them in the tab menu (they navigate between maps of different floors of multistory buildings).

More importantly, I've now got through enough of the game that I've earned all gadgets that have a quickfire (I think!), and I updated the script to match. Sorry about the slight spoiler that one is the multi-baterang (making a return from Arkham Asylum), there was no other way to explain why I mapped Q->11 and shift+Q->44. I don't think multi-baterang is much use on quickfire anyway; in combat you can quickfire up to three individual baterangs without losing your combo. Maybe it's useful in predator if you find yourself suddenly confronted with three bad guys, facing the other way but about to turn round.

I left the remaining two gadgets a mystery. (Except for the fact that one is on the dash key. They were really expecting us to double tap that in combat!?!?)
Rysenberg Dec 17, 2013 @ 3:34pm 
Hello again. How do you determine the window name for the line #IfWinActive Batman?

I'm trying to create a script for Assassin Creed Black Flag, but I don't know how define the active window name. Please advise.
EbonHawk Dec 17, 2013 @ 4:48pm 
I have never used AutoHotKey, but I found this page...

http://www.autohotkey.com/docs/Tutorial.htm

There's a part that says:
To activate a window (make it foremost), use WinActivate. To detect whether a window exists, use IfWinExist or WinWait. The following example illustrates these commands:...
etc, etc, etc.

I'm guessing you'll have to find out the name of the game's "window" you're working with. Does AC4 allow you to toggle Fullscreen and Windowed mode? Press Alt+Enter when it's running and see if there's a title in the window's menu bar when it goes into windowed mode. Usually, there's something there.

Maybe that will point you in the right direction. Because honestly, I don't know anything about it.

This page talks about issuing a command called GetWinTitle to retrieve the title of a window. That might help too.

http://www.autohotkey.com/board/topic/44040-tutorial-for-newbies/
Last edited by EbonHawk; Dec 17, 2013 @ 4:53pm
qbjim Dec 23, 2013 @ 5:50am 
I've updated the script yet again! I really really think this is the final version :-) The changes:
  • I noticed that when I implemented the grapnel suggestion above, which changed the behaviour of the first extra mouse button, I broke the binding for ground multi-takedown, which was on Shift+that button (I like all the special combo moves to be shift+mouse button). I fixed that.
  • I commented out the quick fire baterang being mapped to the second extra mouse button (it was, and still is, also mapped to Q). I kept triggering it by accident, and never used it deliberately. You can uncomment that line if you still want it.

Captain Serious: While running the game, I just Alt+Tabbed out of it. I then used Alt-tab again and looked at what it said for that program. It said Batman™: Arkham Origins or something, so I just used Batman to avoid putting the unicode trademark character in the script (it probably would have worked, but I was just being cautious). Note that by default #IfWinActive matches characters at the *start* of the title.
qbjim Jan 4 @ 11:31am 
I know I said the last one would be the final version, but now the script is updated again. The reason is a good one - several issues in the game have been fixed! We can now map individual buttons to quickfire gadgets, and we can map combinations involving the two mouse thumb buttons. As an aside, starting a glide kick while already gliding is also fixed. Yay!

The quickfire keys that you are allowed to map in game are the same ones as my script, minus multi baterang, but that's not really more useful than a normal baterang. Oddly, you can also map a key to quickfire smoke pellet, and you can use it in a fight without losing your combo, but it doesn't contribute to your gadget variation bonus (this is like deathstroke's analogous gadget). I assume this is mainly intended for predator mode.

This script is still useful for one of its original three reasons: it lets you map key combinations involving shift, which I like for special combo moves (like instant takedown and disarm&destroy) and for accessing the later gadgets (i.e. shift+4 instead of 9 for the decoder).
EbonHawk Jan 5 @ 6:57am 
I REALLY need to check this out. Unfortunately, I think I'm burnt out on BAO now and loaded up Driver San Francisco last night. I'm currently on my 8th playthrough of BAO (4 different games with a normal and NG+ playthrough) and I think I've had enough for awhile. I appreciate your hard work on this and I think it would have made a world of difference if I had started using it early in my playthroughs, because it is a HUGE pain in the bum to select gadgets # 6 through =!!! (Who at WB thought that was a good idea?!?! I bet their car's accelerator pedal is on the ♥♥♥♥ing hood!)

If I play BAO much more I'll try it out. Thanks!
Showing 1-15 of 15 comments
< >
Per page: 15 30 50
Date Posted: Oct 26, 2013 @ 6:16pm
Posts: 15