Skip to content

Conversation

@jdpj518
Copy link

@jdpj518 jdpj518 commented Feb 21, 2025

Enhanced the code to use the new KeyboardEvent.key property to determine what key is pressed. Primary reason was to enable the Numeric Keypad + and - keys to work just like the main keyboard + and -. Maintained previous properties for backwards compatibility with older browsers.

dependabot bot and others added 3 commits September 3, 2024 19:45
Bumps [@blakeembrey/template](https://github.com/blakeembrey/js-template) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/blakeembrey/js-template/releases)
- [Commits](blakeembrey/js-template@v1.1.0...v1.2.0)

---
updated-dependencies:
- dependency-name: "@blakeembrey/template"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
…mbrey/template-1.2.0

build(deps-dev): bump @blakeembrey/template from 1.1.0 to 1.2.0
Enhanced the code to use the new KeyboardEvent.key property to determine what key is pressed.  Primary reason was to enable the Numeric Keypad + and - keys to work just like the main keyboard + and -.  Maintained previous properties for backwards compatibility with older browsers.
@jdpj518
Copy link
Author

jdpj518 commented Feb 21, 2025

Big fan of your library here! I've used it in an image viewing site for several years now. This week I added a custom button to the footer toolbar, and also updated the package to the latest version. While testing, I found that the + and - keys on the numeric keypad were not registering for the associated image action, so I updated that block of the JS and also made the KeyboardEvent.key property the default value, since keyCode is now depreciated. Using "key" also solved the issue of which "+" key was pressed.

This is the first time I've forked a public repo and raised a possible change, so please let me know if I screwed the process up at all. :-)

Thanks!

John

@nzbin
Copy link
Owner

nzbin commented Feb 22, 2025

Please don't modify the dist files, you should modify the src/js/core.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants