- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
How to disable diagonal movement on G13 joystick?
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-12-2010 09:46 PM - edited 08-12-2010 09:50 PM
Hi all,
after searching here and google extensively, I've not been able to find the answer.
I would like to disable the diagonal movements on the G13 joystick, so the result is I can only use the NESW directions. This is so I can bind forward/backward and strafe left/right without the diagonal sending a combination of, eg, forward and strafe left.
I think it's done via scripting (from the few inconclusive posts I found), but I can't work out how to detect if both buttons are pressed at the same then, and then to do nothing.
Lastly, in case it's of help to others I have some powerpoint/pdf technical diagrams of the G13 which I've printed out, to help me remember them. Download from here.
Re: How to disable diagonal movement on G13 joystick?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-13-2010 07:00 AM
yes, it's done via scripting:
function OnEvent(event, arg, family)
if event == "G_PRESSED" and arg == 26 then
if not kLR then PressKey("w"); kLR = true end
gUp = true
elseif event == "G_PRESSED" and arg == 27 then
if not kUD then PressKey("d"); kUD = true end
gRt = true
elseif event == "G_PRESSED" and arg == 28 then
if not kLR then PressKey("s"); kLR = true end
gDn = true
elseif event == "G_PRESSED" and arg == 29 then
if not kUD then PressKey("a"); kUD = true end
gLf = true
elseif event == "G_RELEASED" and arg == 26 then
if kUD then ReleaseKey("w"); kUD = false end
gUp = false
if gLf and not kLR then PressKey("a"); kLR = true end
if gRt and not kLR then PressKey("d"); kLR = true end
elseif event == "G_RELEASED" and arg == 27 then
if kLR then ReleaseKey("d"); kLR = false end
gRt = false
if gUp and not kUD then PressKey("w"); kUD = true end
if gDn and not kUD then PressKey("s"); kUD = true end
elseif event == "G_RELEASED" and arg == 28 then
if kUD then ReleaseKey("s"); kUD = false end
gDn = false
if gLf and not kLR then PressKey("a"); kLR = true end
if gRt and not kLR then PressKey("d"); kLR = true end
elseif event == "G_RELEASED" and arg == 29 then
if kLR then ReleaseKey("a"); kLR = false end
gLf = false
if gUp and not kUD then PressKey("w"); kUD = true end
if gDn and not kUD then PressKey("s"); kUD = true end
end
end
this script binds the thumbstick to the WASD keys, with diagonals disabled. if you want to bind the thumbstick to other keys, change all the "w", "a", "s" and "d" values with the keys you want instead.
untested, but it should work. don't forget to assign the thumbstick directions to the 'Script' action in Key Profiler, otherwise the script won't be invoked for them.
-ken
I do not work for Logitech. I'm just a user.
Re: How to disable diagonal movement on G13 joystick?
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-14-2010 11:21 PM - edited 08-15-2010 09:12 PM
Thank you.
I found it made my character run non-stop in a line and would not work intermittently, but now that you've provided a code base I hope I can bugfix it.
Re: How to disable diagonal movement on G13 joystick?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-15-2010 10:01 PM
Ah, fixed it. You'd just transposed kUD and kLR.
Here's the working version.
I'm sure there will be other people who want this, thanks Ken!
function OnEvent(event, arg, family)
if event == "G_PRESSED" and arg == 26 then
if not kLR then PressKey("w"); kUD = true end
gUp = true
elseif event == "G_PRESSED" and arg == 27 then
if not kUD then PressKey("d"); kLR = true end
gRt = true
elseif event == "G_PRESSED" and arg == 28 then
if not kLR then PressKey("s"); kUD = true end
gDn = true
elseif event == "G_PRESSED" and arg == 29 then
if not kUD then PressKey("a"); kLR = true end
gLf = true
elseif event == "G_RELEASED" and arg == 26 then
if kUD then ReleaseKey("w"); kUD = false end
gUp = false
if gLf and not kLR then PressKey("a"); kLR = true end
if gRt and not kLR then PressKey("d"); kLR = true end
elseif event == "G_RELEASED" and arg == 27 then
if kLR then ReleaseKey("d"); kLR = false end
gRt = false
if gUp and not kUD then PressKey("w"); kUD = true end
if gDn and not kUD then PressKey("s"); kUD = true end
elseif event == "G_RELEASED" and arg == 28 then
if kUD then ReleaseKey("s"); kUD = false end
gDn = false
if gLf and not kLR then PressKey("a"); kLR = true end
if gRt and not kLR then PressKey("d"); kLR = true end
elseif event == "G_RELEASED" and arg == 29 then
if kLR then ReleaseKey("a"); kLR = false end
gLf = false
if gUp and not kUD then PressKey("w"); kUD = true end
if gDn and not kUD then PressKey("s"); kUD = true end
end
end
Re: How to disable diagonal movement on G13 joystick?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-16-2010 07:07 AM
I'm glad to hear you got it fixed. thanks for sharing the correction; I'm sure this topic will come up again.
-ken
I do not work for Logitech. I'm just a user.
