Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

More comprehensive docs and examples #261

Open
ghost opened this issue Jun 15, 2021 · 1 comment
Open

More comprehensive docs and examples #261

ghost opened this issue Jun 15, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 15, 2021

I'm happy to write these docs but right now it isn't super clear how to set keylisteners for stuff like "period".

Ideally there would be exhaustive docs for every key code.

This module is great! Thank you!!!

@suterma
Copy link

suterma commented Oct 17, 2021

I can second this issue, I had a hard time figuring out how to handle the "." character (the period, as OP mentioned).

Here is how I ended up with, in the template:

    <GlobalEvents
        @keyup.prevent="handleKeyUp"
    />

and in the code (TypeScript):

    methods: {
        //....
        /** Generally handle all keyUp events, by checking for recognisable events 
         */
        handleKeyUp(event: KeyboardEvent) {
            //Is the dot?
            if (event.code === 'NumpadDecimal' || event.code === 'Period') {
                //.... do my stuff
            }
        },

I suggest adding this to the docs.
@shentao Would you do that, or should I submit a pull request?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant