getCursorPosition()

Returns the current position of the mouse cursor in a panel or screen.

Synopsis

int getCursorPosition(int &x, int &y, [bool globalPos = FALSE]);

Parameters

Parameter Description
x The X coordinate of the mouse cursor position. (Return value).
y The Y coordinate of the mouse cursor position. (Return value).
globalPos If this parameter has been set to TRUE, the function returns the current mouse coordinates in the screen.

Return value

-

Description

Returns the current position of the mouse cursor in a panel or screen.

Example

The following example returns the current cursor position in the panel.

main(int x, int y)
{
  int x,y;
  getCursorPosition(x,y);
  DebugN("Current cursor position on the panel, X: ",x,"and Y:
  ",y);
}

Assignment

Miscellaneous functions

Availability

UI