So, I came up with this gem. It works very well even with the delay between my remote computer and host.
It has the typical left, right, up, down, but can also do the diagonals. Delete on my keyboard is right above my arrow left key, so that's my left click and Page Down is above my right arrow key, so that's right click.
You can adjust the scroll speed with the + and - on the numberpad and it stores your speed in your computer's registry so it will be the same next time you use it.
I don't have it locked into an #If section to only activate with Minecraft up, but you can if you want.
Code: Select all
#SingleInstance, Force
SendMode, InputthenPlay
SetBatchLines -1
RegRead, IncrementValue, HKCU, Minecraft\KeyboardControl, IncrementValue
If ErrorLevel
{
IncrementValue = 5
RegWrite, Reg_DWORD, HKCU, Minecraft\KeyboardControl, IncrementValue, 5
}
MouseDelay = 0
Return
Left::
Right::
Up::
Down::
If (A_ThisHotkey = "Down")
{
If (GetKeyState("Right", "P"))
xVal := IncrementValue, yVal = IncrementValue
Else
If (GetKeyState("Left", "P"))
xVal := -IncrementValue, yVal = IncrementValue
Else
xVal := 0, yVal := IncrementValue
}
If (A_ThisHotkey = "Up")
{
If (GetKeyState("Right", "P"))
xVal := IncrementValue, yVal = -IncrementValue
Else
If (GetKeyState("Left", "P"))
xVal := -IncrementValue, yVal = -IncrementValue
Else
xVal := 0, yVal = -IncrementValue
}
If (A_ThisHotkey = "Left")
{
If (GetKeyState("Up", "P"))
xVal := -IncrementValue, yVal = -IncrementValue
Else
If (GetKeyState("Down", "P"))
xVal := -IncrementValue, yVal = IncrementValue
Else
xVal := -IncrementValue, yVal = 0
}
If (A_ThisHotkey = "Right")
{
If (GetKeyState("Up", "P"))
xVal := IncrementValue, yVal = -IncrementValue
Else
If (GetKeyState("Down", "P"))
xVal := IncrementValue, yVal = IncrementValue
Else
xVal := IncrementValue, yVal = 0
}
If GetKeyState(A_ThisHotKey, "P")
DllCall("mouse_event", uint, 1, int, xVal, int, yVal, uint, 0, int, 0) ;-- Relative mouse position instead of absolute
Return
Del::Click down
Del UP::Click up
PgDn::Click, Right Down
PgDn up::Click, Right Up
NumpadAdd::
IncrementValue := IncrementValue + 5
RegWrite, Reg_DWORD, HKCU, Minecraft\KeyboardControl, IncrementValue, %IncrementValue%
ToolTip,%IncrementValue%
SetTimer, TT_Off, -2000
Return
NumpadSub::
IfGreater, IncrementValue, 5
IncrementValue := IncrementValue - 5
RegWrite, Reg_DWORD, HKCU, Minecraft\KeyboardControl, IncrementValue, %IncrementValue%
ToolTip,%IncrementValue%
SetTimer, TT_Off, -2000
Return
TT_Off:
ToolTip
Return
^Esc::ExitApp