Re: Key actions and modifiers

On 18/05/16 19:41, Jason Juang wrote:
> For #3, in the case where the modifier key is already pressed:
>    [
>      {type: keyDown, value: shift},
>      {type: keyDown, value: "A"}
>    ]
> you would probably not generate additional events for the shift key, and
> the modifier would continue to be set for subsequent keys until shift is
> released.

Agreed.

> However, what about the opposite case?
>    [
>      {type: keyDown, value: shift},
>      {type: keyDown, value: "5"}
>    ]
> Should the shift key be implicitly released before the "5" and
> re-pressed after? Does this generate a keyPress for "%"?

Right, this is more or less the mirror problem.

So far I have been working from the idea that it is an invariant that 
the character you send should be the one that is "typed", and the 
modifiers have to be adjusted to fit. But of course there is another 
possible model in which the character identifies a physical key and the 
modifier settings determine which character is typed.

Received on Wednesday, 18 May 2016 20:58:13 UTC