Let's help make some changes.

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
zhu8888rui
Posts: 1
Joined: 14 Jan 2019, 06:06

Let's help make some changes.

14 Jan 2019, 06:23

Replace the mouse of the right rocker of the control handle with the direction key of the keyboard.

Code: Select all

; <COMPILER: v1.1.26.00>
SendMode Input
SetWorkingDir %A_ScriptDir%
#NoEnv
#MaxHotkeysPerInterval 210
#HotkeyInterval 1000
#SingleInstance Force
Class MouseDelta {
State := 0
__New(callback){
this.MouseMovedFn := this.MouseMoved.Bind(this)
this.Callback := callback
}
Start(){
static DevSize := 8 + A_PtrSize, RIDEV_INPUTSINK := 0x00000100
VarSetCapacity(RAWINPUTDEVICE, DevSize)
NumPut(1, RAWINPUTDEVICE, 0, "UShort")
NumPut(2, RAWINPUTDEVICE, 2, "UShort")
NumPut(RIDEV_INPUTSINK, RAWINPUTDEVICE, 4, "Uint")
Gui +hwndhwnd
NumPut(hwnd, RAWINPUTDEVICE, 8, "Uint")
this.RAWINPUTDEVICE := RAWINPUTDEVICE
DllCall("RegisterRawInputDevices", "Ptr", &RAWINPUTDEVICE, "UInt", 1, "UInt", DevSize )
OnMessage(0x00FF, this.MouseMovedFn)
this.State := 1
return this
}
Stop(){
static RIDEV_REMOVE := 0x00000001
static DevSize := 8 + A_PtrSize
OnMessage(0x00FF, this.MouseMovedFn, 0)
RAWINPUTDEVICE := this.RAWINPUTDEVICE
NumPut(RIDEV_REMOVE, RAWINPUTDEVICE, 4, "Uint")
DllCall("RegisterRawInputDevices", "Ptr", &RAWINPUTDEVICE, "UInt", 1, "UInt", DevSize )
this.State := 0
return this
}
SetState(state){
if (state && !this.State)
this.Start()
else if (!state && this.State)
this.Stop()
return this
}
Delete(){
this.Stop()
this.MouseMovedFn := ""
}
MouseMoved(wParam, lParam){
Critical
static DeviceSize := 2 * A_PtrSize, iSize := 0, sz := 0, pcbSize:=8+2*A_PtrSize, offsets := {x: (20+A_PtrSize*2), y: (24+A_PtrSize*2)}, uRawInput
static axes := {x: 1, y: 2}
VarSetCapacity(header, pcbSize, 0)
If (!DllCall("GetRawInputData", "UPtr", lParam, "uint", 0x10000005, "UPtr", &header, "Uint*", pcbSize, "Uint", pcbSize) or ErrorLevel)
Return 0
ThisMouse := NumGet(header, 8, "UPtr")
if (!iSize){
r := DllCall("GetRawInputData", "UInt", lParam, "UInt", 0x10000003, "Ptr", 0, "UInt*", iSize, "UInt", 8 + (A_PtrSize * 2))
VarSetCapacity(uRawInput, iSize)
}
sz := iSize
r := DllCall("GetRawInputData", "UInt", lParam, "UInt", 0x10000003, "Ptr", &uRawInput, "UInt*", sz, "UInt", 8 + (A_PtrSize * 2))
x := 0, y := 0
x := NumGet(&uRawInput, offsets.x, "Int")
y := NumGet(&uRawInput, offsets.y, "Int")
if x!=0
global xx := x
if y!=0
global yy := y
this.Callback.(ThisMouse, x, y)
}
}
Class CvJoyInterface {
DebugMode := 0
SingleStickMode := 1
ResetOnAcquire := 1
ResetOnRelinquish := 1
LibraryLoaded := 0
LoadLibraryLog := ""
hModule := 0
Devices := []
VJD_MAXDEV := 16
VJD_STAT_OWN := 0
VJD_STAT_FREE := 1
VJD_STAT_BUSY := 2
VJD_STAT_MISS := 3
VJD_STAT_UNKN := 4
HID_USAGE_X := 0x30
HID_USAGE_Y := 0x31
HID_USAGE_Z := 0x32
HID_USAGE_RX:= 0x33
HID_USAGE_RY:= 0x34
HID_USAGE_RZ:= 0x35
HID_USAGE_SL0:= 0x36
HID_USAGE_SL1:= 0x37
AxisIndex := [0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37]
AxisAssoc := {x:0x30, y:0x31, z:0x32, rx:0x33, ry:0x34, rz: 0x35, sl1:0x36, sl2:0x37}
AxisNames := ["X","Y","Z","RX","RY","RZ","SL0","SL1"]
Class CvJoyDevice {
IsOwned := 0
GetStatus(){
return this.Interface.GetVJDStatus(this.DeviceID)
}
GetStatusName(){
DeviceStatus := this.GetStatus()
if (DeviceStatus = this.Interface.VJD_STAT_OWN) {
return "OWN"
} else if (DeviceStatus = this.Interface.VJD_STAT_FREE) {
return "FREE"
} else if (DeviceStatus = this.Interface.VJD_STAT_BUSY) {
return "BUSY"
} else if (DeviceStatus = this.Interface.VJD_STAT_MISS) {
return "MISS"
} else {
return "???"
}
}
Acquire(){
if (this.IsOwned){
return 1
}
if (this.Interface.SingleStickMode){
Loop % this.Interface.Devices.MaxIndex() {
if (A_Index == this.DeviceID){
Continue
}
if (this.Interface.Devices[A_Index].IsOwned){
this.Interface.Devices[A_Index].Relinquish()
break
}
}
}
ret := this.Interface.AcquireVJD(this.DeviceID)
if (ret && this.Interface.ResetOnAcquire){
this.Interface.ResetVJD(this.DeviceID)
} else {
if (this.Interface.DebugMode) {
OutputDebug, % "Error in " A_ThisFunc "`nDeviceID = " this.DeviceID ", ErrorLevel: " ErrorLevel ", Device Status: " this.GetStatusName()
}
}
return ret
}
Relinquish(){
if (this.IsOwned && this.Interface.ResetOnRelinquish){
this.Interface.ResetVJD(this.DeviceID)
}
return this.Interface.RelinquishVJD(this.DeviceID)
}
Reset(){
this.Interface.ResetVJD(this.DeviceID)
}
ResetButtons(){
this.Interface.ResetButtons(this.DeviceID)
}
ResetPovs(){
this.Interface.ResetPovs(this.DeviceID)
}
IsEnabled(){
state := this.GetStatus()
return state != this.Interface.VJD_STAT_MISS && state != this.Interface.VJD_STAT_UNKN
}
IsAvailable(){
state := this.GetStatus()
return state == this.Interface.VJD_STAT_FREE || state == this.Interface.VJD_STAT_OWN
}
SetAxisByIndex(axis_val, index){
if (!this.Acquire()){
return 0
}
return this.Interface.SetAxis(axis_val, this.DeviceID, this.Interface.AxisIndex[index])
}
SetAxisByName(axis_val, name){
if (!this.Acquire()){
return 0
}
return this.Interface.SetAxis(axis_val, this.DeviceID, this.Interface.AxisAssoc[name])
}
SetBtn(btn_val, btn){
if (!this.Acquire()){
return 0
}
return this.Interface.SetBtn(btn_val, this.DeviceID, btn)
}
SetDiscPov(pov_val, pov){
if (!this.Acquire()){
return 0
}
return this.Interface.SetDiscPov(pov_val, this.DeviceID, pov)
}
SetContPov(pov_val, pov){
if (!this.Acquire()){
return 0
}
return this.Interface.SetContPov(pov_val, this.DeviceID, pov)
}
__New(id, parent){
this.DeviceID := id
this.Interface := parent
}
__Delete(){
this.Relinquish()
}
}
__New(){
Loop % this.VJD_MAXDEV {
this.Devices[A_Index] := new this.CvJoyDevice(A_Index, this)
}
this.LoadLibrary()
return this
}
__Delete(){
Loop % this.VJD_MAXDEV {
this.Devices[A_Index].Relinquish()
}
if (this.hModule){
DllCall("FreeLibrary", "Ptr", this.hModule)
}
}
PercentTovJoy(percent){
return percent * 327.68
}
vJoyToPercent(vJoy){
return vJoy / 327.68
}
LoadLibrary() {
if (this.LibraryLoaded) {
this.LoadLibraryLog .= "Library already loaded. Aborting...`n"
return 1
}
this.LoadLibraryLog := ""
if (A_Is64bitOS && A_PtrSize != 8){
SetRegView 64
}
RegRead vJoyFolder, HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{8E31F76F-74C3-47F1-9550-E041EEDC5FBB}_is1, InstallLocation
if (!vJoyFolder){
this.LoadLibraryLog .= "ERROR: Could not find the vJoy Registry Key.`n`nvJoy does not appear to be installed.`nPlease ensure you have installed vJoy from`n`nhttp://vjoystick.sourceforge.net."
return 0
}
if (A_PtrSize == 8){
DllKey := "DllX64Location"
} else {
DllKey := "DllX86Location"
}
RegRead DllFolder, HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{8E31F76F-74C3-47F1-9550-E041EEDC5FBB}_is1, % DllKey
if (!DllFolder){
this.LoadLibraryLog .= "A vJoy install was found in " vJoyFolder ", but it appears to be an old version.`nPlease update vJoy to the latest version from `n`nhttp://vjoystick.sourceforge.net."
return 0
}
DllFolder .= "\"
DllFile := "vJoyInterface.dll"
this.LoadLibraryLog := "vJoy Install Detected. Trying to load " DllFile "...`n"
CheckLocations := [DllFolder DllFile]
hModule := 0
Loop % CheckLocations.Maxindex() {
this.LoadLibraryLog .= "Checking " CheckLocations[A_Index] "... "
if (FileExist(CheckLocations[A_Index])){
this.LoadLibraryLog .= "FOUND.`nTrying to load.. "
hModule := DLLCall("LoadLibrary", "Str", CheckLocations[A_Index])
if (hModule){
this.hModule := hModule
this.LoadLibraryLog .= "OK.`n"
this.LoadLibraryLog .= "Checking driver enabled... "
if (this.vJoyEnabled()){
this.LibraryLoaded := 1
this.LoadLibraryLog .= "OK.`n"
this.LoadLibraryLog .= "Loaded vJoy DLL version " this.GetvJoyVersion() "`n"
if (this.DebugMode){
OutputDebug, % this.LoadLibraryLog
}
return 1
} else {
this.LoadLibraryLog .= "FAILED.`n"
}
} else {
this.LoadLibraryLog .= "FAILED.`n"
}
} else {
this.LoadLibraryLog .= "NOT FOUND.`n"
}
}
this.LoadLibraryLog .= "`nFailed to load valid  " DllFile "`n"
this.LibraryLoaded := 0
return 0
}
vJoyEnabled(){
return DllCall("vJoyInterface\vJoyEnabled")
}
GetvJoyVersion(){
return DllCall("vJoyInterface\GetvJoyVersion")
}
GetvJoyProductString(){
return DllCall("vJoyInterface\GetvJoyProductString")
}
GetvJoyManufacturerString(){
return DllCall("vJoyInterface\GetvJoyManufacturerString")
}
GetvJoySerialNumberString(){
return DllCall("vJoyInterface\GetvJoySerialNumberString")
}
GetVJDStatus(rID){
return DllCall("vJoyInterface\GetVJDStatus", "UInt", rID)
}
AcquireVJD(rID){
this.Devices[rID].IsOwned := DllCall("vJoyInterface\AcquireVJD", "UInt", rID)
return this.Devices[rID].IsOwned
}
RelinquishVJD(rID){
DllCall("vJoyInterface\RelinquishVJD", "UInt", rID)
this.Devices[rID].IsOwned := 0
return this.Devices[rID].IsOwned
}
UpdateVJD(rID, pData){
return DllCall("vJoyInterface\UpdateVJD", "UInt", rID, "PVOID", pData)
}
GetVJDButtonNumber(rID){
return DllCall("vJoyInterface\GetVJDButtonNumber", "UInt", rID)
}
GetVJDDiscPovNumber(rID){
return DllCall("vJoyInterface\GetVJDDiscPovNumber", "UInt", rID)
}
GetVJDContPovNumber(rID){
return DllCall("vJoyInterface\GetVJDContPovNumber", "UInt", rID)
}
GetVJDAxisExist(rID, Axis){
return DllCall("vJoyInterface\GetVJDAxisExist", "UInt", rID, "Uint", Axis)
}
ResetVJD(rID){
return DllCall("vJoyInterface\ResetVJD", "UInt", rID)
}
ResetAll(){
return DllCall("vJoyInterface\ResetAll")
}
ResetButtons(rID){
return DllCall("vJoyInterface\ResetButtons", "UInt", rID)
}
ResetPovs(rID){
return DllCall("vJoyInterface\ResetPovs", "UInt", rID)
}
SetAxis(Value, rID, Axis){
return DllCall("vJoyInterface\SetAxis", "Int", Value, "UInt", rID, "UInt", Axis)
}
SetBtn(Value, rID, nBtn){
return DllCall("vJoyInterface\SetBtn", "Int", Value, "UInt", rID, "UInt", nBtn)
}
SetDiscPov(Value, rID, nPov){
return DllCall("vJoyInterface\SetDiscPov", "Int", Value, "UInt", rID, "UChar", nPov)
}
SetContPov(Value, rID, nPOV){
return DllCall("vJoyInterface\SetContPov", "Int", Value, "UInt", rID, "UChar", nPov)
}
}
if not A_IsAdmin
{
IfExist, %A_WorkingDir%\Gpdsck 3.1.exe
Run *RunAs "%A_WorkingDir%\GPDSCK 3.1.exe"
else
MsgBox,    	Rename GPDSCK back to "GPDSCK 3.1"`n-------------------Or-------------------`n           RUN GPDSCK AS ADMIN
ExitApp
}
FileInstall, D:\My Documents\Autohotkey Scripts\GPDSCK\3.1\Gamepad.jpg,  %a_temp%/Gamepad.jpg,1
FileInstall, D:\My Documents\Autohotkey Scripts\GPDSCK\3.1\OnSound.wav,  %a_temp%/OnSound.wav,1
FileInstall, D:\My Documents\Autohotkey Scripts\GPDSCK\3.1\OffSound.Wav,  %a_temp%/OffSound.wav,1
Menu,Tray, noStandard
Menu,Tray,Add,Settings,MainGui
Menu,Tray,Add,Exit,exitFunc
Gosub, CreateSettings
sleep 250
Gosub, ReadSettings
CoordMode,Mouse,Screen
SetMouseDelay,-1
toggle:=1
RelativeMode:=0
loop 16
timespressed%A_Index%:=0
angularDeadZone=0
fallBackPause=-1
pi:=atan(1)*4
angularDeadZone*=pi/180
angularDeadZone:=angularDeadZone>pi/4 ? pi/4:angularDeadZone
vW:=202
vH:=202
dr:=0
freq:=0
actionTaken:=0
snapToFullTilt:=0.005
segmentEndAngles:=Object()
Loop,12
segmentEndAngles[A_Index]:=pi/6*A_Index
md := new MouseDelta("GetXX/GetYY")
kr=10
hideCursor=1
visualAidIsOn=0
autoPlaceVisualAid=0
nnVA=1
Hotkey,$%StartScriptKey%,StartScript, on
gosub, MainGui
Return
initCvJoyInterfaceOn:
vJoyInterface := new CvJoyInterface()
if (!vJoyInterface.vJoyEnabled())
{
Msgbox, vJoy needs to be Installed/Enabled.
ExitApp
}
global vstick := vJoyInterface.Devices[1]
return
initCvJoyInterfaceOff:
vJoyInterface := new CvJoyInterface()
if (!vJoyInterface.vJoyEnabled())
{
Msgbox, vJoy needs to be Installed/Enabled.
ExitApp
}
global vstick := vJoyInterface.Devices[0]
return
CreateSettings:
IfNotExist, Settings.ini
{
defaultSettings=
(
[General]
StartScriptKey=f4
ToggleAlWaysOn=1

[Mouse]
Sensitivity=140
ThresHold=0.01
Nnp=0.45
InvertedX=0
InvertedY=0
MouseDisable=0
StickModeLSRS=0
ToggleRawMode=0

[JoystickBinds]
JoystickBindsList=r"space"c"f"xbutton1"rbutton"lshift"lbutton"esc"tab"z"mbutton"MWUp"e"q"MWDown"w"s"a"d"capslock"lctrl
ButtonToggle=0"0"0"0"0"0"0"0"0"0"0"0

)
FileAppend,%defaultSettings%,settings.ini
If ErrorLevel
ExitApp
}
return
readsettings:
iniread,allSections,settings.ini
if (!allSections || allSections="ERROR")
{
ExitApp
}
Loop,Parse,allSections,`n
{
IniRead,pairs,%a_workingdir%\Settings.ini,%A_LoopField%
Loop,Parse,pairs,`n
{
StringSplit,keyValue,A_LoopField,=
%keyValue1%:=keyValue2
}
}
r:=160-Sensitivity
K:=thresHold
nnp=0.45
pmX:=invertedX ? -1:1
pmY:=invertedY ? 1:-1
axis1left:=0
axis1right:=32768
axis2up:=0
axis2down:=32768
toggleWalkState:=1
toggleABRE:=1
loop 12
{
ToggleBind%A_Index%:=1
}
return
loadBinds:
gosub, readSettings
Loop, Parse, JoystickBindsList, `"
{
keyName:=A_LoopField
GuiControl,,bindButton%A_Index%L, %keyName%
Bind%A_Index%:=keyName
}
Walk:=Bind21
AbsoluteRelative:=Bind22
DPadUp:=Bind13
DPadDown:=Bind16
DPadLeft:=Bind15
DPadRight:=Bind14
BindLStickUp:=Bind17
BindLStickDown:=Bind18
BindLStickLeft:=Bind19
BindLStickRight:=Bind20
GuiControl,,StartScriptKeyL, %StartScriptKey%
GuiControl,,walkL, %walk%
GuiControl,,AbsoluteRelativeL, %AbsoluteRelative%
GuiControl,,bindLStickUpL, %bindLStickUp%
GuiControl,,bindLStickDownL, %bindLStickDown%
GuiControl,,bindLStickLeftL, %bindLStickLeft%
GuiControl,,bindLStickRightL, %bindLStickRight%
return
StartScript:
if toggle=1
{
BlockInput, on
if ToggleAlWaysON=0
{
MainGui=0
SetTimer, CheckboxTimer, off
}
goSub, LoadBinds
gameX:=0
gameY:=0
gameW:=A_ScreenWidth
gameH:=A_ScreenHeight
OX:=gameW/2
OY:=gameH/2
IF (!OX OR !OY)
{
OX := 500
OY := 500
}
Gosub, initCvJoyInterfaceOn
SoundPlay, %a_temp%/OnSound.wav
Loop, Parse, AllButtonsList, `"
{
keyName:=A_LoopField
if getkeystate(keyName)
{
sendinput {%keyname% up}
sleep 20
}
}
DllCall("User32.dll\ReleaseCapture")
DllCall("User32.dll\SetCapture", "Uint", stick)
if ToggleAlWaysON=0
Gui, destroy
Gui, OnOff:Destroy
text=GPDSCK ON
gosub, ScriptOnOff
MouseMove,OX,OY
if MouseDisable=0
SetSystemCursor()
SetTimer,MainTimer,%freq%
if visualAidIsOn=1
{
Gosub, visualAid
if autoplaceVisualAid
{
vY:=gameY+gameH/2-vH/2
rightBoundExceeded:=gameX+gameW+vW+kr>A_ScreenWidth
leftBoundExceeded:=gameX-vW-kr<0
if rightBoundExceeded && leftBoundExceeded
vX:=kr,vY:=kr
else if rightBoundExceeded
vX:=gameX-vW-kr
else
vX:=gameX+gameW+kr
Gui, VA: Show, X%vX% Y%vY%  w%vW% h%vH%  NA,Visual aid for controller.
}
else
Gui, VA: Show, w%vW% h%vH% NA,Visual aid for controller.
WinSet,TransColor, FFFFFF, ahk_id %va%
if !autoplaceVisualAid
WinGetPos,vX,vY,,,ahk_id %va%
vOX:=round(vX+vW/2)
vOY:=round(vY+vH/2)
Gui, VAknob: Show,% "NA X" vOX-kr " Y" vOY-kr " W41 H41",Controller knob
WinSet,TransColor, FFFFFF, ahk_id %knob%
}
keywait, %StartScriptKey%
toggle=0
BlockSomeKeyboardInputs("On")
hotkey,$wheelup,JoyMouseWheelUp,on
hotkey,$wheelDown,JoyMouseWheelDown,on
BlockInput, off
if ToggleRawMode=1
{
BlockInput, MouseMove
md.SetState(1)
}
return
}
if Toggle=0
{
BlockInput, on
Loop, Parse, AllButtonsList, `"
{
keyName:=A_LoopField
if getkeystate(keyName)
{
sendinput {%keyname% up}
sleep 20
}
}
Loop, 12
{
ButtonUpNumber:=A_Index
vstick.SetBtn(0,ButtonUpNumber)
}
vstick.SetAxisByIndex(16384,1)
vstick.SetAxisByIndex(16384,2)
vstick.SetAxisByIndex(16384,3)
vstick.SetAxisByIndex(16384,6)
vstick.SetContPov(-1, 1)
SetTimer,MainTimer,Off
setStick(0,0)
Gosub, initCvJoyInterfaceOff
SoundPlay, %a_temp%/OffSound.wav
Gui, OnOff:Destroy
text=GPDSCK OFF
gosub, ScriptOnOff
if MouseDisable=0
RestoreCursors()
if visualAidIsOn=1
{
Gui, va:destroy
WinHide, ahk_id %knob%
WinHide, ahk_id %va%
}
RelativeMode:=0
WinHide, ahk_id %stick%
toggleWalkState:=1
toggleABRE:=1
keywait, %StartScriptKey%
DllCall("User32.dll\ReleaseCapture")
toggle=1
BlockSomeKeyboardInputs("Off")
hotkey,$wheelup,JoyMouseWheelUp,off
hotkey,$wheelDown,JoyMouseWheelDown,off
Hotkey,$%StartScriptKey%,StartScript, on
BlockInput, off
if ToggleRawMode=1
{
BlockInput, MouseMoveOff
md.SetState(0)
xx:=
yy:=
}
return
}
JoyMouseWheelup:
wumUp=1
Loop, Parse, JoystickBindsList, `"
{
bindWheelupKeyName:=A_LoopField
if bindWheelupKeyName=MWUp
{
if A_Index<=12
{
TempBindWheelUp=%A_Index%
If ButtonTog%A_Index%=0
vstick.SetBtn(1,TempBindWheelUp)
}
else
{
if A_Index=13
vstick.SetContPov(0, 1)
if A_Index=14
vstick.SetContPov(9000, 1)
if A_Index=15
vstick.SetContPov(27000, 1)
if A_Index=16
vstick.SetContPov(18000, 1)
}
}
}
sleep 150
Loop, Parse, JoystickBindsList, `"
{
bindWheelupKeyName:=A_LoopField
if bindWheelupKeyName=MWUp
{
if A_Index<=12
{
TempBindWheelUp=%A_Index%
If ButtonTog%A_Index%=0
vstick.SetBtn(0,TempBindWheelUp)
}
}
}
wumUp=0
return
JoyMouseWheelDown:
wumDown=1
Loop, Parse, JoystickBindsList, `"
{
bindWheelupKeyName:=A_LoopField
if bindWheelupKeyName=MWDown
{
if A_Index<=12
{
TempBindWheelUp=%A_Index%
If ButtonTog%A_Index%=0
vstick.SetBtn(1,TempBindWheelUp)
}
else
{
if A_Index=13
vstick.SetContPov(0, 1)
if A_Index=14
vstick.SetContPov(9000, 1)
if A_Index=15
vstick.SetContPov(27000, 1)
if A_Index=16
vstick.SetContPov(18000, 1)
}
}
}
sleep 150
Loop, Parse, JoystickBindsList, `"
{
bindWheelupKeyName:=A_LoopField
if bindWheelupKeyName=MWDown
{
if A_Index<=12
{
TempBindWheelUp=%A_Index%
If ButtonTog%A_Index%=0
vstick.SetBtn(0,TempBindWheelUp)
}
}
}
wumDown=0
return
MainTimer:
if MouseDisable=0
MouseMagicFunction(r,dr,OX,OY,vOX,vOY,kr)
MaxTime:=150
if getkeystate(AbsoluteRelative,"p") and (ABREPressed!=1)
{
StartTimeABRE := A_TickCount
Settimer,ABRETimer,0
ABREPressed=1
}
if getkeystate(walk,"p") and (WalkPressed!=1)
{
StartTimeWalk := A_TickCount
settimer,walkTimer,0
WalkPressed=1
}
if (bind1!="MWUp") and (bind1!="MWDown")
{
if ButtonTog1=0
{
if getkeystate(bind1,"p")
vstick.setbtn(1,1)
else
vstick.setbtn(0,1)
}
if (getkeystate(bind1,"p")) and (ButtonTog1=1) and (Bind1Pressed!=1)
{
StartTimeBind1 := A_TickCount
Settimer,Bind1Timer,0
Bind1Pressed=1
}
}
if (bind2!="MWUp") and (bind2!="MWDown")
{
if ButtonTog2=0
{
if getkeystate(bind2,"p")
vstick.setbtn(1,2)
else
vstick.setbtn(0,2)
}
if (getkeystate(bind2,"p")) and (ButtonTog2=1) and (bind2Pressed!=1)
{
StartTimebind2 := A_TickCount
Settimer,bind2Timer,0
bind2Pressed=1
}
}
if (bind3!="MWUp") and (bind3!="MWDown")
{
if ButtonTog3=0
{
if getkeystate(bind3,"p")
vstick.setbtn(1,3)
else
vstick.setbtn(0,3)
}
if (getkeystate(bind3,"p")) and (ButtonTog3=1) and (bind3Pressed!=1)
{
StartTimebind3 := A_TickCount
Settimer,bind3Timer,0
bind3Pressed=1
}
}
if (bind4!="MWUp") and (bind4!="MWDown")
{
if ButtonTog4=0
{
if getkeystate(bind4,"p")
vstick.setbtn(1,4)
else
vstick.setbtn(0,4)
}
if (getkeystate(bind4,"p")) and (ButtonTog4=1) and (bind4Pressed!=1)
{
StartTimebind4 := A_TickCount
Settimer,bind4Timer,0
bind4Pressed=1
}
}
if (bind5!="MWUp") and (bind5!="MWDown")
{
if ButtonTog5=0
{
if getkeystate(bind5,"p")
vstick.setbtn(1,5)
else
vstick.setbtn(0,5)
}
if (getkeystate(bind5,"p")) and (ButtonTog5=1) and (bind5Pressed!=1)
{
StartTimebind5 := A_TickCount
Settimer,bind5Timer,0
bind5Pressed=1
}
}
if (bind6!="MWUp") and (bind6!="MWDown")
{
if ButtonTog6=0
{
if getkeystate(bind6,"p")
vstick.setbtn(1,6)
else
vstick.setbtn(0,6)
}
if (getkeystate(bind6,"p")) and (ButtonTog6=1) and (Bind6Pressed!=1)
{
StartTimeBind6 := A_TickCount
Settimer,Bind6Timer,0
Bind6Pressed=1
}
}
if (bind7!="MWUp") and (bind7!="MWDown")
{
if Buttontog7=0
{
if getkeystate(bind7,"p")
vstick.setbtn(1,7)
else
vstick.setbtn(0,7)
}
if (getkeystate(bind7,"p")) and (Buttontog7=1) and (bind7Pressed!=1)
{
StartTimebind7 := A_TickCount
Settimer,bind7Timer,0
bind7Pressed=1
}
}
if (bind8!="MWUp") and (bind8!="MWDown")
{
if Buttontog8=0
{
if getkeystate(bind8,"p")
vstick.setbtn(1,8)
else
vstick.setbtn(0,8)
}
if (getkeystate(bind8,"p")) and (Buttontog8=1) and (bind8Pressed!=1)
{
StartTimebind8 := A_TickCount
Settimer,bind8Timer,0
bind8Pressed=1
}
}
if (bind9!="MWUp") and (bind9!="MWDown")
{
if Buttontog9=0
{
if getkeystate(bind9,"p")
vstick.setbtn(1,9)
else
vstick.setbtn(0,9)
}
if (getkeystate(bind9,"p")) and (Buttontog9=1) and (bind9Pressed!=1)
{
StartTimebind9 := A_TickCount
Settimer,bind9Timer,0
bind9Pressed=1
}
}
if (bind10!="MWUp") and (bind10!="MWDown")
{
if Buttontog10=0
{
if getkeystate(bind10,"p")
vstick.setbtn(1,10)
else
vstick.setbtn(0,10)
}
if (getkeystate(bind10,"p")) and (Buttontog10=1) and (bind10Pressed!=1)
{
StartTimebind10 := A_TickCount
Settimer,bind10Timer,0
bind10Pressed=1
}
}
if (bind11!="MWUp") and (bind11!="MWDown")
{
if Buttontog11=0
{
if getkeystate(bind11,"p")
vstick.setbtn(1,11)
else
vstick.setbtn(0,11)
}
if (getkeystate(bind11,"p")) and (Buttontog11=1) and (bind11Pressed!=1)
{
StartTimebind11 := A_TickCount
Settimer,bind11Timer,0
bind11Pressed=1
}
}
if (bind12!="MWUp") and (bind12!="MWDown")
{
if Buttontog12=0
{
if getkeystate(bind12,"p")
vstick.setbtn(1,12)
else
vstick.setbtn(0,12)
}
if (getkeystate(bind12,"p")) and (Buttontog12=1) and (bind12Pressed!=1)
{
StartTimebind12 := A_TickCount
Settimer,bind12Timer,0
bind12Pressed=1
}
}
if (not getkeystate(DPadUp,"p")) and (not getkeystate(DPadDown,"p"))  and (not getkeystate(DPadRight,"p"))  and (not getkeystate(DPadLeft,"p")) and (wumUp!=1) and (wumDown!=1)
vstick.SetContPov(-1, 1)
if getkeystate(DPadUp,"p") and (DPadUp!="MWUp") and (DPadUp!="MWDown")
vstick.SetContPov(0, 1)
if getkeystate(DPadDown,"p") and (DPadDown!="MWUp") and (DPadDown!="MWDown")
vstick.SetContPov(18000, 1)
if getkeystate(DPadRight,"p") and (DPadRight!="MWUp") and (DPadRight!="MWDown")
vstick.SetContPov(9000, 1)
if getkeystate(DPadLeft,"p") and (DPadLeft!="MWUp") and (DPadLeft!="MWDown")
vstick.SetContPov(27000, 1)
if StickModeLSRS=0
{
axisXx=1
axisYy=2
}
if StickModeLSRS=1
{
axisXx=3
axisYy=6
}
if (not getkeystate(bindLStickRight,"p")) and (not getkeystate(bindLStickLeft,"p"))
vstick.SetAxisByIndex(16384,axisXx)
if (not getkeystate(bindLStickUp,"p")) and (not getkeystate(bindLStickDown,"p"))
vstick.SetAxisByIndex(16384,axisYy)
if getkeystate(bindLStickRight,"p")
{
if getkeystate(bindLStickLeft,"p")
vstick.SetAxisByIndex(16384,axisXx)
else
vstick.SetAxisByIndex(axis1right,axisXx)
}
if getkeystate(bindLStickLeft,"p")
{
if getkeystate(bindLStickRight,"p")
vstick.SetAxisByIndex(16384,axisXx)
else
vstick.SetAxisByIndex(axis1left,axisXx)
}
if getkeystate(bindLStickDown,"p")
{
if getkeystate(bindLStickUp,"p")
vstick.SetAxisByIndex(16384,axisYy)
else
vstick.SetAxisByIndex(axis2down,axisYy)
}
if getkeystate(bindLStickUp,"p")
{
if getkeystate(bindLStickDown,"p")
vstick.SetAxisByIndex(16384,axisYy)
else
vstick.SetAxisByIndex(axis2up,axisYy)
}
return
ABRETimer:
ElapsedTimeABRE := A_TickCount - StartTimeABRE
if (ElapsedTimeABRE < MaxTime)
{
if not GetKeyState(AbsoluteRelative, "P")
{
if ToggleABRE
RelativeMode:=1
else
RelativeMode:=0
ABREPressed=0
ToggleABRE:=!ToggleABRE
settimer,ABRETimer,off
}
}
if (ElapsedTimeABRE > MaxTime)
{
if GetKeyState(AbsoluteRelative, "P")
RelativeMode=1
else
{
if !ToggleABRE
ToggleABRE:=!ToggleABRE
RelativeMode=0
ABREPressed=0
settimer,ABRETimer,off
}
}
return
WalkTimer:
ElapsedTimeWalk := A_TickCount - StartTimeWalk
if (ElapsedTimeWalk < MaxTime)
{
if not GetKeyState(walk, "P")
{
if ToggleWalkState
{
axis1left:=8000
axis1right:=24000
axis2up:=8000
axis2down:=24000
}
else
{
axis1left:=0
axis1right:=32768
axis2up:=0
axis2down:=32768
}
WalkPressed=0
ToggleWalkState:=!ToggleWalkstate
settimer,WalkTimer,off
}
}
if (ElapsedTimeWalk > MaxTime)
{
if GetKeyState(walk, "P")
{
axis1left:=8000
axis1right:=24000
axis2up:=8000
axis2down:=24000
}
else
{
if !ToggleWalkState
ToggleWalkState:=!ToggleWalkstate
axis1left:=0
axis1right:=32768
axis2up:=0
axis2down:=32768
WalkPressed=0
settimer,WalkTimer,off
}
}
return
Bind1Timer:
ElapsedTimeBind1 := A_TickCount - StartTimeBind1
vstick.setbtn(0,1)
if (ElapsedTimeBind1 > 10)
vstick.setbtn(1,1)
if (ElapsedTimeBind1 < MaxTime)
{
if not GetKeyState(bind1, "P")
{
if ToggleBind1
vstick.setbtn(1,1)
else
vstick.setbtn(0,1)
Bind1Pressed=0
ToggleBind1:=!ToggleBind1
settimer,Bind1Timer,off
}
}
if (ElapsedTimeBind1 > MaxTime)
{
if GetKeyState(Bind1, "P")
vstick.setbtn(1,1)
else
{
if !ToggleBind1
vstick.setbtn(1,1)
else
vstick.setbtn(0,1)
Bind1Pressed=0
settimer,Bind1Timer,off
}
}
return
bind2Timer:
ElapsedTimebind2 := A_TickCount - StartTimebind2
vstick.setbtn(0,2)
if (ElapsedTimeBind2 > 10)
vstick.setbtn(1,2)
if (ElapsedTimebind2 < MaxTime)
{
if not GetKeyState(bind2, "P")
{
if Togglebind2
vstick.setbtn(1,2)
else
vstick.setbtn(0,2)
bind2Pressed=0
Togglebind2:=!Togglebind2
settimer,bind2Timer,off
}
}
if (ElapsedTimebind2 > MaxTime)
{
if GetKeyState(bind2, "P")
vstick.setbtn(1,2)
else
{
if !Togglebind2
vstick.setbtn(1,2)
else
vstick.setbtn(0,2)
bind2Pressed=0
settimer,bind2Timer,off
}
}
return
bind3Timer:
ElapsedTimebind3 := A_TickCount - StartTimebind3
vstick.setbtn(0,3)
if (ElapsedTimeBind3 > 10)
vstick.setbtn(1,3)
if (ElapsedTimebind3 < MaxTime)
{
if not GetKeyState(bind3, "P")
{
if Togglebind3
vstick.setbtn(1,3)
else
vstick.setbtn(0,3)
bind3Pressed=0
Togglebind3:=!Togglebind3
settimer,bind3Timer,off
}
}
if (ElapsedTimebind3 > MaxTime)
{
if GetKeyState(bind3, "P")
vstick.setbtn(1,3)
else
{
if !Togglebind3
vstick.setbtn(1,3)
else
vstick.setbtn(0,3)
bind3Pressed=0
settimer,bind3Timer,off
}
}
return
bind4Timer:
ElapsedTimebind4 := A_TickCount - StartTimebind4
vstick.setbtn(0,4)
if (ElapsedTimeBind4 > 10)
vstick.setbtn(1,4)
if (ElapsedTimebind4 < MaxTime)
{
if not GetKeyState(bind4, "P")
{
if Togglebind4
vstick.setbtn(1,4)
else
vstick.setbtn(0,4)
bind4Pressed=0
Togglebind4:=!Togglebind4
settimer,bind4Timer,off
}
}
if (ElapsedTimebind4 > MaxTime)
{
if GetKeyState(bind4, "P")
vstick.setbtn(1,4)
else
{
if !Togglebind4
vstick.setbtn(1,4)
else
vstick.setbtn(0,4)
bind4Pressed=0
settimer,bind4Timer,off
}
}
return
bind5Timer:
ElapsedTimebind5 := A_TickCount - StartTimebind5
vstick.setbtn(0,5)
if (ElapsedTimeBind5 > 10)
vstick.setbtn(1,5)
if (ElapsedTimebind5 < MaxTime)
{
if not GetKeyState(bind5, "P")
{
if Togglebind5
vstick.setbtn(1,5)
else
vstick.setbtn(0,5)
bind5Pressed=0
Togglebind5:=!Togglebind5
settimer,bind5Timer,off
}
}
if (ElapsedTimebind5 > MaxTime)
{
if GetKeyState(bind5, "P")
vstick.setbtn(1,5)
else
{
if !Togglebind5
vstick.setbtn(1,5)
else
vstick.setbtn(0,5)
bind5Pressed=0
settimer,bind5Timer,off
}
}
return
bind6Timer:
vstick.setbtn(1,6)
ElapsedTimebind6 := A_TickCount - StartTimebind6
vstick.setbtn(0,6)
if (ElapsedTimeBind6 > 10)
vstick.setbtn(1,6)
if (ElapsedTimebind6 < MaxTime)
{
if not GetKeyState(bind6, "P")
{
if Togglebind6
vstick.setbtn(1,6)
else
vstick.setbtn(0,6)
bind6Pressed=0
Togglebind6:=!Togglebind6
settimer,bind6Timer,off
}
}
if (ElapsedTimebind6 > MaxTime)
{
if GetKeyState(bind6, "P")
vstick.setbtn(1,6)
else
{
if !Togglebind6
vstick.setbtn(1,6)
else
vstick.setbtn(0,6)
bind6Pressed=0
settimer,bind6Timer,off
}
}
return
bind7Timer:
ElapsedTimebind7 := A_TickCount - StartTimebind7
vstick.setbtn(0,7)
if (ElapsedTimeBind7 > 10)
vstick.setbtn(1,7)
if (ElapsedTimebind7 < MaxTime)
{
if not GetKeyState(bind7, "P")
{
if Togglebind7
vstick.setbtn(1,7)
else
vstick.setbtn(0,7)
bind7Pressed=0
Togglebind7:=!Togglebind7
settimer,bind7Timer,off
}
}
if (ElapsedTimebind7 > MaxTime)
{
if GetKeyState(bind7, "P")
vstick.setbtn(1,7)
else
{
if !Togglebind7
vstick.setbtn(1,7)
else
vstick.setbtn(0,7)
bind7Pressed=0
settimer,bind7Timer,off
}
}
return
bind8Timer:
ElapsedTimebind8 := A_TickCount - StartTimebind8
vstick.setbtn(0,8)
if (ElapsedTimeBind8 > 10)
vstick.setbtn(1,8)
if (ElapsedTimebind8 < MaxTime)
{
if not GetKeyState(bind8, "P")
{
if Togglebind8
vstick.setbtn(1,8)
else
vstick.setbtn(0,8)
bind8Pressed=0
Togglebind8:=!Togglebind8
settimer,bind8Timer,off
}
}
if (ElapsedTimebind8 > MaxTime)
{
if GetKeyState(bind8, "P")
vstick.setbtn(1,8)
else
{
if !Togglebind8
vstick.setbtn(1,8)
else
vstick.setbtn(0,8)
bind8Pressed=0
settimer,bind8Timer,off
}
}
return
bind9Timer:
ElapsedTimebind9 := A_TickCount - StartTimebind9
vstick.setbtn(0,9)
if (ElapsedTimeBind9 > 10)
vstick.setbtn(1,9)
if (ElapsedTimebind9 < MaxTime)
{
if not GetKeyState(bind9, "P")
{
if Togglebind9
vstick.setbtn(1,9)
else
vstick.setbtn(0,9)
bind9Pressed=0
Togglebind9:=!Togglebind9
settimer,bind9Timer,off
}
}
if (ElapsedTimebind9 > MaxTime)
{
if GetKeyState(bind9, "P")
vstick.setbtn(1,9)
else
{
if !Togglebind9
vstick.setbtn(1,9)
else
vstick.setbtn(0,9)
bind9Pressed=0
settimer,bind9Timer,off
}
}
return
bind10Timer:
ElapsedTimebind10 := A_TickCount - StartTimebind10
vstick.setbtn(0,10)
if (ElapsedTimeBind10 > 10)
vstick.setbtn(1,10)
if (ElapsedTimebind10 < MaxTime)
{
if not GetKeyState(bind10, "P")
{
if Togglebind10
vstick.setbtn(1,10)
else
vstick.setbtn(0,10)
bind10Pressed=0
Togglebind10:=!Togglebind10
settimer,bind10Timer,off
}
}
if (ElapsedTimebind10 > MaxTime)
{
if GetKeyState(bind10, "P")
vstick.setbtn(1,10)
else
{
if !Togglebind10
vstick.setbtn(1,10)
else
vstick.setbtn(0,10)
bind10Pressed=0
settimer,bind10Timer,off
}
}
return
bind11Timer:
ElapsedTimebind11 := A_TickCount - StartTimebind11
vstick.setbtn(0,11)
if (ElapsedTimeBind1 > 11)
vstick.setbtn(1,11)
if (ElapsedTimebind11 < MaxTime)
{
if not GetKeyState(bind11, "P")
{
if Togglebind11
vstick.setbtn(1,11)
else
vstick.setbtn(0,11)
bind11Pressed=0
Togglebind11:=!Togglebind11
settimer,bind11Timer,off
}
}
if (ElapsedTimebind11 > MaxTime)
{
if GetKeyState(bind11, "P")
vstick.setbtn(1,11)
else
{
if !Togglebind11
vstick.setbtn(1,11)
else
vstick.setbtn(0,11)
bind11Pressed=0
settimer,bind11Timer,off
}
}
return
bind12Timer:
ElapsedTimebind12 := A_TickCount - StartTimebind12
vstick.setbtn(0,12)
if (ElapsedTimeBind12 > 10)
vstick.setbtn(1,12)
if (ElapsedTimebind12 < MaxTime)
{
if not GetKeyState(bind12, "P")
{
if Togglebind12
vstick.setbtn(1,12)
else
vstick.setbtn(0,12)
bind12Pressed=0
Togglebind12:=!Togglebind12
settimer,bind12Timer,off
}
}
if (ElapsedTimebind12 > MaxTime)
{
if GetKeyState(bind12, "P")
vstick.setbtn(1,12)
else
{
if !Togglebind12
vstick.setbtn(1,12)
else
vstick.setbtn(0,12)
bind12Pressed=0
settimer,bind12Timer,off
}
}
return
CheckboxTimer:
loop 12
{
GuiControlGet, ButtonTog%A_Index%,, ButtonTog%A_Index%
Iniwrite, %ButtonTog1%`"%ButtonTog2%`"%ButtonTog3%`"%ButtonTog4%`"%ButtonTog5%`"%ButtonTog6%`"%ButtonTog7%`"%ButtonTog8%`"%ButtonTog9%`"%ButtonTog10%`"%ButtonTog11%`"%ButtonTog12%, %a_workingdir%\Settings.ini, JoystickBinds, ButtonToggle
}
GuiControlGet, ToggleInvertedX,, ToggleInvertedX
GuiControlGet, ToggleInvertedY,, ToggleInvertedY
GuiControlGet, ToggleMouseDisable,, ToggleMouseDisable
GuiControlGet, ToggleAlWaysOn,, ToggleAlWaysOn
GuiControlGet, ToggleRawMode,, ToggleRawMode
Iniwrite, %ToggleInvertedX% ,%a_workingdir%\Settings.ini, Mouse, InvertedX
Iniwrite, %ToggleInvertedY% ,%a_workingdir%\Settings.ini, Mouse, InvertedY
Iniwrite, %ToggleMouseDisable% ,%a_workingdir%\Settings.ini, Mouse, MouseDisable
Iniwrite, %ToggleAlWaysOn% ,%a_workingdir%\Settings.ini, General, ToggleAlWaysOn
Iniwrite, %ToggleRawMode% ,%a_workingdir%\Settings.ini, Mouse, ToggleRawMode
return
MouseMagicFunction(r,dr,OX,OY,vOX,vOY,kr)
{
global actionTaken, fallBackPause, visualAidIsOn, knob, vW, vH,k, nnp,nnVA,fr,RelativeMode,ToggleRawMode,xx,yy
if ToggleRawMode=0
MouseGetPos,X,Y
if ToggleRawMode=1
{
x:=Ox+xx
y:=Oy+yy
}
X-=OX
Y-=OY
if (RelativeMode=1)
{
RelativeModeTOG:=1
rb:=r
r:=800
}
if (RelativeMode=0) and (RelativeModeTOG=1)
r:=rb
RR:=sqrt(X**2+Y**2)
if fr
{
X:=round(X*fr/RR)
Y:=round(Y*fr/RR)
RR:=sqrt(X**2+Y**2)
if ToggleRawMode=0
MouseMove,X+OX,Y+OY
if ToggleRawMode=1
{
xx:=x
yy:=y
}
}
else if (RR>r)
{
X:=round(X*(r-dr)/RR)
Y:=round(Y*(r-dr)/RR)
RR:=sqrt(X**2+Y**2)
if ToggleRawMode=0
MouseMove,X+OX,Y+OY
if ToggleRawMode=1
{
xx:=x
yy:=y
}
}
phi:=getAngle(X,Y)
if visualAidIsOn=1
{
vr:=vW/2
if (RR>k*r && nnp!=1 && nnVA)
{
A:=(vr-vr*k)*((RR-k*r)/(r-k*r))**nnp+vr*k
kX:=round(A*cos(phi))+vOX-kr
kY:=round(A*sin(phi))+vOY-kr
}
else
{
kX:=round(vOX+(X/r)*vr-kr)
kY:=round(vOY+(Y/r)*vr-kr)
}
SetWinDelay,-1
WinMove,ahk_id %knob%,, kX,kY
}
if (RR>k*r)
{
action(phi,((RR-k*r)/(r-k*r))**nnp)
actionTaken:=1
}
else
{
setStick(0,0)
if (fallBackPause!=-1 && actionTaken=1)
{
if ToggleRawMode=0
MouseMove,OX,OY
if ToggleRawMode=1
{
xx:=x
yy:=y
}
if visualAidIsOn=1
{
kX:=vOX-kr
kY:=vOY-kr
WinMove,ahk_id %knob%,, kX,kY
}
mouseBlock()
actionTaken:=0
}
}
if (RelativeMode=0) and (ToggleRawMode=0)
MouseMove,OX,OY
if RelativeMode=0
{
xx:=0
yy:=0
}
}
action(phi,tilt)
{
global angularDeadZone,pmX,pmY,pi,snapToFullTilt
tilt:=tilt>1 ? 1:tilt
if (snapToFullTilt!=-1)
tilt:=1-tilt<=snapToFullTilt ? 1:tilt
if (phi<3*pi/2+angularDeadZone && phi>3*pi/2-angularDeadZone)
{
setStick(0,pmY*tilt)
return
}
if (phi<pi+angularDeadZone && phi>pi-angularDeadZone)
{
setStick(-pmX*tilt,0)
return
}
if (phi<pi/2+angularDeadZone && phi>pi/2-angularDeadZone)
{
setStick(0,-pmY*tilt)
return
}
if ((phi>2*pi-angularDeadZone && phi<2*pi) || (phi<angularDeadZone && phi>=0) )
{
setStick(pmX*tilt,0)
return
}
lb:=3*pi/2+angularDeadZone
ub:=7*pi/4
if (phi>=lb && phi<=ub)
{
x:=pmX*tilt*scale(phi,ub,lb)
y:=pmY*tilt
setStick(x,y)
return
}
lb:=7*pi/4
ub:=2*pi-angularDeadZone
if (phi>=lb && phi<=ub)
{
x:=pmX*tilt
y:=pmY*tilt*scale(phi,lb,ub)
setStick(x,y)
return
}
lb:=angularDeadZone
ub:=pi/4
if (phi>=lb && phi<=ub)
{
x:=pmX*tilt
y:=-pmY*tilt*scale(phi,ub,lb)
setStick(x,y)
return
}
lb:=pi/4
ub:=pi/2-angularDeadZone
if (phi>=lb && phi<=ub)
{
x:=pmX*tilt*scale(phi,lb,ub)
y:=-pmY*tilt
setStick(x,y)
return
}
lb:=pi/2+angularDeadZone
ub:=3*pi/4
if (phi>=lb && phi<=ub)
{
x:=-pmX*tilt*scale(phi,ub,lb)
y:=-pmY*tilt
setStick(x,y)
return
}
lb:=3*pi/4
ub:=pi-angularDeadZone
if (phi>=lb && phi<=ub)
{
x:=-pmX*tilt
y:=-pmY*tilt*scale(phi,lb,ub)
setStick(x,y)
return
}
lb:=pi+angularDeadZone
ub:=5*pi/4
if (phi>=lb && phi<=ub)
{
x:=-pmX*tilt
y:=pmY*tilt*scale(phi,ub,lb)
setStick(x,y)
return
}
lb:=5*pi/4
ub:=3*pi/2-angularDeadZone
if (phi>=lb && phi<=ub)
{
x:=-pmX*tilt*scale(phi,lb,ub)
y:=pmY*tilt
setStick(x,y)
return
}
setStick(0,0)
return
}
scale(phi,lb,ub)
{
return (phi-ub)/(lb-ub)
}
setStick(x,y)
{
Global StickModeLSRS
x:=(x+1)*16384
y:=(y+1)*16384
if StickModeLSRS=0
{
axisX := 3
axisY := 6
}
if StickModeLSRS=1
{
axisX := 1
axisY := 2
}
IF x is number
vstick.SetAxisByIndex(x,axisX)
IF y is number
vstick.SetAxisByIndex(y,axisy)
}
getQuadrant(phi)
{
global pi
if (phi>0 && phi <= pi/2)
return 1
else if(phi>pi/2 && phi <= pi)
return 2
else if( phi>pi && phi <= 3*pi/2)
return 3
else if (phi>3*pi/2 && phi <= 2*pi)
return 4
return -1
}
mouse2keyboard(r,dr,OX,OY,vOX,vOY,kr)
{
global actionTaken, fallBackPause, visualAidIsOn, knob, vW, vH,k
MouseGetPos,X,Y
X-=OX
Y-=OY
RR:=sqrt(X**2+Y**2)
if (RR>r)
{
X:=round(X*(r-dr)/RR)
Y:=round(Y*(r-dr)/RR)
MouseMove,X+OX,Y+OY
}
if visualAidIsOn=1
{
kX:=round(vOX+X/r*vW/2-kr)
kY:=round(vOY+Y/r*vH/2-kr)
SetWinDelay,-1
WinMove,ahk_id %knob%,, kX,kY
}
if (RR>k*r)
{
phi:=getAngle(X,Y)
seg:=getSegment(phi)
actionm2k(seg)
actionTaken:=1
}
else
{
changeStateTo([0,0,0,0])
if (fallBackPause!=-1 && actionTaken=1)
{
MouseMove,OX,OY
if visualAidIsOn=1
{
kX:=vOX-kr
kY:=vOY-kr
WinMove,ahk_id %knob%,, kX,kY
}
mouseBlock()
actionTaken:=0
}
}
}
actionm2k(seg)
{
if (seg=1 || seg=12)
changeStateTo([0,0,0,1])
else if (seg=2)
changeStateTo([0,0,1,1])
else if (seg=3 || seg= 4)
changeStateTo([0,0,1,0])
else if (seg=5)
changeStateTo([0,1,1,0])
else if (seg=6 || seg=7)
changeStateTo([0,1,0,0])
else if (seg=8)
changeStateTo([1,1,0,0])
else if (seg=9 || seg=10)
changeStateTo([1,0,0,0])
else if (seg=11)
changeStateTo([1,0,0,1])
else
return -1
return
}
changeStateTo(newState)
{
global keyNames, currentState
Loop, 4
if (newState[A_Index]!=currentState[A_Index] && keyNames[A_Index])
Send,% "{" . keyNames[A_Index] . (newState[A_Index] ? " Down}" : " Up}")
currentState:=newState
return
}
getSegment(phi)
{
global segmentEndAngles
Loop 12
if(phi<segmentEndAngles[A_Index])
return A_Index
return -1
}
getAngle(x,y)
{
global pi
if (x=0)
return 3*pi/2-(y>0)*pi
phi:=atan(y/x)
if (x<0 && y>0)
return phi+pi
if (x<0 && y<=0)
return phi+pi
if (x>0 && y<0)
return phi+2*pi
return phi
}
mouseBlock()
{
global fallBackPause
BlockInput, MouseMove
Sleep, %fallBackPause%
BlockInput, MouseMoveOff
}
exitFunc()
{
global
setStick(0,0)
vstick.Relinquish()
BlockInput, MouseMoveOff
DllCall("User32.dll\ShowCursor", "Int", 1)
ExitApp
}
SetSystemCursor( Cursor = "", cx = 0, cy = 0 )
{
BlankCursor := 0, SystemCursor := 0, FileCursor := 0
SystemCursors = 32512IDC_ARROW,32513IDC_IBEAM,32514IDC_WAIT,32515IDC_CROSS
,32516IDC_UPARROW,32640IDC_SIZE,32641IDC_ICON,32642IDC_SIZENWSE
,32643IDC_SIZENESW,32644IDC_SIZEWE,32645IDC_SIZENS,32646IDC_SIZEALL
,32648IDC_NO,32649IDC_HAND,32650IDC_APPSTARTING,32651IDC_HELP
If Cursor =
{
VarSetCapacity( AndMask, 32*4, 0xFF ), VarSetCapacity( XorMask, 32*4, 0 )
BlankCursor = 1
}
Else If SubStr( Cursor,1,4 ) = "IDC_"
{
Loop, Parse, SystemCursors, `,
{
CursorName := SubStr( A_Loopfield, 6, 15 )
CursorID := SubStr( A_Loopfield, 1, 5 )
SystemCursor = 1
If ( CursorName = Cursor )
{
CursorHandle := DllCall( "LoadCursor", Uint,0, Int,CursorID )
Break
}
}
If CursorHandle =
{
CursorHandle = Error
}
}
Else If FileExist( Cursor )
{
SplitPath, Cursor,,, Ext
If Ext = ico
uType := 0x1
Else If Ext in cur,ani
uType := 0x2
Else
{
CursorHandle = Error
}
FileCursor = 1
}
Else
{
CursorHandle = Error
}
If CursorHandle != Error
{
Loop, Parse, SystemCursors, `,
{
If BlankCursor = 1
{
Type = BlankCursor
%Type%%A_Index% := DllCall( "CreateCursor"
, Uint,0, Int,0, Int,0, Int,32, Int,32, Uint,&AndMask, Uint,&XorMask )
CursorHandle := DllCall( "CopyImage", Uint,%Type%%A_Index%, Uint,0x2, Int,0, Int,0, Int,0 )
DllCall( "SetSystemCursor", Uint,CursorHandle, Int,SubStr( A_Loopfield, 1, 5 ) )
}
Else If SystemCursor = 1
{
Type = SystemCursor
CursorHandle := DllCall( "LoadCursor", Uint,0, Int,CursorID )
%Type%%A_Index% := DllCall( "CopyImage"
, Uint,CursorHandle, Uint,0x2, Int,cx, Int,cy, Uint,0 )
CursorHandle := DllCall( "CopyImage", Uint,%Type%%A_Index%, Uint,0x2, Int,0, Int,0, Int,0 )
DllCall( "SetSystemCursor", Uint,CursorHandle, Int,SubStr( A_Loopfield, 1, 5 ) )
}
Else If FileCursor = 1
{
Type = FileCursor
%Type%%A_Index% := DllCall( "LoadImageA"
, UInt,0, Str,Cursor, UInt,uType, Int,cx, Int,cy, UInt,0x10 )
DllCall( "SetSystemCursor", Uint,%Type%%A_Index%, Int,SubStr( A_Loopfield, 1, 5 ) )
}
}
}
}
RestoreCursors()
{
SPI_SETCURSORS := 0x57
DllCall( "SystemParametersInfo", UInt,SPI_SETCURSORS, UInt,0, UInt,0, UInt,0 )
}
BlockSomeKeyboardInputs(state = "On")
{
global JoystickBindsList
Loop,Parse,JoystickBindsList, `"
{
Hotkey, $%A_LoopField%, KeyboardDummyLabel2, %state% UseErrorLevel
Hotkey, $%A_LoopField% up, KeyboardDummyLabel2, %state% UseErrorLevel
}
Return
KeyboardDummyLabel2:
Return
Return
}
BlockKeyboardInputs(state = "On")
{
static keys
keys= q"w"e"r"t"y"u"i"o"p"["]"a"s"d"f"g"h"j"k"l"'"\"z"x"c"v"b"n"m","."1"2"3"4"5"6"7"8"9"0"-"="f1"f2"f3"f4"f5"f6"f7"f8"f9"f10"f11"f12"esc"`"tab"capslock"lshift"lctrl"lalt"rshift"ralt"rctrl"up"down"left"right"enter"space"backspace"numpad1"numpad2"numpad3"numpad4"numpad5"numpad6"numpad7"numpad8"numpad9"numpad0"numlock"numpaddiv"numpadmult"numpadadd"numpadsub"numpadenter"numpaddot"numpaddel"insert"home"end"pgup"pgdn"lbutton"rbutton"mbutton"xbutton1"xbutton2
Loop,Parse,keys, `"
{
Hotkey, $%A_LoopField%, KeyboardDummyLabel, %state% UseErrorLevel
Hotkey, $%A_LoopField% up, KeyboardDummyLabel, %state% UseErrorLevel
}
Return
KeyboardDummyLabel:
Return
Return
}
visualaid:
icX:=vW*(1-k)/2
icY:=vH*(1-k)/2
icW:=vW*k
Gui, VA: new
Gui, VA: +ToolWindow -Caption +AlwaysOnTop +HWNDva
Gui, VA: add, Picture, BackgroundTrans X0 Y0, images\outerRing.png
Gui, VA: add, Picture, BackgroundTrans X%icX% Y%icY% W%icW% H-1 hwndIC, images\innerCircle.png
Gui, VA: Color, FFFFFF
kd:=kr*2
Gui, VAknob: new
Gui, VAknob: +ToolWindow -Caption +AlwaysOnTop +HWNDknob
Gui, VAknob: add, Picture,X0 Y0 W%kd% H-1, images\knob.png
Gui, VAknob: Color, FFFFFF
return
ScriptOnOff:
Gui, ONoff: +AlwaysOnTop -Caption +Owner +LastFound
Gui, ONoff: Margin, 0, 0
Gui, ONoff: Color, Black
Gui, ONoff: Font, cWhite s50 bold, Arial
ScreenW:=A_ScreenWidth
Gui, ONoff: Add, Text, center w%ScreenW%, %text%
WinSet, Transparent, 200
Gui, ONoff:Show, NoActivate x0 y0, w%ScreenW% h150
sleep 1000
Gui, ONoff:Destroy
return
maingui:
if MainGui!=1
{
MainGui=1
SetTimer, CheckboxTimer, 500
AllButtonsList = q"w"e"r"t"y"u"i"o"p"["]"a"s"d"f"g"h"j"k"l"'"\"z"x"c"v"b"n"m","."1"2"3"4"5"6"7"8"9"0"-"="f1"f2"f3"f4"f5"f6"f7"f8"f9"f10"f11"f12"esc"`"tab"capslock"lshift"lctrl"lalt"rshift"ralt"rctrl"up"down"left"right"enter"space"backspace"numpad1"numpad2"numpad3"numpad4"numpad5"numpad6"numpad7"numpad8"numpad9"numpad0"numlock"numpaddiv"numpadmult"numpadadd"numpadsub"numpadenter"numpaddot"numpaddel"insert"home"end"pgup"pgdn"lbutton"rbutton"mbutton"xbutton1"xbutton2
gui, Add, Pic, x0 y0 w847 h669 vpic_get1, %a_temp%\Gamepad.jpg
gui, Add, Button, vbindButton1L x565 y35 w90 h30 gbindButton1
gui, Add, Button, vbindButton2L x565 y88 w90 h30 gbindButton2
gui, Add, Button, vbindButton3L x565 y141 w90 h30 gbindButton3
gui, Add, Button, vbindButton4L x565 y194 w90 h30 gbindButton4
gui, Add, Button, vbindButton5L x565 y247 w90 h30 gbindButton5
gui, Add, Button, vbindButton6L x565 y300 w90 h30 gbindButton6
gui, Add, Button, vbindButton7L x20 y35 w90 h30 gbindButton7
gui, Add, Button, vbindButton8L x20 y88 w90 h30 gbindButton8
gui, Add, Button, vbindButton9L x20 y141 w90 h30 gbindButton9
gui, Add, Button, vbindButton10L x20 y194 w90 h30 gbindButton10
gui, Add, Button, vbindButton11L x20 y247 w90 h30 gbindButton11
gui, Add, Button, vbindButton12L x20 y300 w90 h30 gbindButton12
gui, Add, Checkbox, x566 y22 vButtonTog1, B1
gui, Add, Checkbox, x566 y75 vButtonTog2, B2
gui, Add, Checkbox, x566 y128 vButtonTog3, B3
gui, Add, Checkbox, x566 y181 vButtonTog4, B4
gui, Add, Checkbox, x566 y234 vButtonTog5, B5
gui, Add, Checkbox, x566 y287 vButtonTog6, B6
gui, Add, Checkbox, x21 y22 vButtonTog7, B7
gui, Add, Checkbox, x21 y75 vButtonTog8, B8
gui, Add, Checkbox, x21 y128 vButtonTog9, B9
gui, Add, Checkbox, x21 y181 vButtonTog10, B10
gui, Add, Checkbox, x21 y234 vButtonTog11, B11
gui, Add, Checkbox, x21 y287 vButtonTog12, B12
gui, Add, Checkbox, x710 y560 vToggleMouseDisable, Disable Mouse
gui, Add, Checkbox, x710 y520 vToggleAlWaysOn, Dont Close`nSettings Window
gui, Add, Checkbox, x710 y330 vToggleInvertedX, InvertX
gui, Add, Checkbox, x775 y330 vToggleInvertedY, InvertY
gui, Add, Checkbox, x710 y158 vToggleRawMode, Raw Input Mode
gui, Add, Button, vbindLStickUpL x60 y440 w80 h30 gbindLStickUp
gui, Add, Button, vbindLStickDownL x60 y500 w80 h30 gbindLStickDown
gui, Add, Button, vbindLStickLeftL x20 y470 w80 h30 gbindLStickLeft
gui, Add, Button, vbindLStickRightL x100 y470 w80 h30 gbindLStickRight
gui, Add, Button, vbindButton13L x295 y380 w80 h30 gbindButton13
gui, Add, Button, vbindButton16L x295 y440 w80 h30 gbindButton16
gui, Add, Button, vbindButton15L x255 y410 w80 h30 gbindButton15
gui, Add, Button, vbindButton14L x335 y410 w80 h30 gbindButton14
gui, Add, Button, x710 y20 w120 h30 gOk, OK
gui, Add, Button, x710 y55 w120 h30 gTest, Test
gui, Add, Button, x710 y90 w120 h30 gExitFunc, Exit
gui, Add, Button, vWalkl x40 y562 w120 h25 gWalk
gui, Add, Button, vAbsoluteRelativel x512 y562 w120 h25 gAbsoluteRelative
gui, Add, Button, vStartScriptKeyl x260 y635 w150 h25 gStartScriptKey
gui, Add, Button, vStickModeLSRSl x275 y515 w120 h25 gStickModeLSRS
gui, Add, Button, vSettingsL x710 y360 w120 h40 gSettings, Vjoy Settings
Gui, add, Slider, x475 y430 w200 vSliderthresHold gthresHold	Range1-25 tickinterval1-25 AltSubmit
Gui, add, Slider, x475 y480 w200 vSliderSensitivity gSensitivity	Range1-150 tickinterval1-150 AltSubmit
Gui, add, text, x475 y462 w200 h18 vTextthresHold
Gui, add, text, x475 y512 w200 h18 vTextSensitivity
gosub, loadBinds
thresHoldValue:=SubStr(thresHold, 3, 2)
GuiControl,, SliderthresHold, %thresHoldValue%
GuiControl,, SliderSensitivity, %Sensitivity%
GuiControl,, TextthresHold, 0.01                Value = %thresHold%                  0.5
if Sensitivity<10
GuiControl,, TextSensitivity, 1                      Value = 00%Sensitivity%               150
if (Sensitivity>=10) and (Sensitivity<100)
GuiControl,, TextSensitivity, 1                      Value = 0%Sensitivity%               150
if Sensitivity>=100
GuiControl,, TextSensitivity, 1                      Value = %Sensitivity%               150
loop, Parse, ButtonToggle, `"
{
VarTogRead:=A_LoopField
GuiControl,,ButtonTog%A_Index%, %VarTogRead%
}
GuiControl,,ToggleInvertedX, %InvertedX%
GuiControl,,ToggleInvertedY, %InvertedY%
GuiControl,,ToggleMouseDisable, %MouseDisable%
GuiControl,,ToggleAlWaysOn, %ToggleAlWaysOn%
GuiControl,,ToggleRawMode, %ToggleRawMode%
if StickModeLSRS=0
GuiControl,,StickModeLSRSl, LStick-RStick
else
GuiControl,,StickModeLSRSl, RStick-LStick
Gui, Show, Center w847 h669, GPDSCK
}
return
thresHold:
Gui,Submit,NoHide
int1 := sliderthresHold/100
fra1 := Mod(int1, 10)
fra1 := SubStr(fra1, 2, 3)
thresHold :=  Floor(int1) fra1
GuiControl,, TextthresHold, 0.01                Value = %thresHold%                  0.5
IniWrite, %thresHold%, %a_Workingdir%\Settings.ini, Mouse, thresHold
return
Sensitivity:
Gui,Submit,NoHide
Sensitivity := SliderSensitivity
if Sensitivity<10
GuiControl,, TextSensitivity, 1                      Value = 00%Sensitivity%               150
if (Sensitivity>=10) and (Sensitivity<100)
GuiControl,, TextSensitivity, 1                      Value = 0%Sensitivity%               150
if Sensitivity>=100
GuiControl,, TextSensitivity, 1                      Value = %Sensitivity%               150
IniWrite, %Sensitivity%, %a_Workingdir%\Settings.ini, Mouse, Sensitivity
return
bindButton1:
KeyPressDetected=0
GuiControl,,bindButton1L, Press any Key
savedkey=Bind1
SetTimer, whatkey, 0
return
bindButton2:
KeyPressDetected=0
GuiControl,,bindButton2L, Press any Key
savedkey=bind2
SetTimer, whatkey, 0
return
bindButton3:
KeyPressDetected=0
GuiControl,,bindButton3L, Press any Key
savedkey=bind3
SetTimer, whatkey, 0
return
bindButton4:
KeyPressDetected=0
GuiControl,,bindButton4L, Press any Key
savedkey=bind4
SetTimer, whatkey, 0
return
bindButton5:
KeyPressDetected=0
GuiControl,,bindButton5L, Press any Key
savedkey=bind5
SetTimer, whatkey, 0
return
bindButton6:
KeyPressDetected=0
GuiControl,,bindButton6L, Press any Key
savedkey=bind6
SetTimer, whatkey, 0
return
bindButton7:
KeyPressDetected=0
GuiControl,,bindButton7L, Press any Key
savedkey=bind7
SetTimer, whatkey, 0
return
bindButton8:
KeyPressDetected=0
GuiControl,,bindButton8L, Press any Key
savedkey=bind8
SetTimer, whatkey, 0
return
bindButton9:
KeyPressDetected=0
GuiControl,,bindButton9L, Press any Key
savedkey=bind9
SetTimer, whatkey, 0
return
bindButton10:
KeyPressDetected=0
GuiControl,,bindButton10L, Press any Key
savedkey=bind10
SetTimer, whatkey, 0
return
bindButton11:
KeyPressDetected=0
GuiControl,,bindButton11L, Press any Key
savedkey=bind11
SetTimer, whatkey, 0
return
bindButton12:
KeyPressDetected=0
GuiControl,,bindButton12L, Press any Key
savedkey=bind12
SetTimer, whatkey, 0
return
bindButton13:
KeyPressDetected=0
GuiControl,,bindButton13L, Press any Key
savedkey=bind13
SetTimer, whatkey, 0
return
bindButton14:
KeyPressDetected=0
GuiControl,,bindButton14L, Press any Key
savedkey=bind14
SetTimer, whatkey, 0
return
bindButton15:
KeyPressDetected=0
GuiControl,,bindButton15L, Press any Key
savedkey=bind15
SetTimer, whatkey, 0
return
bindButton16:
KeyPressDetected=0
GuiControl,,bindButton16L, Press any Key
savedkey=bind16
SetTimer, whatkey, 0
return
bindLStickUp:
KeyPressDetected=0
GuiControl,,bindLStickUpL, Press any Key
savedkey=Bind17
SetTimer, whatkey, 0
return
bindLStickDown:
KeyPressDetected=0
GuiControl,,bindLStickDownL, Press any Key
savedkey=Bind18
SetTimer, whatkey, 0
return
bindLStickLeft:
KeyPressDetected=0
GuiControl,,bindLStickLeftL, Press any Key
savedkey=Bind19
SetTimer, whatkey, 0
return
bindLStickRight:
KeyPressDetected=0
GuiControl,,bindLStickRightL, Press any Key
savedkey=Bind20
SetTimer, whatkey, 0
return
StartScriptKey:
KeyPressDetected=0
GuiControl,,StartScriptKeyL, Press any Key
savedkey=StartScriptKey
SetTimer, whatkey, 0
return
Walk:
KeyPressDetected=0
GuiControl,,walkL, Press any Key
savedkey=bind21
SetTimer, whatkey, 0
return
AbsoluteRelative:
KeyPressDetected=0
GuiControl,,AbsoluteRelativeL, Press any Key
savedkey=bind22
SetTimer, whatkey, 0
return
StickModeLSRS:
if StickModeLSRS=1
{
StickModeLSRS=0
Iniwrite, %StickModeLSRS% ,%a_workingdir%\Settings.ini, Mouse, StickModeLSRS
GuiControl,,StickModeLSRSl, LStick-RStick
return
}
else
{
StickModeLSRS=1
Iniwrite, %StickModeLSRS% ,%a_workingdir%\Settings.ini, Mouse, StickModeLSRS
GuiControl,,StickModeLSRSl, RStick-LStick
return
}
return
Settings:
IfExist, C:\Program Files\vJoy\x64\vJoyConf.exe
run, "C:\Program Files\vJoy\x64\vJoyConf.exe"
Else
Msgbox, Please Install vJoy in Default path = "C:\Program Files\vJoy\x64\vJoyConf.exe"
return
Test:
run, joy.cpl
return
GuiClose:
Gui, Destroy
ExitApp
Ok:
if ToggleAlWaysOn=0
{
Gui, Destroy
MainGui=0
}
return
wheelupBind:
bindWUMUp=1
sleep 150
bindWUMUp=0
return
wheeldownbind:
bindWUMDown=1
sleep 150
bindWUMDown=0
return
whatkey:
Hotkey,$%StartScriptKey%,StartScript, off
BlockKeyboardInputs("On")
Hotkey,wheelup,wheelupBind, on
Hotkey,wheeldown,wheeldownbind, on
Loop, Parse, AllButtonsList, `"
{
bindkeyName:=A_LoopField
if getkeystate(bindkeyName,"p")
{
if savedkey=StartScriptKey
{
if bindkeyName=Lbutton
{
BlockKeyboardInputs("Off")
msgbox, You can't bind LButton to "Start Script"
KeyPressDetected=1
break
}
Loop, Parse, JoystickBindsList, `"
{
FoundUsedKey:=A_LoopField
if !FoundUsedKey
continue
if FoundUsedKey=%bindKeyName%
{
BlockKeyboardInputs("Off")
msgbox, You can bind only 1 key to "Start Script"
KeyPressDetected=1
break 2
}
}
IniWrite, %bindKeyName%, %a_Workingdir%\Settings.ini, General, StartScriptKey
KeyPressDetected=1
break
}
if savedkey!=StartScriptKey
{
if StartScriptKey=%bindkeyName%
{
BlockKeyboardInputs("Off")
msgbox, You can bind only 1 key to "Start Script"
KeyPressDetected=1
break
}
%savedkey%=%bindkeyName%
IniWrite, %bind1%`"%bind2%`"%bind3%`"%bind4%`"%bind5%`"%bind6%`"%bind7%`"%bind8%`"%bind9%`"%bind10%`"%bind11%`"%bind12%`"%bind13%`"%bind14%`"%bind15%`"%bind16%`"%bind17%`"%bind18%`"%bind19%`"%bind20%`"%bind21%`"%bind22%, %a_Workingdir%\Settings.ini, JoystickBinds, JoystickBindsList
KeyPressDetected=1
break
}
}
}
if (bindWUMUp=1) or (bindWUMDown=1)
{
if savedkey!=Bind17
if savedkey!=Bind18
if savedkey!=Bind19
if savedkey!=Bind20
if savedkey!=Bind21
if savedkey!=Bind22
{
if bindwumup=1
bindkeyName=MWUp
if bindwumdown=1
bindkeyName=MWDown
%savedkey%=%bindkeyName%
IniWrite, %bind1%`"%bind2%`"%bind3%`"%bind4%`"%bind5%`"%bind6%`"%bind7%`"%bind8%`"%bind9%`"%bind10%`"%bind11%`"%bind12%`"%bind13%`"%bind14%`"%bind15%`"%bind16%`"%bind17%`"%bind18%`"%bind19%`"%bind20%`"%bind21%`"%bind22%, %a_Workingdir%\Settings.ini, JoystickBinds, JoystickBindsList
KeyPressDetected=1
}
}
if KeyPressDetected=1
{
Hotkey,wheelup,wheelupbind, off
Hotkey,wheeldown,wheeldownbind, off
gosub, loadbinds
sleep 90
BlockKeyboardInputs("Off")
Hotkey,$%StartScriptKey%,StartScript, on
SetTimer,WhatKey,off
}
return
!^Del::
RestoreCursors()
exitapp
return
^Backspace::
if (Toggle=1) and (MainGui!=1) and (ToggleAlWaysOn=0)
Gosub, MainGui
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Lamron750, nacken012, septrinus and 234 guests