 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
NT Guest
|
Posted: Sun Jul 31, 2005 8:54 pm Post subject: Switching Mouse buttons? |
|
|
Hello,
How do I create a script that switches mouse buttons (specifically, right and middle mouse buttons)?
I've tried two methods listed below without success. Any help would be appreciated--Thanks!
NT
Method 1:
*MButton::Send, {RButton}
*RButton::Send, {MButton}
return
Method 2:
#InstallMouseHook
GetKeyState, RButtonState, RButton
if RButtonState = D ; This check prevents the keyboard auto-repeat feature from auto-repeating the mouse button.
MouseClick, middle, , , 1, 0, D ; hold down middle mouse button.
return
GetKeyState, MButtonState, MButton
if MButtonState = D
MouseClick, Right, , , 1, 0, D
return |
|
| Back to top |
|
 |
Doo Dee
Joined: 23 Jul 2005 Posts: 14
|
Posted: Sun Jul 31, 2005 9:18 pm Post subject: |
|
|
This worked for me.
| Code: | MButton::Send, {RButton}
RButton::Send, {MButton} |
|
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Mon Aug 01, 2005 4:25 pm Post subject: |
|
|
To remap mouse buttons to each other while still retaining the ability to drag with the button, try the following. These examples use MouseClick instead of "Send {RButton up}" because the latter would prevent you from using modifier keys with the clicks (such as Shift+RightClick).
*RButton::MouseClick, middle, , , 1, 0, D ; Hold down the button.
*RButton up::MouseClick, middle, , , 1, 0, U ; Release the button.
*MButton::MouseClick, right, , , 1, 0, D ; Hold down the button.
*MButton up::MouseClick, right, , , 1, 0, U ; Release the button. |
|
| Back to top |
|
 |
NT
Joined: 31 Jul 2005 Posts: 2 Location: Seattle, WA USA
|
Posted: Tue Aug 02, 2005 10:20 pm Post subject: Working... |
|
|
Hello,
Well, I'm trying to remap the rocker switch on my Wacom pen. The pen is programmed to be a right click on the lower switch, and middle mouse on the upper switch. Strangely, the script doesn't seem to work on the Wacom. That makes me think the Wacom isn't a true "mouse click," so I have to figure out how to capture the input in AHK. Any suggestions?
Thanks for the help!
---NT |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Wed Aug 03, 2005 12:10 am Post subject: |
|
|
| You might try using the steps at the bottom of the key list page (section "Special Keys") to see if your pen's mouse clicks are detectible by the program. Ensure that the script you use for testing has the mouse hook installed (which can be forced via #InstallMouseHook). |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|