Compare commits
2 Commits
c187a8625f
...
ee49db6775
Author | SHA1 | Date | |
---|---|---|---|
|
ee49db6775 | ||
|
f9f0b42473 |
@ -111,13 +111,22 @@ function useKeyPress(
|
|||||||
) {
|
) {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const listener = (eventRaw: Event) => {
|
const listener = (eventRaw: Event) => {
|
||||||
console.log('eventRaw', eventRaw);
|
if (ctrlKey) {
|
||||||
console.log('callback', callback);
|
console.log(
|
||||||
console.log('key', key);
|
'eventRaw',
|
||||||
console.log('ctrlKey', ctrlKey);
|
eventRaw,
|
||||||
|
'callback',
|
||||||
|
callback,
|
||||||
|
'key',
|
||||||
|
key,
|
||||||
|
'ctrlKey',
|
||||||
|
ctrlKey
|
||||||
|
);
|
||||||
|
}
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
const event = eventRaw as any as KeyboardEvent;
|
const event = eventRaw as any as KeyboardEvent;
|
||||||
if (event.key === key && event.ctrlKey === ctrlKey) {
|
if (event.key === key && event.ctrlKey === ctrlKey) {
|
||||||
|
console.log(`calling event for ${key} ${ctrlKey}`);
|
||||||
callback(event);
|
callback(event);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user