@tobq/boardclip 2.1.115 → 2.1.116
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/macos-hotkey.js +4 -9
- package/main.js +3 -2
- package/package.json +1 -1
package/lib/macos-hotkey.js
CHANGED
|
@@ -218,18 +218,13 @@ function install({ shortcut, onPressed: handler }) {
|
|
|
218
218
|
return registerParsedHotKey({ parsed, id: 1, namespace: DEFAULT_NAMESPACE, handler });
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
parts[parts.length - 1] = String(slot);
|
|
225
|
-
return parts.join('+');
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
function installQuickPaste({ shortcut, onSlot }) {
|
|
221
|
+
// shortcuts[n - 1] = slot n's chord (main's quickPasteShortcutForSlot, the
|
|
222
|
+
// one slot rule: a numpad digit stays a numpad digit).
|
|
223
|
+
function installQuickPaste({ shortcuts, onSlot }) {
|
|
229
224
|
if (process.platform !== 'darwin') return { ok: false, error: 'macOS hotkeys are only available on macOS.' };
|
|
230
225
|
clearQuickPasteShortcuts();
|
|
231
226
|
for (let slot = 1; slot <= 9; slot++) {
|
|
232
|
-
const slotShortcut =
|
|
227
|
+
const slotShortcut = shortcuts[slot - 1] || '';
|
|
233
228
|
const parsed = parseShortcut(slotShortcut);
|
|
234
229
|
if (!parsed) {
|
|
235
230
|
clearQuickPasteShortcuts();
|
package/main.js
CHANGED
|
@@ -8127,8 +8127,9 @@ function registerShortcuts() {
|
|
|
8127
8127
|
if (quickPasteKey) {
|
|
8128
8128
|
if (process.platform === 'darwin') {
|
|
8129
8129
|
const hook = getMacosHotkey();
|
|
8130
|
+
const slotKeys = Array.from({ length: 9 }, (_, i) => quickPasteShortcutForSlot(quickPasteKey, i + 1));
|
|
8130
8131
|
const result = hook.installQuickPaste({
|
|
8131
|
-
|
|
8132
|
+
shortcuts: slotKeys,
|
|
8132
8133
|
onSlot: slot => {
|
|
8133
8134
|
handleQuickPaste(slot).catch(error => {
|
|
8134
8135
|
diagnostics.record('shortcut.quick_paste_error', { slot, error: error && error.message }, { forceFile: true });
|
|
@@ -8139,7 +8140,7 @@ function registerShortcuts() {
|
|
|
8139
8140
|
for (let n = 1; n <= 9; n++) {
|
|
8140
8141
|
quickPasteRegistrations.push({
|
|
8141
8142
|
slot: n,
|
|
8142
|
-
key:
|
|
8143
|
+
key: slotKeys[n - 1],
|
|
8143
8144
|
registered: quickPasteRegistered,
|
|
8144
8145
|
backend: 'carbon',
|
|
8145
8146
|
});
|
package/package.json
CHANGED