p5.js-web-editor
p5.js-web-editor copied to clipboard
Move keydown handling out of IDEView
Progress on #1458 and #824
Should be merged after #2049 as I moved the Escape key handling into the new Modal component.
Changes:
- Create new utility hook
useKeyDownHandlersfor adding one or more keydown handlers to thedocument, and componentDocumentKeyDownwhich wraps the hook for use in class components. - Apply hook/component to
Nav,Overlay, andModal - Move the keydown handling from
IDEViewinto new hook/componentuseIDEKeyHandlers/IDEKeyHandlers, which accesses redux props directly and allows a few props to be removed fromIDEView. - Use the same keydown handling in
MobileIDEViewinstead of repeating it.
I have verified that this pull request:
- [x] has no linting errors (
npm run lint) - [x] has no test errors (
npm run test) - [x] is from a uniquely-named feature branch and is up to date with the
developbranch. - [x] is descriptively named and links to an issue number, i.e.
Fixes #123