ngneat / hotkeys

🤖 A declarative library for handling hotkeys in Angular applications
https://netbasal.com/diy-keyboard-shortcuts-in-your-angular-application-4704734547a2
MIT License
328 stars 16 forks source link

Example code? #81

Open andreaslarssen opened 1 year ago

andreaslarssen commented 1 year ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request
[x] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

I followed the readme, and can't get this thing to work.

What I did:

  1. Installed the package

  2. Imported it in app.module

  3. Used the directive like so:

    <input hotkeys="meta.a" (hotkey)="handleHotkey($event)" />
  4. TS file:

    handleHotkey(event: any) {
    console.log(event);
    }
  5. Nothing

Am I misunderstanding something? Also, I'm not that familiar with the hotkey annotation, it would be good with a section in the docs explaining the different combinations. What's the difference (if any) between meta.a and meta+a?

Expected behavior

An event

Minimal reproduction of the problem with instructions

See above.

What is the motivation / use case for changing the behavior?

Environment


Angular version: ^16.1.0


Browser:
- [x] Chrome (desktop) version 115.0.5790.173
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

For Tooling issues:
- Node version: v16.17.1  
- Platform:  Widows 

Others:

sysmat commented 3 weeks ago

wtf is meta?