onScreensChange([callback], remove)
Class: SwingUI.
Description:
Registers, unregisters and retrieves event handler for event emitted by changes to screens on the computer, such as connecting a screen, disconnecting a screen, or changes to screen resolution.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
|
|
function |
Function to handle the event, |
|
|
|
boolean |
false |
Removed the callback from this event |
Returns:
If called without parameters, an array of registered callbacks is returned; otherwise this instance of SwingUI class is returned.
Type: SwingUI | Array.<function()>
Examples:
Registering screens change event handler:
ui.onScreensChange(e => {console.log(e.screens});
