simen-keyboard-listener 1.1.16 → 1.1.18

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/dist/index.d.mts CHANGED
@@ -911,5 +911,28 @@ declare function getSelectedTextSmart(): string | null;
911
911
  * @param block true = block all system hotkeys, false = allow normal behavior
912
912
  */
913
913
  declare function setBlockSystemHotkeys(block: boolean): void;
914
+ /**
915
+ * Set the list of shortcut combinations that should block fn key (keyCode 179) events.
916
+ * This is used to prevent macOS emoji panel from appearing when using fn-based shortcuts.
917
+ *
918
+ * When enabled, the native event tap will return NULL for keyCode 179 events that match
919
+ * the blocked shortcuts, effectively preventing the emoji panel from opening.
920
+ *
921
+ * macOS only - no-op on other platforms.
922
+ *
923
+ * @param shortcuts Array of shortcut strings to block. Format: modifiers joined by "+",
924
+ * in order: ctrl, alt, shift, cmd, fn
925
+ *
926
+ * @example
927
+ * // Block single fn key press (prevents emoji panel)
928
+ * setBlockedShortcuts(['fn']);
929
+ *
930
+ * // Block fn and shift+fn combinations
931
+ * setBlockedShortcuts(['fn', 'shift+fn']);
932
+ *
933
+ * // Clear all blocked shortcuts (restore normal behavior)
934
+ * setBlockedShortcuts([]);
935
+ */
936
+ declare function setBlockedShortcuts(shortcuts: string[]): void;
914
937
 
915
- export { type IAgentContext$1 as IAgentContext, type IAgentContextOptions$1 as IAgentContextOptions, type IClipboardContent$1 as IClipboardContent, type IDesktopItem$1 as IDesktopItem, type IExecuteOptions$1 as IExecuteOptions, type IExecuteResult$1 as IExecuteResult, type IFileContent$1 as IFileContent, type IFileMetadata$1 as IFileMetadata, type IFinderContext, type IFinderItem, type IFinderSelection, type IFinderWindow, type IFinderWindowInfo, type IFinderWindowItem, type IFrontmostApp$1 as IFrontmostApp, type IGlobalKeyDownMap, type IGlobalKeyEvent, type IGlobalKeyListener, type IGlobalKeyState, type IGlobalKeyboardListener, type IPermissionLostListener, type IReadFileOptions$1 as IReadFileOptions, type IRecentFile$1 as IRecentFile, type IRunningApp$1 as IRunningApp, type ISelectedItem$1 as ISelectedItem, type ISystemContext$1 as ISystemContext, checkKeyboardPermission, createGlobalKeyboardListener, escapeForAppleScript, executeAndParse$1 as executeAndParse, executeAppleScript, executeAppleScriptLines, executeMultilineAndParse$1 as executeMultilineAndParse, getAgentContext$1 as getAgentContext, getClipboardContent$1 as getClipboardContent, getClipboardText$1 as getClipboardText, getContextJSON, getDesktopItems, getDesktopPath, getFileMetadata, getFilesMetadata, getFinderContext, getFinderCurrentFolder, getFinderSelection, getFinderWindows, getFocusedInputSelectedText, getFocusedInputValue, getFrontmostApp$1 as getFrontmostApp, getFrontmostFromRunning, getGlobalKeyboardListener, getRecentDocuments, getRecentFiles, getRunningApps, getSelectedTextSmart, getSystemContext$1 as getSystemContext, isAppRunning, isOsascriptAvailable, index as powershell, readFileContent, readMultipleFiles, setBlockSystemHotkeys };
938
+ export { type IAgentContext$1 as IAgentContext, type IAgentContextOptions$1 as IAgentContextOptions, type IClipboardContent$1 as IClipboardContent, type IDesktopItem$1 as IDesktopItem, type IExecuteOptions$1 as IExecuteOptions, type IExecuteResult$1 as IExecuteResult, type IFileContent$1 as IFileContent, type IFileMetadata$1 as IFileMetadata, type IFinderContext, type IFinderItem, type IFinderSelection, type IFinderWindow, type IFinderWindowInfo, type IFinderWindowItem, type IFrontmostApp$1 as IFrontmostApp, type IGlobalKeyDownMap, type IGlobalKeyEvent, type IGlobalKeyListener, type IGlobalKeyState, type IGlobalKeyboardListener, type IPermissionLostListener, type IReadFileOptions$1 as IReadFileOptions, type IRecentFile$1 as IRecentFile, type IRunningApp$1 as IRunningApp, type ISelectedItem$1 as ISelectedItem, type ISystemContext$1 as ISystemContext, checkKeyboardPermission, createGlobalKeyboardListener, escapeForAppleScript, executeAndParse$1 as executeAndParse, executeAppleScript, executeAppleScriptLines, executeMultilineAndParse$1 as executeMultilineAndParse, getAgentContext$1 as getAgentContext, getClipboardContent$1 as getClipboardContent, getClipboardText$1 as getClipboardText, getContextJSON, getDesktopItems, getDesktopPath, getFileMetadata, getFilesMetadata, getFinderContext, getFinderCurrentFolder, getFinderSelection, getFinderWindows, getFocusedInputSelectedText, getFocusedInputValue, getFrontmostApp$1 as getFrontmostApp, getFrontmostFromRunning, getGlobalKeyboardListener, getRecentDocuments, getRecentFiles, getRunningApps, getSelectedTextSmart, getSystemContext$1 as getSystemContext, isAppRunning, isOsascriptAvailable, index as powershell, readFileContent, readMultipleFiles, setBlockSystemHotkeys, setBlockedShortcuts };
package/dist/index.d.ts CHANGED
@@ -911,5 +911,28 @@ declare function getSelectedTextSmart(): string | null;
911
911
  * @param block true = block all system hotkeys, false = allow normal behavior
