Sign in to follow this  
Followers 0
Skrip

Possible to switch mouse prime buttons?

4 posts in this topic

Is it possible to switch mouse primary buttons?


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites



Is it possible to switch mouse primary buttons?

I made this a while ago personally to find the Primary.
Func _MouseGetPrimary()
    Local $aDLLMButton = DllCall('User32.dll', 'int', 'SwapMouseButton', 'int', True)
    If IsArray($aDLLMButton) And $aDLLMButton[0] <> 0 Then Return 'Right'
    If IsArray($aDLLMButton) And $aDLLMButton[0] = 0 Then DllCall('User32.dll', 'int', 'SwapMouseButton', 'int', False)
    Return 'Left'
EndFunc   ;==>_MouseGetPrimaryoÝ÷ Ù*²êi¢Ç¢Ø^¢¼­+0¢é]Âäjëh×6_SwitchMousePrimary(_MouseGetPrimary())
Func _MouseGetPrimary()
    Local $aDLLMButton = DllCall('User32.dll', 'int', 'SwapMouseButton', 'int', True)
    If IsArray($aDLLMButton) And $aDLLMButton[0] <> 0 Then Return 0
    If IsArray($aDLLMButton) And $aDLLMButton[0] = 0 Then DllCall('User32.dll', 'int', 'SwapMouseButton', 'int', False)
    Return 1
EndFunc   ;==>_MouseGetPrimary

Func _SwitchMousePrimary($nPrimary)
    Return DllCall('User32.dll', 'int', 'SwapMouseButton', 'int', $nPrimary)
EndFunc

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Hi,

#cs
    mode = 1 for swapping
    mode = 0 for returning to normal mode
#ce

SwapMouseButton()
ToolTip("swapped!", 0, 0)
Sleep(5000)
SwapMouseButton(0)
ToolTip("Normal!", 0, 0)

Func SwapMouseButton($mode = 1)
    DllCall("user32.dll", "int", "SwapMouseButton", "int", $mode)
EndFunc   ;==>SwapMouseButton

Question is, whether you want to swap even if your script insn't active. This swapps for every app!

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
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
Sign in to follow this  
Followers 0