Mega Man X Legacy Collection

Mega Man X Legacy Collection

Not enough ratings
How to Remap Keyboard Controls to Whatever
By The_NothingForEverything
This guide will allow you to fix the lack of proper keyboard support and bind the controls to whatever keys you want, including WASD or similar for movement.

NOTE: I came across an alternative solution that solves all the shortcomings I faced with remapping software. For more info, see that other guide instead.
https://sp.zhabite.com/sharedfiles/filedetails/?id=3320143320
   
Award
Favorite
Favorited
Unfavorite
Intro
The keyboard support of Megaman X Legacy Collection has a number of limitations. The in-game option to rebind the controls resets every time the game is launched, and you can only bind to ASDFZXCV. Also, no options are available to remap the movement keys from the arrow keys, and the config.ini file does not allow you to configure the keyboard controls either.

To get around these limitations and bind the game's controls to whatever keys you want, other software is needed. Although other options exist, for this guide, we will be using Autohotkey, which is a safe, free, and efficient way to accomplish this.

EDIT 2: Thanks to a similar guide by Miagui here, I was able to fix the dropped inputs in X7 and X8 by adding some optimizations. I also found another fix in a thread about using autohotkey with games. Both are included in the sample autohotkey script below (altered to fit the conventions of autohotkey V2).

EDIT: Just as a note, I was able to finish X1-X4 with no hiccups using this method. From my testing so far, x5 and x6 work fine as well. However, in X7 and X8 only, there are issues with dropped inputs on the remapped keys, which make them unplayable using this method. I was unable to fix this with autohotkey, but I did find that another remapping tool called 'reWASD' worked with these games. Therefore, if you wish to play X7 or X8 with remapped keyboard controls, I recommend you use reWASD instead. Unlike autohotkey, which requires you to write a script, reWASD has a intuitive UI for remapping controls however you want, but the downside is that it is paid software. As of the time of writing, it has a free trial available, so you can easily try it out and pay for it later if it is worth it for you.
Download and Install Autohotkey
First, download and install Autohotkey from https://www.autohotkey.com/.
Create the Autohotkey File with your Bindings
Go to the folder where Steam installed the game, for example: C:\Program Files (x86)\Steam\steamapps\common\Mega Man X Legacy Collection\.

Next, right click and select new -> AutoHotkey Script, then give it a name such as "keybindings", select the option "minimal for v2" if available, then click create. Alternatively, create a text file then give it the ".ahk" file extension instead.

Once the ahk file is created, open it with notepad or another text editor, then use autohotkey's syntax to create the mapping from the game's default keyboard controls to your desired controls line-by-line.

https://www.autohotkey.com/docs/v2/KeyList.htm
The basic syntax you'll want to use for each keybinding line is
desiredkey::defaultkey

For example, a line with
w::up
will map the w key to the up arrow key.

For reference, here are the default keyboard controls for Megaman X1-X3, taken from the in-game option screen


To make sure that the bindings only take effect when the game is running, wrap the bindings between lines with
#HotIf WinActive("ahk_exe RXC1.exe")
and
#HotIf

The following line is also helpful to stop a warning message from popping up if you press too many of your bindings within the span of a couple of seconds.
A_MaxHotkeysPerInterval := 2000

Lines that start with ';' are comments that will be ignored by Autohotkey

Your file should end up resembling something like the following:
A_MaxHotkeysPerInterval := 2000 #HotIf WinActive("ahk_exe RXC1.exe") <list of bindings> #HotIf

Here is a sample file, which binds movement to esdf, dash to left shift, jump to spacebar, and the other actions to the keypad. Additional Optimizations are included to make X7 and X8 playable. Feel free to use it as a template for your own bindings. Note that the 'rehook' line should only be uncommented as a last resort if x7 and x8 are still dropping inputs with these optimizations, because it will introduce another problem where you are unable to hold down your bindings for long.
#Requires AutoHotkey v2.0 SendMode "Event" ; uncomment for Rehook if you experience dropped inputs in x7 and x8 despite optimizations ;SetTimer Rehook, 50 ;Prevent maxhotkeys warning with a high value A_MaxHotkeysPerInterval := 2000 ; other helpful optimizations #MaxThreadsPerHotkey 255 KeyHistory 0 ListLines 0 ProcessSetPriority("A",) SetKeyDelay -1, -1 ;Bind keys for Megaman X Legacy Collection #HotIf WinActive("ahk_exe RXC1.exe") || WinActive("ahk_exe RXC2.exe") ;Movement e::up d::down s::left f::right ; Shoot Numpad1::x ; Jump Space::z ; Dash LShift::a ; Save/load screen action and learned move/regular buster in x4-x6 Numpad0::s ; Switch weapon left Numpad2::d ; Switch weapon right Numpad3::c ; RT / R2 Giga attack Numpad4::f w::f ; LT / L2 Special Technique Numpad5::v r::v ; In-game menu NumpadEnter::Space Enter::Space ; Legacy collection menu Escape::Tab ; Tutorial tips in x7 F1::Escape #HotIf Rehook() { InstallKeybdHook return }
Run your Autohotkey File and Launch the game
Once the autohotkey file is made, run it by double clicking it or right clicking and selecting 'Open Script'. If the script is running successfully, you will be able to see it on the system tray

Now you are ready to launch the game and play using your own keyboard bindings.

The script needs to be running before launching the game, but it might be possible to automate this by having the script launch the game automatically using some autohotkey command (documentation is available at https://www.autohotkey.com/docs/v2/), compiling it into an exe file, and then launching the game from a shortcut of that exe instead of directly from steam.
4 Comments
PLMMJ 17 Dec, 2024 @ 6:11am 
All good
The_NothingForEverything  [author] 17 Dec, 2024 @ 4:38am 
Thanks for pointing this out @PLMMJ

Uncommented the line for the dash bind. Probably commented it out by mistake when I last edited this guide months ago.
PLMMJ 13 Dec, 2024 @ 7:02am 
Update: Apparently that line was commented out for some unknown reason.
PLMMJ 13 Dec, 2024 @ 5:36am 
There's a slight bug; if you set dash to the Z key, then Z still makes you jump. Or I might just be a moron who forgot how the game controls and dashing is some button combination involving jump.