Skip to content
This repository has been archived by the owner on Sep 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #56 from Andrew67/bugfix/numpad-keys
Browse files Browse the repository at this point in the history
  • Loading branch information
phos committed Apr 4, 2021
2 parents 1dbeb9f + 15f9d26 commit 3233fed
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion web/components/Home/Resin/Subtractor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ const Subtractor = ({ current }: { current: number }) => {
};

const SubtractButton = ({ value, onClick }: { value: number; onClick: () => void }) => {
const hotkey = value.toString().slice(0, 1);
useHotkeys(
value.toString().slice(0, 1),
`${hotkey}, num_${hotkey}`, // support numpad keys for niche cases (e.g. Firefox on macOS)
(e) => {
onClick();
e.preventDefault();
Expand Down
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"prettier": "^2.2.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-hotkeys-hook": "^3.2.1",
"react-hotkeys-hook": "^3.3.0",
"react-icons": "^4.2.0",
"react-intersection-observer": "^8.31.0",
"react-leaflet": "^3.1.0",
Expand Down
18 changes: 9 additions & 9 deletions web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1742,10 +1742,10 @@ hoist-non-react-statics@^3.3.1:
dependencies:
react-is "^16.7.0"

hotkeys-js@3.8.2:
version "3.8.2"
resolved "https://registry.yarnpkg.com/hotkeys-js/-/hotkeys-js-3.8.2.tgz#177c3e7dc19279c881e69983177849bed76e4747"
integrity sha512-HZZ9RVNr3nBbs2nW968o4rp3xXSdPjJ4B7GTXE375WwboltDJMsP9mcHfAAv+igsTeVxetr10mEbnoac/1U+oQ==
hotkeys-js@3.8.3:
version "3.8.3"
resolved "https://registry.yarnpkg.com/hotkeys-js/-/hotkeys-js-3.8.3.tgz#0331c2cde770e62d51d5d023133f7c4395f59008"
integrity sha512-rUmoryG4lEAtkjF5tcYaihrVoE86Fdw1BLqO/UiBWOOF56h32a6ax8oV4urBlinVtNNtArLlBq8igGfZf2tQnw==

http-errors@1.7.3:
version "1.7.3"
Expand Down Expand Up @@ -2458,12 +2458,12 @@ react-focus-lock@2.5.0:
use-callback-ref "^1.2.1"
use-sidecar "^1.0.1"

react-hotkeys-hook@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/react-hotkeys-hook/-/react-hotkeys-hook-3.2.1.tgz#314760bad7b27c1cf5dedb4b8b15fb7eced3ae1f"
integrity sha512-l5Y4Dr109Fz10hHq40hkJmppXUqdv7tNVFldPq7lDsgWBpPLWCtkkSkrzTySje4GK+t5VLzPA01cCyUsZutOmQ==
react-hotkeys-hook@^3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/react-hotkeys-hook/-/react-hotkeys-hook-3.3.0.tgz#356428769fa990c333d4ee4998b866bbd45e54b8"
integrity sha512-DbxcZpswAcJKc0Fw5oTWeRImGLVerDlMU8ndIAH5Waed8wvpafk/F2i43BZo2O3Ftn/RzQsD4EFU8e8FSjVFTg==
dependencies:
hotkeys-js "3.8.2"
hotkeys-js "3.8.3"

react-icons@^4.2.0:
version "4.2.0"
Expand Down

0 comments on commit 3233fed

Please sign in to comment.