WoW:API GetMouseFocus: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Move page script moved page API GetMouseFocus to API GetMouseFocus without leaving a redirect) |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{wowapi}}__NOTOC__ | |||
Returns the frame that is currently receiving mouse events. The frame must have enableMouse="true" | |||
frameID = GetMouseFocus(); | frameID = GetMouseFocus(); | ||
== Parameters == | |||
=== Arguments === | |||
:none | :none | ||
=== Results === | |||
:;frameID : Table - The frame that currently has the mouse focus. ''*NOTE: This can momentarily return nil if GetMouseFocus() is called when selecting "Inspect" on another player. This is likely an API bug in 4.1+. '' | |||
:;frameID : Table - The frame that currently has the mouse focus. | |||
== Example == | |||
You can get the name of the mouse-enabled frame beneath the pointer with this: | You can get the name of the mouse-enabled frame beneath the pointer with this: | ||
| Line 22: | Line 19: | ||
message( "The mouse is over " .. GetMouseFocus():GetName() ); | message( "The mouse is over " .. GetMouseFocus():GetName() ); | ||
=== Result === | |||
The mouse is over WorldFrame | The mouse is over WorldFrame | ||
Latest revision as of 04:46, 15 August 2023
← WoW API < GetMouseFocus
Returns the frame that is currently receiving mouse events. The frame must have enableMouse="true"
frameID = GetMouseFocus();
Parameters
Arguments
- none
Results
- frameID
- Table - The frame that currently has the mouse focus. *NOTE: This can momentarily return nil if GetMouseFocus() is called when selecting "Inspect" on another player. This is likely an API bug in 4.1+.
Example
You can get the name of the mouse-enabled frame beneath the pointer with this:
message( "The mouse is over " .. GetMouseFocus():GetName() );
Result
The mouse is over WorldFrame