jaywcjlove / hotkeys-js

➷ A robust Javascript library for capturing keyboard input. It has no dependencies.
https://jaywcjlove.github.io/hotkeys-js
MIT License
6.57k stars 405 forks source link

Package description: it's an input library... but input from what? #480

Open hi2u opened 4 months ago

hi2u commented 4 months ago

Before installing, I spent quite a while looking through this package description on npm, github... searching through issues etc... trying to figure out if this package can be used to monitor global hotkeys at the OS level for nodejs apps (i.e. unrelated to browsers entirely).

But couldn't see this clearly described anywhere...

A robust Javascript library for capturing keyboard input.

HotKeys.js is an input capture library

...from what?

I see some supported browsers noted in the README.md, but nothing to indicate if it's only for just inside web browsers?

There's other places input can be monitored too: i.e.

I ended up asking chatgpt, and it said:

The npm package "hotkeys-js" primarily focuses on managing keyboard shortcuts within web applications

Still not clear. So eventually I decided to just install it and tried running in my nodejs console app....

ReferenceError: document is not defined

So I guess I eventually got my answer, after about 30 minutes of confusion. Although I'm still not even completely sure now.

If non-browser input isn't supported, no problem. I'm not asking for it to be added.

In this case, I'm just requesting: could you please update the package description to make it clear what the package is actually for, i.e. if it's just keyboard activity inside web browsers, maybe change the descriptions to something like:

A robust Javascript library for capturing keyboard input in web browsers.

HotKeys.js is a web browser input capture library

Or if some of these other contexts are actually supported, mention them too.

Some yes/no bullet points at the top of the README.md would be useful to clarify quickly too.

hi2u commented 4 months ago

Another thing I couldn't find any info about was the "windows key". Doesn't seem to be mentioned anywhere I could find.

From the demo page it appears that the term used is "command key"... but would save time if the term "windows key" was also mentioned here at least once in the README.md to let us know they're synonyms in this case.