Page 1 of 1

Need help with a programmable keyboard

Posted: May 23rd, 2018, 11:00 pm
by RickC
Need some help with a script for a Logitech G710+ keyboard

I am disabled and use an oversized trackball to aim and fire. This takes both of my hands so holding breath was not an option for me until I got the above programmable keyboard.

With the help of a member here I have a script that uses my G4 key to toggle the "up" key on and off. Press G4 to press and hold down the up key, press again to release. The hold breath function is bound to the up arrow key.

This has worked for a long time, but now has stopped working.

Below is my script. Could anyone here tell me why this is not working?


function OnEvent(event, arg, family)
if arg == 4 then -- change number to Gkey you want
if event == "G_PRESSED" then
toggle = not toggle
if toggle then
PressKey("up")
else
ReleaseKey("up")
end
end

Re: Need help with a programmable keyboard

Posted: May 23rd, 2018, 11:15 pm
by VonStratos
I don't know much about programing, but if you are using mainly one hand to control the game, and that hand is the one that aim and shoot, then one solution may be to get a gaming mouse like the old reliable Razer Naga or similar, those mouse have many shortcut buttons so you can have many function in one hand, of course it depend on your budget, but if you can spare the money they can be very useful. And i hope someone can help you more with that script.

Re: Need help with a programmable keyboard

Posted: May 23rd, 2018, 11:57 pm
by Fletchette
RickC wrote:Need some help with a script for a Logitech G710+ keyboard

I am disabled and use an oversized trackball to aim and fire. This takes both of my hands so holding breath was not an option for me until I got the above programmable keyboard.

With the help of a member here I have a script that uses my G4 key to toggle the "up" key on and off. Press G4 to press and hold down the up key, press again to release. The hold breath function is bound to the up arrow key.

This has worked for a long time, but now has stopped working.

Below is my script. Could anyone here tell me why this is not working?


function OnEvent(event, arg, family)
if arg == 4 then -- change number to Gkey you want
if event == "G_PRESSED" then
toggle = not toggle
if toggle then
PressKey("up")
else
ReleaseKey("up")
end
end
Assuming that's the entire script, then it looks like there are (2) end statements missing at the bottom....There should be 4.

Re: Need help with a programmable keyboard

Posted: May 24th, 2018, 2:26 pm
by RickC
Fletchette wrote: Assuming that's the entir1e script, then it looks like there are (2) end statements missing at the bottom....There should be 4.
That fixed it, Thank you!