@lynx-js/lynxtron / Screen
Screen
继承
方法
addListener()
event: "display-added"
addListener(event: "display-added", listener: (event: Event, newDisplay: Display) => void): this
参数
返回
this
定义于
apis/api/screen.d.ts:107
event: "display-metrics-changed"
addListener(event: "display-metrics-changed", listener: (event: Event, display: Display, changedMetrics: string[]) => void): this
参数
返回
this
定义于
apis/api/screen.d.ts:132
event: "display-removed"
addListener(event: "display-removed", listener: (event: Event, oldDisplay: Display) => void): this
参数
返回
this
定义于
apis/api/screen.d.ts:155
dipToScreenPoint() Windows linux
dipToScreenPoint(point: Point): Point
Converts a screen DIP point to a screen physical point. The DPI scale is
performed relative to the display containing the DIP point.
Not currently supported on Wayland.
参数
返回
Point
定义于
apis/api/screen.d.ts:171
dipToScreenRect() Windows
dipToScreenRect(window: null | BaseWindow, rect: Rectangle): Rectangle
Converts a screen DIP rect to a screen physical rect. The DPI scale is performed
relative to the display nearest to window. If window is null, scaling will
be performed to the display nearest to rect.
参数
返回
Rectangle
定义于
apis/api/screen.d.ts:179
getAllDisplays()
getAllDisplays(): Display[]
An array of displays that are currently available.
返回
Display[]
定义于
apis/api/screen.d.ts:183
getCursorScreenPoint()
getCursorScreenPoint(): Point
The current absolute position of the mouse pointer.
NOTE
The return value is a DIP point, not a screen physical point.
返回
Point
定义于
apis/api/screen.d.ts:189
getDisplayMatching()
getDisplayMatching(rect: Rectangle): Display
The display that most closely intersects the provided bounds.
参数
返回
Display
定义于
apis/api/screen.d.ts:193
getDisplayNearestPoint()
getDisplayNearestPoint(point: Point): Display
The display nearest the specified point.
参数
返回
Display
定义于
apis/api/screen.d.ts:197
getPrimaryDisplay()
getPrimaryDisplay(): Display
The primary display.
返回
Display
定义于
apis/api/screen.d.ts:201
off()
event: "display-added"
off(event: "display-added", listener: (event: Event, newDisplay: Display) => void): this
参数
返回
this
定义于
apis/api/screen.d.ts:99
event: "display-metrics-changed"
off(event: "display-metrics-changed", listener: (event: Event, display: Display, changedMetrics: string[]) => void): this
参数
返回
this
定义于
apis/api/screen.d.ts:124
event: "display-removed"
off(event: "display-removed", listener: (event: Event, oldDisplay: Display) => void): this
参数
返回
this
定义于
apis/api/screen.d.ts:147
on()
event: "display-added"
on(event: "display-added", listener: (event: Event, newDisplay: Display) => void): this
Emitted when newDisplay has been added.
参数
返回
this
定义于
apis/api/screen.d.ts:95
event: "display-metrics-changed"
on(event: "display-metrics-changed", listener: (event: Event, display: Display, changedMetrics: string[]) => void): this
Emitted when one or more metrics change in a display. The changedMetrics is
an array of strings that describe the changes. Possible changes are bounds,
workArea, scaleFactor and rotation.
参数
返回
this
定义于
apis/api/screen.d.ts:120
event: "display-removed"
on(event: "display-removed", listener: (event: Event, oldDisplay: Display) => void): this
Emitted when oldDisplay has been removed.
参数
返回
this
定义于
apis/api/screen.d.ts:143
once()
event: "display-added"
once(event: "display-added", listener: (event: Event, newDisplay: Display) => void): this
参数
返回
this
定义于
apis/api/screen.d.ts:103
event: "display-metrics-changed"
once(event: "display-metrics-changed", listener: (event: Event, display: Display, changedMetrics: string[]) => void): this
参数
返回
this
定义于
apis/api/screen.d.ts:128
event: "display-removed"
once(event: "display-removed", listener: (event: Event, oldDisplay: Display) => void): this
参数
返回
this
定义于
apis/api/screen.d.ts:151
removeListener()
event: "display-added"
removeListener(event: "display-added", listener: (event: Event, newDisplay: Display) => void): this
参数
返回
this
定义于
apis/api/screen.d.ts:111
event: "display-metrics-changed"
removeListener(event: "display-metrics-changed", listener: (event: Event, display: Display, changedMetrics: string[]) => void): this
参数
返回
this
定义于
apis/api/screen.d.ts:136
event: "display-removed"
removeListener(event: "display-removed", listener: (event: Event, oldDisplay: Display) => void): this
参数
返回
this
定义于
apis/api/screen.d.ts:159
screenToDipPoint() Windows linux
screenToDipPoint(point: Point): Point
Converts a screen physical point to a screen DIP point. The DPI scale is
performed relative to the display containing the physical point.
Not currently supported on Wayland - if used there it will return the point
passed in with no changes.
参数
返回
Point
定义于
apis/api/screen.d.ts:211
screenToDipRect() Windows
screenToDipRect(window: null | BaseWindow, rect: Rectangle): Rectangle
Converts a screen physical rect to a screen DIP rect. The DPI scale is performed
relative to the display nearest to window. If window is null, scaling will
be performed to the display nearest to rect.
参数
返回
Rectangle
定义于
apis/api/screen.d.ts:219