Sign in to follow this  
Followers 0
Servant

Could you please show me how to remap the mouse' buttons and scrolls?

7 posts in this topic

#1 ·  Posted (edited)

Could you please show me or refer me to the documents how to do these things:

  • Remap the {LEFT CLICK} to letter A.
  • Remap the {RIGHT CLICK} to letter B.
  • Remap the {MIDDLE CLICK} to letter C.
  • Remap every single {SCROLL UP} to number 1.
  • Remap every single {SCROLL DOWN} to number 2.

It looks like it's hard to remap the mouse' elements..    :sweating:

Edited by Servant

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I already have send "A" if the right mouse button _IsPressed("02") now how can I disable the right mouse button using AutoIt?

#include <Misc.au3>

Func bigA()
   Send("A")
EndFunc

While 1
   if _IsPressed("02") Then bigA() ; Right mouse button
   if _IsPressed("1B") Then Exit ; ESC key
   Sleep(100)
Wend
Edited by Servant

Share this post


Link to post
Share on other sites

Can you please tell us what you need this for? Just for educational reasons or do you want to solve a real problem?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Can you please tell us what you need this for? Just for educational reasons or do you want to solve a real problem?

Just forget about the mouse scroll.. For now, I just want to remap the right mouse button to the "A" key.

If I get this, I'll also get how to remap the left mouse button and the middle mouse button..

Share this post


Link to post
Share on other sites

Thanks for the reply, but it doesn't really answer my question ;)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Thanks for the reply, but it doesn't really answer my question ;)

Ah, I see.. I want to be an AutoIt scripter.. I already know how to create hotkeys and hotstrings, and how to remap keys.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I GET IT!!

#include <Misc.au3>
#include "MouseOnEvent.au3"

Func bigA()
   Send("A")
EndFunc

_MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT, "__Dummy", 0, 1)
_MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT, "__ADummy", 0, 1)

; Idle
While 1
   _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT, "bigA") ; Secondary mouse button down.
   if _IsPressed("1B") Then ExitLoop
   Sleep(10)
Wend

_MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT)
_MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT)

You just need to include the "MouseOnEvent.au3" at >MouseOnEvent UDF! - Example Scripts - AutoIt Forums.

 

But it's a little bit of slow when I try to repeatedly right clicking even though I remove the Sleep(10).

Edited by Servant

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

  • Similar Content

    • electrons
      By electrons
      hi  , hope  you all doing well 
       cant find any elements on the page ?  and the right click mouse dont work too?
      iam trying with more than method , i need help please!!
       

    • Tarakesh
      By Tarakesh
      I have a situation where the desktop is designed in java swings. The nodes JTree is not allowing me to do checkbox selection using "spacebar". I am able to navigate through the nodes using up, down arrow and a tab. When I reach to the desire node selection, mouse left click is not working due a flaw a JTree core. However since it is selected, if mouse cursor auto moved to the position of the selection and send a "click"  then it should be solved. Any ideas much appreciated. 
      the problem with having fixed coordinates are the main windows is divided to 2panels where right panel containing this JTree can be expanded or shrink-ed.

    • ct253704
      By ct253704
      Good morning,
      I am struggling to find a way to force a ControlClick on a particular hidden element within a Google Slides window. Using Au3Info doesn't work as the hidden text won't appear when attempting to gather the data. Using inspect element will show the class/title of the button, but using the class in the ControlClick function doesn't seem to do anything. Since this script is going to be running on multiple machines with different resolutions, MouseClick isn't a good option either. Can someone help me figure out how to click this full screen button?
      One more note - It says "Ctrl + Shift + F" for full screen, however sending that combo doesn't work - nor does actually using those keys on the keyboard. Possible conflict with AutoIT hotkeys? 
      Here's some sample code / screenshots to help:
      ControlClick($Title, "", "[CLASS:punch-viewer-icon punch-viewer-full-screen goog-inline-block]")  


    • myspacee
      By myspacee
      Hello,
      need help to remap '<' button and SHIFT+'<'
      I made a little editor that allows to my users to write using proprietary codes.
      In production we have 2 keys/symbols that i want to 'emulate'. So, when is press on my keyboard :
      < = « SHIFT+< = » Try to use help example _IsPressed :
       
      #include <Misc.au3> #include <MsgBoxConstants.au3> Local $hDLL = DllOpen("user32.dll") While 1 If _IsPressed("10", $hDLL) Then ConsoleWrite("_IsPressed - Shift Key was pressed." & @CRLF) ; Wait until key is released. While _IsPressed("10", $hDLL) Sleep(250) WEnd ConsoleWrite("_IsPressed - Shift Key was released." & @CRLF) ElseIf _IsPressed("1B", $hDLL) Then MsgBox($MB_SYSTEMMODAL, "_IsPressed", "Close the application.") ExitLoop EndIf Sleep(250) WEnd DllClose($hDLL) but how manage keys combination ?
      thank you for any help,
      m.
    • thoms
      By thoms
      Hello Forum,
      As said in the title, I'm searching a way to disable all tabstops in a GUI. My GUI includes 15 buttons and 3 edit controls.
      My questions:
      - is there a way to disable all tabstops at a time
      - is there a way to list all controls of a GUI and then disable tabstops one by one
      - or should I use the following line after each button creation:
      _WinAPI_SetWindowLong(GUICtrlGetHandle(-1), $GWL_STYLE, BitAND(_WinAPI_GetWindowLong(GUICtrlGetHandle(-1), $GWL_STYLE), BitNOT($WS_TABSTOP))) Thanks in advance for your valuable help!
      Thoms
      Edit: or maybe disable TAB key? I don't remember how to do!