-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ffa53aa
commit 03c1fcc
Showing
8 changed files
with
121 additions
and
48 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
.idea/runConfigurations/build.xml → .idea/runConfigurations/Run.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
.idea/runConfigurations/start.xml → .idea/runConfigurations/Test.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {IShortCut} from '../services/ShortcutService'; | ||
import {useToolBox} from '../context/ToolBoxContext'; | ||
import {useEffect} from 'react'; | ||
|
||
export function useShortCut(shortcut: IShortCut) { | ||
const {shortcutService} = useToolBox(); | ||
|
||
useEffect(() => { | ||
const sym = shortcutService.registerShortcut(shortcut); | ||
return () => { | ||
shortcutService.removeShortcut(sym); | ||
}; | ||
}, []); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters