ToDesktop Docs
β Back to ToDesktop.com
Searchβ¦
Welcome
App Options
π
Launch at Startup (macOS, Windows only)
π
Defining Internal URLs
β
App Protocols and Deeplinks
Customizing your app
π
Add Custom CSS to your Desktop App
π©π»
Add Custom Javascript to your Desktop App
π±
Make a Transparent Titlebar Draggable (macOS only)
Javascript API
Introduction
βΉ
Info
π
Navigation
π¨
Printing
π·
App Icon Badging, Bouncing and Progress Bar
π
Menubar Window Events
β¨
Global Shortcuts
π§°
Tray
π
Push Notifications with Firebase Cloud Messaging
π
Find In Page
πΊ
Window
π
Application Menu
π
Context menu
Recipes
π
Send Native Notifications
π₯
Separate Desktop Logic from Web App Logic
π
Add Find In Page to your Desktop App
β
Add Browser Controls to your Desktop App
πΎ
Storing Data
β
Download Links for your Website
π
Enlarging Menubar Window
π²
Menubar Icon
π΄
Capture Screen Contents
πͺ
Building a Slack-like sidebar
π
Google OAuth Screen
Powered By
GitBook
β¨
Global Shortcuts
We allow you to register global keyboard shortcuts that work when your app doesn't have keyboard focus.
Accelerators
See
https://www.electronjs.org/docs/api/accelerator
for how to define accelerators
todesktop.shortcut.isRegistered(accelerator)
Promise<Boolean>
-
Whether your application has registered the accelerator (shortcut).
Note if another application has taken the accelerator this will still return
false
1
await
todesktop
.
shortcut
.
isRegistered
(
"Command+G"
)
Copied!
todesktop.shortcut.register(accelerator, callback)
Promise<Boolean> -
Whether the shortcut was registered successfully.
Registers the global shortcut of
accelerator
. The callback is called when the user presses the shortcut.
Note when the accelerator is already taken by other applications, this call will silently fail.
1
todesktop
.
shortcut
.
register
(
"Command+G"
,
()
=>
{
2
console
.
log
(
"The shortcut was pressed"
);
3
});
Copied!
todesktop.shortcut.unregister(accelerator)
Promise<Boolean>
- Whether the shortcut was successfully unregistered
Unregisters the global shortcut of
accelerator
.
1
todesktop
.
shortcut
.
unregister
(
"Command+G"
);
Copied!
todesktop.shortcut.unregisterAll()
Promise<Boolean>
- Whether all shortcuts were successfully removed
1
todesktop
.
shortcut
.
unregisterAll
();
Copied!
Javascript API - Previous
Menubar Window Events
Next - Javascript API
Tray
Last modified
8mo ago
Copy link
Contents
Accelerators
todesktop.shortcut.isRegistered(accelerator)
todesktop.shortcut.register(accelerator, callback)
todesktop.shortcut.unregister(accelerator)
todesktop.shortcut.unregisterAll()