Skip to content

Commit 4d63182

Browse files
docs(shortcuts): update hook documentation with correct modifier descriptions
1 parent cd653d8 commit 4d63182

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/common/shortcut/shortcut.hook.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ describe('useShortcut', () => {
157157
key: 'a',
158158
code: 'KeyA',
159159
altKey: true,
160-
ctrlKey: true, // No debería funcionar con otros modificadores
160+
ctrlKey: true,
161161
});
162162

163163
window.dispatchEvent(event);

src/common/shortcut/shortcut.hook.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ export interface ShortcutHookProps {
1010
}
1111

1212
/**
13-
* This hook is used to create a keyboard shortcut
14-
* it uses Ctrl + key for Windows and Cmd + key for Mac
15-
* to avoid conflicts with the browser shortcuts
13+
* * This hook is used to create keyboard shortcuts with different modifier types:
14+
* - system: Uses Ctrl (Windows/Linux) or Cmd (Mac) as modifier
15+
* - alt: Uses Alt key as modifier (same behavior in all platforms)
16+
* - none: No modifier required, direct key press
1617
* @param {String[]} targetKey The key that will trigger the shortcut
1718
* @param {Function} callback The function to be called when the shortcut is triggered
19+
* @param {ModifierType} modifierType The type of modifier to use ('system' | 'alt' | 'none')
1820
* @return {void}
1921
*/
2022

0 commit comments

Comments
 (0)