Ikhix
Ikhix

Reputation: 1

Logitech G Hub Jump Script

I have been trying to make a script that works like this

Enable with scroll lock

Hold space = Press Space every 20ms

I have the G3 key as a placeholder for space because I can't figure out how to do a if PressKey("space") type thing

Heres what I have so far

function OnEvent(event, arg)
if (event == "G_PRESSED" and arg == 3) and IsKeyLockOn("scrolllock") then
PressKey("spacebar")
sleep(20)
ReleaseKey("spacebar")
repeat
until not (event == "G_PRESSED" and arg == 3)
end
end

Upvotes: 0

Views: 2159

Answers (1)

Egor Skriptunoff
Egor Skriptunoff

Reputation: 23767

I can't figure out how to do a if PressKey("space") type thing

LGS/GHUB is unable to monitor press/release of usual keys (letters, digits, spacebar) on your keyboard.
Such feature would make possible to write a keylogger script in Lua, and Logitech wants to prevent this.

Hold G3 = Press Space every 20ms

You don't need to write Lua code for this.
Just bind G3 to a looped macro.
Set "toggle" as macro's type to stop the macro by pressing G3 again.
Of course, such macro would ignore ScrollLock.

Upvotes: 0

Related Questions