That will switch the keys, when freelancer is the active window, but I'm after a toggle, so that I can change them back and forth when I want. Your script won't do that.
I need to be able to switch between the two on a keypress, and I can't get that working.
I think my script is close, but obviously not right.
(08-17-2017, 01:15 AM)maddog_dave Wrote: That will switch the keys, when freelancer is the active window, but I'm after a toggle, so that I can change them back and forth when I want. Your script won't do that.
I need to be able to switch between the two on a keypress, and I can't get that working.
I think my script is close, but obviously not right.
Heeeeeeeeeeelp.
Well, ofcourse not, that was not my intention at that point. The previous script switches the keys just fine and it works for steering in game.
The trouble is, that althought what you want seems rather simple, it is in fact not that easy to achieve. Or at least, I have not figured the way yet.
The following AHK script does switch WASD and Arrow Keys in Freelancer and can be toggled On/Off by F12.
The trouble here is, that although it does work correctly when in the chatbox, the game does not recognize the keys for ship movement. Obviously, this will need some more work.
#IfWinActive ahk_class Freelancer
{
; Disable Hotkeys on Autohotkey start.
Hotkey, w, Off
Hotkey, a, Off
Hotkey, s, Off
Hotkey, d, Off
Hotkey, Up, Off
Hotkey, Left, Off
Hotkey, Down, Off
Hotkey, Right, Off
To give a little information on this from what I know.
Having different keymaps is impossible without the use of third party tools as mentioned prior. There is one way it would work but it would require a dev patch and an update to the launcher if I'm not mistaken. Freelancer by default loads all saves and pref files from C:\Users\X\Documents\My Games\Freelancer. It is possible to hijack common.dll to load them from the install dir meaning you could have a "cap" install and a "snub" install each one with a different control set.
By using the following code the devs could change it to allow such.
Offset 0A2FB1: Change 56 6A 00 6A 00 68 05 80 to C7 06 2E 2E 00 00 EB 0E
Offset 0A300A: Change 21 to 0C
Offset 0A3018: Change 13 to 7C
Offset 0A30BE: Change 56 6A 00 6A 00 68 05 80 to C7 06 2E 2E 00 00 EB 0E
Offset 142690: Change ["My Game"] to "Saves" 00
If devs did that it would load the files from the install directory. This would also move screenshots there as well. Two folders would appear, "Saves" and "Shots". Shots would contain screenshots when you PrintScreen and saves would contain everything else like multiplayer save data or single player saves (including restart.fl which would remove the cross mod crash).
As said before, this means nothing unless the devs add this, which I highly doubt they'd do.
To give a little information on this from what I know.
Having different keymaps is impossible without the use of third party tools as mentioned prior. There is one way it would work but it would require a dev patch and an update to the launcher if I'm not mistaken. Freelancer by default loads all saves and pref files from C:\Users\X\Documents\My Games\Freelancer. It is possible to hijack common.dll to load them from the install dir meaning you could have a "cap" install and a "snub" install each one with a different control set.
By using the following code the devs could change it to allow such.
Offset 0A2FB1: Change 56 6A 00 6A 00 68 05 80 to C7 06 2E 2E 00 00 EB 0E
Offset 0A300A: Change 21 to 0C
Offset 0A3018: Change 13 to 7C
Offset 0A30BE: Change 56 6A 00 6A 00 68 05 80 to C7 06 2E 2E 00 00 EB 0E
Offset 142690: Change "My Game" to "Saves" 00
If devs did that it would load the files from the install directory. This would also move screenshots there as well. Two folders would appear, "Saves" and "Shots". Shots would contain screenshots when you PrintScreen and saves would contain everything else like multiplayer save data or single player saves (including restart.fl which would remove the cross mod crash).
As said before, this means nothing unless the devs add this, which I highly doubt they'd do.
This version works for me. Try it out.
The toggle button needs to be pressed twice, before it starts working properly. No idea why.
But you can use AutoHotkey for other purposes as well.
; UP UP UP UP UP UP UP UP UP UP UP UP UP UP UP
$up::
If SwitchKeys = 1
SendInput {w down}
Else
SendInput {Up down}
Return
$up up::
If SwitchKeys = 1
SendInput {w up}
Else
SendInput {Up up}
Return
; UP UP UP UP UP UP UP UP UP UP UP UP UP UP UP
; LEFT LEFT LEFT LEFT LEFT LEFT LEFT LEFT LEFT
$Left::
If SwitchKeys = 1
SendInput {a down}
Else
SendInput {Left down}
Return
$Left up::
If SwitchKeys = 1
SendInput {a up}
Else
SendInput {Left up}
Return
; LEFT LEFT LEFT LEFT LEFT LEFT LEFT LEFT LEFT
; DOWN DOWN DOWN DOWN DOWN DOWN DOWN DOWN DOWN
$Down::
If SwitchKeys = 1
SendInput {s down}
Else
SendInput {Down down}
Return
$Down up::
If SwitchKeys = 1
SendInput {s up}
Else
SendInput {Down up}
Return
; DOWN DOWN DOWN DOWN DOWN DOWN DOWN DOWN DOWN
; RIGHT RIGHT RIGHT RIGHT RIGHT RIGHT RIGHT RIG
$Right::
If SwitchKeys = 1
SendInput {d down}
Else
SendInput {Right down}
Return
$Right up::
If SwitchKeys = 1
SendInput {d up}
Else
SendInput {Right up}
Return
; RIGHT RIGHT RIGHT RIGHT RIGHT RIGHT RIGHT RIG
; UP,LEFT,DOWN,RIGHT UP,LEFT,DOWN,RIGHT UP,LEFT
#IfWinActive
; Changes the WASD keys to ARROW keys. Press "Pause" to toggle this behavior On/Off.
This is simple version (already mentioned in previous post) with Pause as toggle.
The downside is, that since it suspends all hotkeys, you cannot use AutoHotkey for other hotkeys.
; Set which keys should be switched.
$w::Up
$Up::w
$a::Left
$Left::a
$s::Down
$Down::s
$d::Right
$Right::d
#IfWinNotActive
; Changes the WASD keys to ARROW keys. Press "Pause" to toggle this behavior On/Off.