DesktopMouseX()

语法

Result = DesktopMouseX()
概要
Returns the absolute x position of the mouse on the desktop.

参数

无.

返回值

Returns the x coordinate (in pixel) of the mouse relative to the top left corner of the primary monitor. The coordinate is negative if the mouse is on a monitor to the left of the primary monitor.

示例

  If OpenWindow(0, 0, 0, 300, 30, "Desktop mouse monitor", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    TextGadget(0, 10, 6, 200, 20, "")

    Repeat
      Event = WindowEvent()

      If Event = 0 ; No events are in queue anymore, so halt the process for a few milliseconds for multitasking
        SetGadgetText(0, "Desktop mouse position: "+Str(DesktopMouseX())+","+Str(DesktopMouseY()))
        Delay(20)
      EndIf

    Until Event = #PB_Event_CloseWindow
  EndIf

参阅

DesktopMouseY(), DesktopX(), DesktopWidth(), WindowMouseX()

已支持操作系统

所有

<- DesktopHeight() - Desktop Index - DesktopMouseY() ->