wowpedia
Main Menu


Returns what the mouse cursor is holding.

infoType, ... = GetCursorInfo()

Returns

The first return value is a string indicating the nature of an object on the cursor; additional return values provide detail. The following return value combinations have been observed:

Details

Related Events CURSOR_UPDATE
CURSOR_CHANGED
Related API GetCursorPosition

Example

The following snippet, if you're holding an item, prints out the amount of that item in your bags.

local infoType, itemID, itemLink = GetCursorInfo()
if infoType == "item" then
 print("You have " .. GetItemCount(itemLink) .. "x" .. itemLink .. " in your bags.")
else
 print("You're not holding an item on your cursor.")
end