mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-05 00:09:18 +00:00
ignore keyboard events with modifier
This commit is contained in:
@@ -6,7 +6,13 @@ export function useKeyPress(targetKey: string) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleKeyDown = (event: KeyboardEvent) => {
|
const handleKeyDown = (event: KeyboardEvent) => {
|
||||||
if (event.key === targetKey) {
|
if (
|
||||||
|
event.key === targetKey &&
|
||||||
|
!event.ctrlKey &&
|
||||||
|
!event.metaKey &&
|
||||||
|
!event.altKey &&
|
||||||
|
!event.altKey
|
||||||
|
) {
|
||||||
setIsKeyPressed(true);
|
setIsKeyPressed(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user