screen(屏幕)

[TOC] 取得屏幕大小、显示器、光标位置等的信息。

方法

getCursorScreenPoint()

当前鼠标的绝对位置 x, y。

  • 返回 Promise<point: Object>
  • point Object
    • point.x
    • point.y
let point = await eagle.screen.getCursorScreenPoint();

getPrimaryDisplay()

返回主屏幕信息

  • 返回 Promise<display: Display>
  • display Display 对象 - 当前屏幕信息
let display = await eagle.screen.getPrimaryDisplay();

getAllDisplays()

返回一个数组Display[],表示当前可用的屏幕。

  • 返回 Promise<displays: Display[]>
  • displays Display[]
let displays = await eagle.screen.getAllDisplays();

getDisplayNearestPoint(point)

取得插件窗口座标 x 和 y。

  • point Object
  • point.x Interger 类型
  • point.y Interger 类型
  • 返回 Promise<display: Display>
  • display Display 对象 - 当前屏幕信息
let display = await eagle.screen.getDisplayNearestPoint({ x: 100, y: 100 });