Reply
Logi Nu
34359
Posts: 2
Registered: ‎07-22-2011
0

3D artist needs help with click-hold script...

[ Edited ]

I'm a 3D artist in the game industry. The G13 has been a huge help to me. Especially in reducing RSI pain related to long hours and familial hand Tremor.

 

So my question...

 

I use Maya for animation. One key combination throws my hands into a fit. It requires dragging the mouse while holding Shift + Alt + Left click + Middle click. (If anyone is curious this command is for scaling curves in the graph editor.)

 

I've tried creating a macro. But it seems to require two keys. One to initiate Hotkeys+Click hold and one to trigger Hotkeys release+Click release. I really need a single key, thus I assume a script is needed.

 

If anyone could help it would be much appreciated.

 

Thx

-B

 

 

kgober
Posts: 3,772
Kudos: 439
Solutions: 287
Registered: ‎05-28-2009
0

Re: 3D artist needs help with click-hold script...

function OnEvent(event, arg, family)
    if event == "G_PRESSED" and arg == 22 then
        PressKey("lshift")
        PressKey("lalt")
        PressMouseButton(1)
        PressMouseButton(2)
    elseif event == "G_RELEASED" and arg == 22 then
        ReleaseMouseButton(2)
        ReleaseMouseButton(1)
        ReleaseKey("lalt")
        ReleaseKey("lshift")
    end
end

 untested, but probably ok.  this script is for G22, change "22" to something else if you want to use a different G-key (and don't forget to bind that key to the "Script" action if you're using v3.06 drivers; in newer drivers this step isn't necessary).

 

for PressMouseButton() and ReleaseMouseButton(), I think 1 is left mouse button, 2 is middle mouse button, and 3 is right mouse button, but I'm not 100% certain.

 

-ken

________________________________
I do not work for Logitech. I'm just a user.
Logi Nu
34359
Posts: 2
Registered: ‎07-22-2011
0

Re: 3D artist needs help with click-hold script...

PERFECT. Works exactly how I hoped!!

 

Your script is also a great template for other simple click+drag commands. This is going to be extremely helpful now that I can visualize the basics of how it works.

 

Thanks again!

 

-B