GlobalShortcut

external interface GlobalShortcut(source)

Functions

Link copied to clipboard
abstract fun isRegistered(accelerator: String): Boolean

Whether this application has registered accelerator.

Link copied to clipboard
abstract fun isSuspended(): Boolean

Whether global shortcut handling is currently suspended.

Link copied to clipboard
abstract fun register(accelerator: String, callback: () -> Unit): Boolean

Whether or not the shortcut was registered successfully.

Link copied to clipboard
abstract fun registerAll(accelerators: ReadonlyArray<String>, callback: () -> Unit)

Registers a global shortcut of all accelerator items in accelerators. The callback is called when any of the registered shortcuts are pressed by the user.

Link copied to clipboard
abstract fun setSuspended(suspended: Boolean)

Suspends or resumes global shortcut handling. When suspended, all registered global shortcuts will stop listening for key presses. When resumed, all previously registered shortcuts will begin listening again. New shortcut registrations will fail while handling is suspended.

Link copied to clipboard
abstract fun unregister(accelerator: String)

Unregisters the global shortcut of accelerator.

Link copied to clipboard
abstract fun unregisterAll()

Unregisters all of the global shortcuts.