1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-11 17:53:59 +02:00

update hotkeys util to use isHotkey (#5462)

This commit is contained in:
Ben Wormald
2023-06-30 08:04:48 +01:00
committed by GitHub
parent 711c2298dd
commit a6b606d804
2 changed files with 9 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
import { isKeyHotkey } from 'is-hotkey'
import { isHotkey } from 'is-hotkey'
import { IS_APPLE } from './environment'
/**
@@ -53,9 +53,9 @@ const create = (key: string) => {
const generic = HOTKEYS[key]
const apple = APPLE_HOTKEYS[key]
const windows = WINDOWS_HOTKEYS[key]
const isGeneric = generic && isKeyHotkey(generic)
const isApple = apple && isKeyHotkey(apple)
const isWindows = windows && isKeyHotkey(windows)
const isGeneric = generic && isHotkey(generic)
const isApple = apple && isHotkey(apple)
const isWindows = windows && isHotkey(windows)
return (event: KeyboardEvent) => {
if (isGeneric && isGeneric(event)) return true