Open grokys opened 6 months ago
I suspect that "undo actions" in dispatch actions for a string
may be a vestige from an older version of the spec for two reasons:
@grokys Hello. I'm struggling with the same task as you trying to implement actions handling according to the spec, and I think the spec has a bigger flaw, that confused you and me regarding the input cancel list
, and considering you spent your time scrutinizing the spec I'll be grateful for your feedback on my thoughts.
Any key down action
(not only modifiers) dispatched with dispatch tick actions adds a key up action
to input cancel list
, which is global for all input state
, not a particular input source
. However, the only method to remove actions from this list is release actions. I beleive, dispatching a key up action
should remove corresponding actions from input cancel list
, otherwise we end up with a lot of duplicated key up actions
on release actions
. Same goes for pointer up actions
.
Looking at the description of a dispatch actions for a string, we can see that undo actions
hold only modifier keys state for a temporary key input source
, created in element send keys
, and these modifiers are cleared at the end of element send keys
, so I do not agree with you that input cancel list
may be used to clear modifiers state.
Adding to a confusion here: we have a global key state, which combines the state of possibly multiple key input sources, but it's not used during key events processing. Let's assume that we called perform actions
with shift
key down event. After the processing the input state
contains one key input source
with shift
property set to true
. Shouldn't this shift
property be taken into account somehow if we call element send keys
next? No idea...
Found another inconsistency in spec: dispatch actions for a string
appends shift key down
actions for shifted characters
thus adding cancelling shift key up
to input cancel list
, although in this context the undo actions
map should be used, otherwise these actions are not executed in clear modifiers key state
.
Am trying to implement this specification and have run into the same issue - does anyone involved with the spec have any comment on this? Are the specs still being updated?
Element Send Keys
details the following steps:Dispatch actions for a string
then eventually dispatcheskeyDown
actions, which indispatch tick actions
says:Once that is done we arrive at step 14 in
Element Send Keys
:Remove an input source
. This says:But I can't find the place in the spec where the input cancel list should be cleared: the only reference to clearing the input cancel list is in
Release Actions
.