912
912
  */
913
913
  declare function setBlockSystemHotkeys(block: boolean): void;
914
+ /**
915
+ * Set the list of shortcut combinations that should block fn key (keyCode 179) events.
916
+ * This is used to prevent macOS emoji panel from appearing when using fn-based shortcuts.
917
+ *
918
+ * When enabled, the native event tap will return NULL for keyCode 179 events that match
919
+ * the blocked shortcuts, effectively preventing the emoji panel from opening.
920
+ *
921
+ * macOS only - no-op on other platforms.
922
+ *
923
+ * @param shortcuts Array of shortcut strings to block. Format: modifiers joined by "+",
924
+ * in order: ctrl, alt, shift, cmd, fn
925
+ *
926
+ * @example
927
+ * // Block single fn key press (prevents emoji panel)
928
+ * setBlockedShortcuts(['fn']);
929
+ *
930
+ * // Block fn and shift+fn combinations
931
+ * setBlockedShortcuts(['fn', 'shift+fn']);
932
+ *
933
+ * // Clear all blocked shortcuts (restore normal behavior)
934
+ * setBlockedShortcuts([]);
935
+ */
936
+ declare function setBlockedShortcuts(shortcuts: string[]): void;
914
937
 
915
- export { type IAgentContext$1 as IAgentContext, type IAgentContextOptions$1 as IAgentContextOptions, type IClipboardContent$1 as IClipboardContent, type IDesktopItem$1 as IDesktopItem, type IExecuteOptions$1 as IExecuteOptions, type IExecuteResult$1 as IExecuteResult, type IFileContent$1 as IFileContent, type IFileMetadata$1 as IFileMetadata, type IFinderContext, type IFinderItem, type IFinderSelection, type IFinderWindow, type IFinderWindowInfo, type IFinderWindowItem, type IFrontmostApp$1 as IFrontmostApp, type IGlobalKeyDownMap, type IGlobalKeyEvent, type IGlobalKeyListener, type IGlobalKeyState, type IGlobalKeyboardListener, type IPermissionLostListener, type IReadFileOptions$1 as IReadFileOptions, type IRecentFile$1 as IRecentFile, type IRunningApp$1 as IRunningApp, type ISelectedItem$1 as ISelectedItem, type ISystemContext$1 as ISystemContext, checkKeyboardPermission, createGlobalKeyboardListener, escapeForAppleScript, executeAndParse$1 as executeAndParse, executeAppleScript, executeAppleScriptLines, executeMultilineAndParse$1 as executeMultilineAndParse, getAgentContext$1 as getAgentContext, getClipboardContent$1 as getClipboardContent, getClipboardText$1 as getClipboardText, getContextJSON, getDesktopItems, getDesktopPath, getFileMetadata, getFilesMetadata, getFinderContext, getFinderCurrentFolder, getFinderSelection, getFinderWindows, getFocusedInputSelectedText, getFocusedInputValue, getFrontmostApp$1 as getFrontmostApp, getFrontmostFromRunning, getGlobalKeyboardListener, getRecentDocuments, getRecentFiles, getRunningApps, getSelectedTextSmart, getSystemContext$1 as getSystemContext, isAppRunning, isOsascriptAvailable, index as powershell, readFileContent, readMultipleFiles, setBlockSystemHotkeys };
938
+ export { type IAgentContext$1 as IAgentContext, type IAgentContextOptions$1 as IAgentContextOptions, type IClipboardContent$1 as IClipboardContent, type IDesktopItem$1 as IDesktopItem, type IExecuteOptions$1 as IExecuteOptions, type IExecuteResult$1 as IExecuteResult, type IFileContent$1 as IFileContent, type IFileMetadata$1 as IFileMetadata, type IFinderContext, type IFinderItem, type IFinderSelection, type IFinderWindow, type IFinderWindowInfo, type IFinderWindowItem, type IFrontmostApp$1 as IFrontmostApp, type IGlobalKeyDownMap, type IGlobalKeyEvent, type IGlobalKeyListener, type IGlobalKeyState, type IGlobalKeyboardListener, type IPermissionLostListener, type IReadFileOptions$1 as IReadFileOptions, type IRecentFile$1 as IRecentFile, type IRunningApp$1 as IRunningApp, type ISelectedItem$1 as ISelectedItem, type ISystemContext$1 as ISystemContext, checkKeyboardPermission, createGlobalKeyboardListener, escapeForAppleScript, executeAndParse$1 as executeAndParse, executeAppleScript, executeAppleScriptLines, executeMultilineAndParse$1 as executeMultilineAndParse, getAgentContext$1 as getAgentContext, getClipboardContent$1 as getClipboardContent, getClipboardText$1 as getClipboardText, getContextJSON, getDesktopItems, getDesktopPath, getFileMetadata, getFilesMetadata, getFinderContext, getFinderCurrentFolder, getFinderSelection, getFinderWindows, getFocusedInputSelectedText, getFocusedInputValue, getFrontmostApp$1 as getFrontmostApp, getFrontmostFromRunning, getGlobalKeyboardListener, getRecentDocuments, getRecentFiles, getRunningApps, getSelectedTextSmart, getSystemContext$1 as getSystemContext, isAppRunning, isOsascriptAvailable, index as powershell, readFileContent, readMultipleFiles, setBlockSystemHotkeys, setBlockedShortcuts };
package/dist/index.js CHANGED
@@ -64,7 +64,8 @@ __export(index_exports, {
64
64
  powershell: () => powershell_exports,
65
65
  readFileContent: () => readFileContent,
66
66
  readMultipleFiles: () => readMultipleFiles,
67
- setBlockSystemHotkeys: () => setBlockSystemHotkeys
67
+ setBlockSystemHotkeys: () => setBlockSystemHotkeys,
68
+ setBlockedShortcuts: () => setBlockedShortcuts
68
69
  });
