Vue: Should `config.keyCodes` support multiple keys for a single modifier?

Created on 3 Nov 2016  ·  3Comments  ·  Source: vuejs/vue

Vue.js version

2.0.3

Reproduction Link


https://jsfiddle.net/crswll/5yynzyj3/

Steps to reproduce

Focus the input and try using W, A, S or D to trigger key up instead of UP, RIGHT, DOWN and LEFT.

What is Expected?

I expected to be able to hit W or UP to trigger up2, A or LEFT to trigger left2, S or DOWN to trigger down2, D or RIGHT to trigger right2.

What is actually happening?

Nothing. I thought it would work because of this line from the source but it doesn't...

https://github.com/vuejs/vue/blob/b51b9eae4d427d0a909aff8c5f08575c450711a1/src/compiler/codegen/events.js#L15

Also, kind of a side note:

Can we overwrite the default keyCodes? I'd rather name my custom alias up instead of up2.

improvement

Most helpful comment

The current public API doesn't support Array yet, but this could be useful.

All 3 comments

The current public API doesn't support Array yet, but this could be useful.

I agree! I'm doing an app for a set top box and the remote's keyCodes don't always line up with my computer.

Closed via #4328

Was this page helpful?
0 / 5 - 0 ratings