New to linux | AutoHotkey scripts

hi guys, i need to change for linux since i cant install win7 on my rig and win10 is bad so for me to be able to play games/work properly (i have wrist injury) i need to run some AutoHotkey scripts to make my life easyer, how can i setup this script to work on linux(based on AHK i think is python?)

;;;;;;;;;; Variables ;;;;;;;;;;

MouseLook := 0						;DO NOT TOUCH - Sets MouseLook mode off initially.

W   := A_ScreenWidth/2				;Sets cursor's X coordinate. By default it's directly in the center of your screen. I'd recommend not adjusting this. (A_ScreenWidth/2 by default)
H   := A_ScreenHeight/2.5			;Sets cursor's Y coordinate. Change the 2.5 up or down to your preferred cursor height. (A_ScreenHeight/2.5 by default)

CHW := W							;Offsets the Crosshair horizontally (+/- to adjust to your preference). (Just W by default)
CHH := H+5							;Offsets the Crosshair vertically (+/- to adjust to your preference). (H+5 by default)

'::									;MouseLook Toggle keybind. Adjust to your preference. (Tilda key (~) by default)
If (MouseLook == 0)
	BlockInput, On
	MouseLook := 1
	MouseMove, W, H, 0
	Send {RButton Down}
	SplashImage, Crosshair.png, x%CHW% y%CHH% b,,,Crs
	WinSet, TransColor,White,Crs
	BlockInput, Off
	Sleep, 250
MouseLook := 0
SplashImage, off
Send {RButton Up}
Sleep, 250

;;;;;;;;;; Mouse Button Keybinds during MouseLook ;;;;;;;;;;

#If (MouseLook)

*LButton::				;DO NOT TOUCH - Left Mouse Button keybind.
Send {NumpadClear}		;OPTIONAL - Set the in-game keybind "Target Center Screen Enemy" to the Numpad5 key WITHOUT NumLock's called the "Clear" key. This will enable Left clicking to also select the enemy straight ahead of you.
Send {Blind}1			;Sends "1" by default. Adjust number to your preference. Works with modifiers also like Shift and Ctrl.

*RButton::				;DO NOT TOUCH - Right Mouse Button keybind. HOLD to loot/interact or TAP to send "2" by default.
KeyWait, RButton, T0.15
If (ErrorLevel)
	SetMouseDelay, 0
	Send {RButton Up}{Click}{RButton Down}
	Sleep, 100
	Send {RButton Up}{Click, Right}{RButton Down}
	SetMouseDelay, 10
	BlockInput, Off
Send {Blind}2				;Sends "2" by default. Adjust number to your preference.

*WheelUp::Send {Blind}3		;Scroll Wheel Up sends "3" by default. Adjust number to your preference.

*WheelDown::Send {Blind}4	;Scroll Wheel Down sends "4" by default. Adjust number to your preference.

*MButton::Send {Blind}5		;Middle Button click sends "5" by default. Adjust number to your preference.

*XButton1::Send {Blind}6	;Mouse Button 4 sends "6" by default. Adjust number to your preference.

;*XButton2::Send {Blind}	;Mouse Button 5 unallocated by default. Remove the ";" in the front of XButton2 and adjust number to your preference.


;;;;;;;;;; Interface Keys that toggle off MouseLook ;;;;;;;;;;

							;These are a list of default interface keybinds that will automatically toggle OFF MouseLook mode. Add more if you prefer. Use the format "~KEY::".
If (MouseLook)
	MouseLook := 0
	SplashImage, Off
	Send {RButton Up}

this makes any game that uses rigth click to pan the camera to play like an FPS game with a dot on center the screen and makes my playtime more enjoyable and run on background, how can i setup this on linux?

Please, use the </> button above the post entry box when pasting terminal output so it's formatted properly.
You can edit your post (pencil button)

1 Like

Autohotkey is not available on linux, will possibly run under wine, but is not going to work well.


You can do similar things on Linux. But it will require you to adapt your current definitions to work with Linux tools.

One example of apps which can be scripted to simulate various actions is xdotool.

I have no recollection of an app which is the equivalent to autohotkey.

I did a search and found a couple of packages in AUR with only autokey worth of mention

You are still required to adapt AHK definitions to work with autokey

1 Like

@xircon on a virtual machine, did work well but only inside of another wine windown so far so good but the mouse was like lagging i need to see if i find some hardware acceleration there

yeah i will need to adapt those scripts, i tried this autokey but just to install him is hell on earth since i'm 100% new to linux

yay -S autokey

or enable AUR in pamac and install from there.

Autokey is python, so start learning python :smiley:

1 Like

thanks i will take a look on that

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by