Reply
Logi Nu
csb82
Posts: 2
Registered: ‎12-02-2010
0

need a script for switching the state of the joystick

[ Edited ]

I've been digging around trying to find something like this but have had no luck.

 

What I want is a script that when I pess and hold a G key on my g13 it presses a keyboad key and changes the state of the thumb stick from joystick to mouse and does all of the above in reverse when released.

 

 

so...

 

on press G key 15

     press and release keyboard key t

          set state one thumb stick to mouse

on release of G key 15

     press and release keyboard key t

          set state one thumb stick to joystick

 

 

Thanks in advance for anyone who can help

kgober
Posts: 3,761
Kudos: 437
Solutions: 287
Registered: ‎05-28-2009
0

Re: need a script for switching the state of the joystick

is it possible to set the thumbstick to joystick mode in M1, and mouse mode in M3?  if it is, then you can set up G15 to press a key and switch to M3 on press, and press a key and switch back to M1 on release.  you can do this by binding G15 to the 'Script' action (do this in both M1 and M3) and entering the following Lua script in the script editor:

 

function OnEvent(event, arg, family)
    if event == "G_PRESSED" and arg == 15 then
        PressAndReleaseKey("t")
        SetMKeyState(3, "lhc")
    elseif event == "G_RELEASED" and arg == 15 then
        PressAndReleaseKey("t")
        SetMKeyState(1, "lhc")
    end
end

 

 

I'm not able to test this myself right now -- the only test machine accessible to me at the moment is running v3.03 of the software, which doesn't support mouse mode (you need v3.04b or newer, iirc).

 

-ken

________________________________
I do not work for Logitech. I'm just a user.