Jump to content

Mouseclick + Keys combination to send a MMB click ?


Recommended Posts

I'm working with Autodesk Maya and as a 3d animator, I need to work with a tablet. Because of some recent thumb injuries, I cannot (and should never ever) use the buttons on my pen as MMB and RMB! : 
 
A 3 buttons mouses is a must have in Maya. So, I need to find a way to simulate a MMB and a RMB click with a keyboard key while clicking the LMB.
 
>_< What I'm trying to achieve (US layout):
When ["WIN" + LMB]       is down, Send [MMB] click down.
When ["WIN" + "" + LMB] is down, Send [RMB] click down.
When ["CTRL" + "WIN"]    is down, Send ["WIN"] click down.
(And of course, blocking the character input if possible, while down)
 
Pretty sure I'm doing the wrong way but here is my code so far...
(Witch, of course, doesn't work.)
 
#include <Misc.au3>
#include <MsgBoxConstants.au3>

Local $hDLL = DllOpen("user32.dll")

While 1
    ; WIN + LMB simulate MMB (5B = WIN key)
    If _IsPressed("5B", $hDLL) And _IsPressed("01", $hDLL) Then
        ConsoleWrite("_IsPressed - Z + LMB" & @CRLF) ; test

        ; Keys and Click DOWN...
        While _IsPressed("5B", $hDLL) And _IsPressed("01", $hDLL)
            ; Disable default windows key function ???

            ; Simulate..
            MouseDown("middle")
            ConsoleWrite("MMB down" & @CRLF) ; test
        WEnd
        ; Keys and Click UP...
        MouseUp("middle")
        ConsoleWrite("MMB up" & @CRLF) ; test

    ; Exit the script
    ElseIf _IsPressed("1B", $hDLL) Then
        ExitLoop
    EndIf
    Sleep(50)
WEnd

DllClose($hDLL)

Thx in advanced for your ideas and advices. :sweating:

 
Best
William Popfish
Link to comment
Share on other sites

you need a foot mouse.

This would completely solve your issue and keep your keyboard setup intact.

https://www.google.com/search?num=100&client=firefox-a&hs=Me5&rls=org.mozilla%3Aen-US%3Aofficial&channel=sb&q=foot+mouse&oq=foot+mouse&gs_l=serp.3..0l4j0i10j0l5.16293.18062.0.18220.10.10.0.0.0.0.210.1138.0j6j1.7.0....0...1c.1.51.serp..3.7.1131.az1QZGSuqhg

with some simple ingenuity I bet you could rig a regular mouse to be on the floor (you have two mice hooked to your PC) and the one on the floor could only have the 3rd button click-able. You simply physically disable the other two buttons and disable the tracking on it.

Edited by MBALZESHARI
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...