69
70
  module.exports = __toCommonJS(index_exports);
70
71
  var path = __toESM(require("path"));
@@ -2546,6 +2547,16 @@ function setBlockSystemHotkeys(block) {
2546
2547
  } catch {
2547
2548
  }
2548
2549
  }
2550
+ function setBlockedShortcuts(shortcuts) {
2551
+ if (!IS_MACOS2) {
2552
+ return;
2553
+ }
2554
+ try {
2555
+ const addon = getNativeAddon();
2556
+ addon.setBlockedShortcuts?.(shortcuts);
2557
+ } catch {
2558
+ }
2559
+ }
2549
2560
  // Annotate the CommonJS export names for ESM import in node:
2550
2561
  0 && (module.exports = {
2551
2562
  checkKeyboardPermission,
@@ -2582,5 +2593,6 @@ function setBlockSystemHotkeys(block) {
2582
2593
  powershell,
2583
2594
  readFileContent,
2584
2595
  readMultipleFiles,
2585
- setBlockSystemHotkeys
2596
+ setBlockSystemHotkeys,
2597
+ setBlockedShortcuts
2586
2598
  });
package/dist/index.mjs CHANGED
@@ -2489,6 +2489,16 @@ function setBlockSystemHotkeys(block) {
2489
2489
  } catch {
2490
2490
  }
2491
2491
  }
2492
+ function setBlockedShortcuts(shortcuts) {
2493
+ if (!IS_MACOS2) {
2494
+ return;
2495
+ }
2496
+ try {
2497
+ const addon = getNativeAddon();
2498
+ addon.setBlockedShortcuts?.(shortcuts);
2499
+ } catch {
2500
+ }
2501
+ }
2492
2502
  export {
2493
2503
  checkKeyboardPermission,
2494
2504
  createGlobalKeyboardListener,
@@ -2524,5 +2534,6 @@ export {
2524
2534
  powershell_exports as powershell,
2525
2535
  readFileContent,
2526
2536
  readMultipleFiles,
2527
- setBlockSystemHotkeys
2537
+ setBlockSystemHotkeys,
2538
+ setBlockedShortcuts
2528
2539
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simen-keyboard-listener",
3
- "version": "1.1.16",
3
+ "version": "1.1.18",
4
4
  "description": "Native global keyboard listener for macOS and Windows",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -49,8 +49,8 @@
49
49
  "node-addon-api": "^8.0.0"
50
50
  },
51
51
  "optionalDependencies": {
52
- "@simen-keyboard-listener/darwin-arm64": "1.1.16",
53
- "@simen-keyboard-listener/win32-x64": "1.1.16"
52
+ "@simen-keyboard-listener/darwin-arm64": "1.1.18",
53
+ "@simen-keyboard-listener/win32-x64": "1.1.18"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/node": "^20.0.0",