EventMonitor.LastMousePositionX
-------------------------------

Queries last mouse position.

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

MBS( "EventMonitor.LastMousePositionX"; PerWindow ) 

**MBS**( **"EventMonitor.LastMousePositionX";** /\* Queries last mouse position. \*/  
**$PerWindow**) /\* Pass 1 to get coordinates relative to the window at mouse position (Mac) or front window (Win).  
Or pass 0 to get screen coordinates. (default)e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PerWindow | Pass 1 to get coordinates relative to the window at mouse position (Mac) or front window (Win).   Or pass 0 to get screen coordinates. (default) | 1 |

### Result

Returns value or error.

### Description

Queries last mouse position.  
Relative to top/left of main screen.  
  
Please call [EventMonitor.Install](EventMonitorInstall.md) earlier in your scripts once on startup of solution.  
See also [RemoteControl.MouseX](RemoteControlMouseX.md).  
### See also

- [EventMonitor.Install](EventMonitorInstall.md)
- [EventMonitor.LastMouseClickButton](EventMonitorLastMouseClickButton.md)
- [EventMonitor.LastMousePositionY](EventMonitorLastMousePositionY.md)
- [RemoteControl.MouseX](RemoteControlMouseX.md)

### Release notes

- **Version 8.2**
    - Fixed [EventMonitor.LastMousePositionX](http://www.mbsplugins.eu/EventMonitorLastMousePositionX.shtml) and [EventMonitor.LastMousePositionY](http://www.mbsplugins.eu/EventMonitorLastMousePositionY.shtml) for Windows.
- **Version 7.3**
    - Added [EventMonitor.LastMousePositionY](http://www.mbsplugins.eu/EventMonitorLastMousePositionY.shtml) and [EventMonitor.LastMousePositionX](http://www.mbsplugins.eu/EventMonitorLastMousePositionX.shtml) functions.

### Blog Entries

- [MBS FileMaker Plugin, version 8.2pr2](https://www.mbsplugins.de/archive/2018-04-11/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 7.3pr3](https://www.mbsplugins.de/archive/2017-06-21/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 19th June 2017 , last changed 5th June 2020

  
[EventMonitor.LastMouseClickIsDoubleClick](EventMonitorLastMouseClickIsDoubleClick.md) - [EventMonitor.LastMousePositionY](EventMonitorLastMousePositionY.md)

[HTML Version](EventMonitorLastMousePositionX.shtml)