Stellaris

Stellaris

View Stats:
This topic has been locked
JH May 13, 2016 @ 6:45am
Control remapping with AutoHotKey
Script for AutoHotKey http://autohotkey.com/

What this does: allows panning with right mouse button while preserving usual right button actions. Maps E (galaxy map) to side button 1 and Pause to side button 2. Swaps view angle to middle button. These changes are only active when Stellaris is the focused window. Now you can control all your game easily with just the mouse!

How to use:

1. Download and install AutoHotKey
2. Open Notepad, paste script below, save with extension ".ahk"
3. Double click script to run.

Note: If you have a ship selected and you hold right button to pan, but the mouse was over a navigable target, then the ship will get new orders. So take care where you click or just deselect ship first.

Script contents as follows:



#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

#IfWinActive, ahk_exe stellaris.exe

RButton::
If(!flag)
{ send {RButton}
flag=1
}
send, {MButton down}
keywait, RButton
send, {MButton up}
flag = 0
return

MButton::
send, {RButton down}
keywait, MButton
send, {RButton up}
return

XButton1::
Send e
Return

XButton2::
Send {space}
Return

#IfWinActive
Last edited by JH; May 14, 2016 @ 7:03am
< >
Showing 1-7 of 7 comments
JH May 14, 2016 @ 7:03am 
Edit: v2. This one actually works, ooops!
76561198111975548 May 20, 2016 @ 11:11pm 
I am using AutoHotkey to try and zoom in and out without having a scroll wheel. I have a laptop and a logitech trackball mouse. (so no scroll wheel).

The problem I am having is that the changes are made fine in a windows box such as explorer or firefox. The page up and page down keys scroll the windows just fine, but when i switch over to stellaris it does nothing. I have tried a few diff scripts and they both worked just fine in windows. (ver 10) but no luck in game..

apparently you don't have this problem which is promising because I was thinking ahk just didn't work in stellaris.

any help greatly appreciated.
JH May 21, 2016 @ 8:32am 
Originally posted by jesselp2006:
I am using AutoHotkey to try and zoom in and out without having a scroll wheel.

Ok try this. It maps Z and X to scroll. To make it faster or slower, change the sleep number.



#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%


#IfWinActive, ahk_exe stellaris.exe


$Z::
while (getkeystate("Z", "P"))
{
click wheelup
sleep, 150
}

$X::
while (getkeystate("X", "P"))
{
click wheeldown
sleep, 150
}


#IfWinActive
Mansen May 21, 2016 @ 8:48am 
Just a simple rebind will get it done. No need for sleep or anything fancy.

PgUp::WheelUp
PgDn::WheelDown

I don't remember the last time anyone needed the Page keys for anything while playing stellaris. Of course you'll need to run it when you play. But then you won't have to deal with having it run elsewhere.
JH May 21, 2016 @ 8:52am 
Originally posted by Mansen:
Just a simple rebind will get it done. No need for sleep or anything fancy.

True, but when I was testing it I found an auto-repeat was nicer to use.
76561198111975548 May 22, 2016 @ 7:59pm 
thank you all! actually It just started working on its own after I asked. I guess I had to restart game? dunno but it works now by the way the 2nd ver is what I used it works and is simple. Hope this may help others. I will never give up my trackball mouse. I couldnt imagine haveing to move the whole mouse around to play a game. So for those who have no mouse wheel this
is a great thing to have and learn to use.
Kornstalx May 11, 2020 @ 6:21am 
Sorry to Necro this, but man I just wanted to say thanks. I've used AHK for everything since ~2006, but didn't even think about swapping the Right and Middle buttons for Stellaris. It *really* makes things feel more natural.
< >
Showing 1-7 of 7 comments
Per page: 1530 50

Date Posted: May 13, 2016 @ 6:45am
Posts: 7