Jump to content
Sign in to follow this  
Servant

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

Recommended Posts

Servant

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
Servant

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
water

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 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Servant

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
water

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


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Servant

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
Servant

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  

  • Similar Content

    • WoodGrain
      By WoodGrain
      Hi guys,
       
      I've written a script that will move my mouse to a location on the screen whenever my remote access software becomes active, the problem I have is that as soon as the remote access software becomes active it appears to capture the mouse and keyboard so nothing happens when I use MouseMove().
       
      Is there any way around this?
       
      Thanks!
    • badcoder123
      By badcoder123
      Hey, all.  
      I've been looking for a way to change cursor colour but not the cursor itself. I've been looking for a couple hours now and can't find anything.  I also don't even know where to start, if anyone has any tips or examples please comment them.
      Thanks
    • nooneclose
      By nooneclose
      Hello again, I am in phase two of my help bot. I cannot figure out how to properly code Autoit to click on a webpage button using the I.E UDF. I want to click on the button that I have attached as an image. This button does not have a name but it has an ID. Here is the HTML code for this button that I found using chromes developer inspector.
      HTML Code: 
      <img role="button" tabindex="-1" id="toolactions_INSERT-tbb_image" src="nav_icon_insertkey.gif" alt="New Work Order CTRL+ALT+I" draggable="false"> Here is the code that I have so far:
      ;******************************************************************************* ; Opens IE and fill out a New Workorder ;******************************************************************************* ; Start IE at the ** Tracking Application in ****** $oIE = _IECreate("https:I_am_Bound_by_my_company_to_not_reveal_this_webpage") ; Wait for a browser page load to complete _IELoadWait($oIE) Sleep(6000) ; Store the field names where the important data will be sent Local $nWorkOrderB = _IEGetObjById($oIE, "toolactions_INSERT-tbb_image") _IEAction($nWorkOrderB, "click")  I want my program to click on the button that looks like a piece of paper with a blue # 
      (For those wondering, I am allowed to send images just not the URL.) 
      As always any help would be appreciated. 

    • MJ36
      By MJ36

      How to click this button ? 
      I Try 
       
      func test () $oCorrectObj = "" $tags = $oIE.document.GetElementsByTagName("button") For $tag in $tags $class_value = $tag.GetAttribute("type") If string($class_value) = "buttont" Then $oCorrectObj = $tag MsgBox(0, "Level: ", "Level found :)") Else MsgBox(16, "Failed", "Not found.") ExitLoop EndIf Next If IsObj ( $oCorrectObj ) Then _IEAction ($oCorrectObj, "click") EndIF  
      and
       
      func klik () Local $oFound = "" Local $oBtns = _IETagNameGetCollection($oIE, "span") For $oBtn In $oBtns If String($oBtn.classname) = "yt-uix-button-content" Then $oFound = $oBtn EndIf Next _IEAction ($oFound, "click") EndFunc  
      Please Help 
      Can you click it by name?
    • faustf
      By faustf
      i guys , like title anyone  have idea if is possible , and if yes if  have example to post ?  i find in forum and in google but  i dont know   how can start  to create  button with icon over toolbar near  clock or is  goog before language layout .
      sorry i not post any script but i dont know  where to start
      thankz
      at  all
×