According to the docs, I should be able to handle key events like keypress in the same way I can handle the click event, but I feel like I’m missing something.
I’ve done the following:
> meteor create keypressTest
> cd keypressTest
> sed -e 's/click input/keypress body/' -i .bak keypressTest.js
> meteor
But when I press keys, nothing shows up in the console like it does when handling the click event.
Are there any examples of working key handling in meteor? I know I can do a workaround in jquery, but would prefer to stick to the clean template events if I can.
I was missing these two requirements for using key events in the eventmap:
The second point seems consistent with clicking, since a
click *only fires when clicking on the button, not on the greeting text also contained within the template.