diff --git a/packages/text-annotator/src/SelectionHandler.ts b/packages/text-annotator/src/SelectionHandler.ts index 76ac8270..8c419c7a 100644 --- a/packages/text-annotator/src/SelectionHandler.ts +++ b/packages/text-annotator/src/SelectionHandler.ts @@ -10,6 +10,7 @@ import { debounce, splitAnnotatableRanges, rangeToSelector, + isMac, isWhitespaceOrEmpty, trimRangeToContainer, NOT_ANNOTATABLE_SELECTOR @@ -19,11 +20,11 @@ const CLICK_TIMEOUT = 300; const ARROW_KEYS = ['up', 'down', 'left', 'right']; -const SELECT_ALL = ['ctrl+a', '⌘+a']; +const SELECT_ALL = isMac ? '⌘+a' : 'ctrl+a'; const SELECTION_KEYS = [ ...ARROW_KEYS.map(key => `shift+${key}`), - ...SELECT_ALL + SELECT_ALL ]; export const SelectionHandler = ( @@ -271,7 +272,7 @@ export const SelectionHandler = ( lastDownEvent = cloneKeyboardEvent(evt); }); - hotkeys(SELECT_ALL.join(','), { keydown: true, keyup: false}, evt => { + hotkeys(SELECT_ALL, { keydown: true, keyup: false}, evt => { lastDownEvent = cloneKeyboardEvent(evt); onSelectAll(evt); }); diff --git a/packages/text-annotator/src/utils/index.ts b/packages/text-annotator/src/utils/index.ts index f1284390..fe84a63b 100644 --- a/packages/text-annotator/src/utils/index.ts +++ b/packages/text-annotator/src/utils/index.ts @@ -1,4 +1,5 @@ export * from './cancelSingleClickEvents'; +export * from './device'; export * from './programmaticallyFocusable'; export * from './debounce'; export * from './getAnnotatableFragment';