-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(updater): Use escaped installer path to start the nsis updater (#…
…727) Port of v1 change: tauri-apps/tauri#7956 Committed via a GitHub action: https://github.com/tauri-apps/plugins-workspace/actions/runs/6877612128 Co-authored-by: amrbashir <amrbashir@users.noreply.github.com>
- Loading branch information
Showing
10 changed files
with
124 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
'use strict'; | ||
|
||
var primitives = require('@tauri-apps/api/primitives'); | ||
|
||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-License-Identifier: MIT | ||
/** | ||
* Register global shortcuts. | ||
* | ||
* @module | ||
*/ | ||
/** | ||
* Register a global shortcut. | ||
* @example | ||
* ```typescript | ||
* import { register } from '@tauri-apps/plugin-global-shortcut'; | ||
* await register('CommandOrControl+Shift+C', () => { | ||
* console.log('Shortcut triggered'); | ||
* }); | ||
* ``` | ||
* | ||
* @param shortcut Shortcut definition, modifiers and key separated by "+" e.g. CmdOrControl+Q | ||
* @param handler Shortcut handler callback - takes the triggered shortcut as argument | ||
* | ||
* @since 2.0.0 | ||
*/ | ||
async function register(shortcut, handler) { | ||
const h = new primitives.Channel(); | ||
h.onmessage = handler; | ||
return await primitives.invoke("plugin:globalShortcut|register", { | ||
shortcut, | ||
handler: h, | ||
}); | ||
} | ||
/** | ||
* Register a collection of global shortcuts. | ||
* @example | ||
* ```typescript | ||
* import { registerAll } from '@tauri-apps/plugin-global-shortcut'; | ||
* await registerAll(['CommandOrControl+Shift+C', 'Ctrl+Alt+F12'], (shortcut) => { | ||
* console.log(`Shortcut ${shortcut} triggered`); | ||
* }); | ||
* ``` | ||
* | ||
* @param shortcuts Array of shortcut definitions, modifiers and key separated by "+" e.g. CmdOrControl+Q | ||
* @param handler Shortcut handler callback - takes the triggered shortcut as argument | ||
* | ||
* @since 2.0.0 | ||
*/ | ||
async function registerAll(shortcuts, handler) { | ||
const h = new primitives.Channel(); | ||
h.onmessage = handler; | ||
return await primitives.invoke("plugin:globalShortcut|register_all", { | ||
shortcuts, | ||
handler: h, | ||
}); | ||
} | ||
/** | ||
* Determines whether the given shortcut is registered by this application or not. | ||
* | ||
* If the shortcut is registered by another application, it will still return `false`. | ||
* | ||
* @example | ||
* ```typescript | ||
* import { isRegistered } from '@tauri-apps/plugin-global-shortcut'; | ||
* const isRegistered = await isRegistered('CommandOrControl+P'); | ||
* ``` | ||
* | ||
* @param shortcut shortcut definition, modifiers and key separated by "+" e.g. CmdOrControl+Q | ||
* | ||
* @since 2.0.0 | ||
*/ | ||
async function isRegistered(shortcut) { | ||
return await primitives.invoke("plugin:globalShortcut|is_registered", { | ||
shortcut, | ||
}); | ||
} | ||
/** | ||
* Unregister a global shortcut. | ||
* @example | ||
* ```typescript | ||
* import { unregister } from '@tauri-apps/plugin-global-shortcut'; | ||
* await unregister('CmdOrControl+Space'); | ||
* ``` | ||
* | ||
* @param shortcut shortcut definition, modifiers and key separated by "+" e.g. CmdOrControl+Q | ||
* | ||
* @since 2.0.0 | ||
*/ | ||
async function unregister(shortcut) { | ||
return await primitives.invoke("plugin:globalShortcut|unregister", { | ||
shortcut, | ||
}); | ||
} | ||
/** | ||
* Unregisters all shortcuts registered by the application. | ||
* @example | ||
* ```typescript | ||
* import { unregisterAll } from '@tauri-apps/plugin-global-shortcut'; | ||
* await unregisterAll(); | ||
* ``` | ||
* | ||
* @since 2.0.0 | ||
*/ | ||
async function unregisterAll() { | ||
return await primitives.invoke("plugin:globalShortcut|unregister_all"); | ||
} | ||
|
||
exports.isRegistered = isRegistered; | ||
exports.register = register; | ||
exports.registerAll = registerAll; | ||
exports.unregister = unregister; | ||
exports.unregisterAll = unregisterAll; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.