EventMonitor.LastMouseClickButton
---------------------------------

Queries the index of the last pressed mouse button.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [EventMonitor](component_EventMonitor.md) | [5.2](newinversion52.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "EventMonitor.LastMouseClickButton" ) ### Parameters

none

### Result

Returns number or error.

### Description

Queries the index of the last pressed mouse button.  
Returns 1 for left, 2 for right and 3 for other. (other is Mac only currently)  
  
Please call [EventMonitor.Install](EventMonitorInstall.md) earlier in your scripts once on startup of solution.  
Call this function in a script triggered by a mouse click (e.g. on a button) to see if mouse event triggering the script was using right or left mouse button.  
  
See also [RemoteControl.MouseButtons](RemoteControlMouseButtons.md) function for live status of mouse.  
With v12.5 this function may also return 4 and 5 for mouse buttons.  
### See also

- [EventMonitor.Install](EventMonitorInstall.md)
- [EventMonitor.LastMousePositionX](EventMonitorLastMousePositionX.md)
- [EventMonitor.LastMousePositionY](EventMonitorLastMousePositionY.md)
- [Menu.PopUp](MenuPopUp.md)
- [RemoteControl.MouseButtons](RemoteControlMouseButtons.md)
- [RemoteControl.MouseX](RemoteControlMouseX.md)
- [RemoteControl.MouseY](RemoteControlMouseY.md)

### Example Databases

- [Window/EventMonitor DoubleClick](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Window/EventMonitor%20DoubleClick.shtml#4ScriptAnchor_)

### Blog Entries

- [New in version 11.5 of MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2021-11-30/New_in_version_115_of_MBS_File/monkeybreadsoftware_blog_filemaker)
- [EventMonitor](https://www.mbsplugins.de/archive/2015-06-22/EventMonitor/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 21st June 2015 , last changed 3th November 2022

  
[EventMonitor.Install](EventMonitorInstall.md) - [EventMonitor.LastMouseClickIsDoubleClick](EventMonitorLastMouseClickIsDoubleClick.md)

[HTML Version](EventMonitorLastMouseClickButton.shtml)