You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor "pressKeys" as one of many "user intents" (#76)
In conversation with assistive technology vendors, we have learned that
automating arbitrary key presses does not necessarily align with the
security model of all platforms. Separately, we anticipate introducing
means to simulate more specific types of user interaction (e.g. "move to
next heading"). Because these may themselves be implemented at the
vendor's discretion (and because we wish to allow for vendors to
experiment with the development of still more kinds of interaction), the
space for simulating interaction may be somewhat fragmented,
particularly in the initial deployments of this protocol. We have
decided to design a command which accommodates this variability so that
the presence/absence of interactions can be communicated consistently
(note the "unknown user intent" error) and so that additional
interactions can be introduced without the addition of entirely new
commands (or entirely new extension commands, as the case may be).
@@ -824,12 +828,53 @@ Issue: Do we need a "setting changed" event?
824
828
The Interaction Module {#module-interaction}
825
829
--------------------------------------------
826
830
831
+
The following <dfn>table of standard user intents</dfn> enumerates the user intents each implementation must support.
832
+
833
+
<table>
834
+
<caption>Standard user intents</caption>
835
+
<tr>
836
+
<th>Name
837
+
<th>Algorithm
838
+
<tr>
839
+
<td>"`pressKeys`"
840
+
<td>[=press keys=]
841
+
</table>
842
+
843
+
A [=remote end=] has a <dfn for="remote end">table of extension user intents</dfn>, which is a mapping of zero or more string names of user intents and algorithms for simulating the named intents. Extension user intents' names must contain a "`:`" (colon) character, denoting an implementation specific namespace.
844
+
845
+
<div algorithm>
846
+
847
+
Note: Each string in `KeyCombination` represents a "raw key" consisting of a
actions</a>. For example, `["\uE008", "a"]` means holding the left shift key
851
+
and pressing "a", and then releasing the left shift key. [[WEBDRIVER]]
852
+
853
+
Issue(34): This algorithm does not yet have a means for indicating a screen-reader specific modifier key (or keys).
854
+
855
+
Issue(51): This algorithm only supports one specific kind of press/release sequence, and it is not clear if that is sufficient to express all keyboard commands in all implementations.
856
+
857
+
To <dfn>press keys</dfn> given |command parameters|:
858
+
859
+
1. [=Try=] to [=check that keyboard interaction can be simulated=].
860
+
2. [=Try=] to [=check that one of the expected applications has focus=].
861
+
3. Let |keys| be the value of the <code>keys</code> field of |command
862
+
parameters|.
863
+
4. [=list/For each=] |key| of |keys|:
864
+
1. Run [=implementation-defined=] steps to simulate depressing |key|.
865
+
5. [=list/For each=] |key| of |keys| in reverse [=List=] order:
866
+
1. Run [=implementation-defined=] steps to simulate releasing |key|.
#### The interaction.pressKeys Command #### {#module-interaction-presskeys}
855
-
856
-
The <dfn>interaction.pressKeys</dfn> command simulates pressing a key combination on a keyboard.
899
+
#### The interaction.userIntent Command #### {#module-interaction-userintent}
857
900
858
-
Issue(34): This command does not yet have a means for indicating a screen-reader specific modifier key (or keys).
859
-
860
-
Issue(51): This algorithm only supports one specific kind of press/release sequence, and it is not clear if that is sufficient to express all keyboard commands in all implementations.
901
+
The <dfn>interaction.userIntent</dfn> command simulates pressing a key combination on a keyboard.
861
902
862
903
<dl>
863
904
<dt>[=Command Type=]
864
905
<dd>
865
906
866
907
<pre class="cddl remote-cddl">
867
-
InteractionPressKeysCommand = {
868
-
method: "interaction.pressKeys",
869
-
params: InteractionPressKeysParameters
908
+
InteractionUserIntentCommand = {
909
+
method: "interaction.userIntent",
910
+
params: InteractionUserIntentParameters
870
911
}
871
912
872
-
InteractionPressKeysParameters = {
913
+
InteractionUserIntentParameters = (
914
+
PressKeysIntentParameters /
915
+
ExtensionIntentParameters
916
+
)
917
+
918
+
PressKeysIntentParameters = {
919
+
"name" => "pressKeys",
873
920
"keys" => KeyCombination,
874
-
Extensible,
875
921
}
876
922
877
923
KeyCombination = [
878
924
1* text
879
925
]
926
+
927
+
ExtensionIntentParameters = {
928
+
"name" => text,
929
+
Extensible,
930
+
}
880
931
</pre>
881
932
882
933
<dt>Result Type
@@ -888,24 +939,21 @@ Issue(51): This algorithm only supports one specific kind of press/release seque
888
939
889
940
</dl>
890
941
891
-
Note: Each string in `KeyCombination` represents a "raw key" consisting of a
0 commit comments