WoW API: GetMouseFocus

From AddOn Studio
Revision as of 04:46, 15 August 2023 by Move page script (talk) (Move page script moved page API GetMouseFocus to API GetMouseFocus without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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