Skip to content

Commit 3e15ec4

Browse files
authored
Add a non-normative example for each Command (#93)
* Add a non-normative example for each Command * Extend example for "pressKeys" Based on implementer feedback, demonstrate the behavior of modifier keys. * Add styling for the "kbd" HTML element
1 parent 2815f8b commit 3e15ec4

File tree

1 file changed

+185
-0
lines changed

1 file changed

+185
-0
lines changed

index.bs

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ table thead, table tbody { border-bottom: solid; }
3636
table tbody th { text-align: left; }
3737
table tbody th:first-child { border-left: solid; }
3838
table td, table th { border-left: solid; border-right: solid; border-bottom: solid thin; vertical-align: top; padding: 0.2em; }
39+
40+
kbd:not(:has(kbd)) {
41+
border-radius: 0.2em;
42+
padding: 0.2em;
43+
border: 1px solid rgba(0, 0, 0, 0.4);
44+
background-color: rgba(0, 0, 0, 0.05);
45+
}
3946
</style>
4047

4148
Introduction {#intro}
@@ -600,6 +607,43 @@ The [=remote end steps=] given |session| and |command parameters| are:
600607

601608
</div>
602609

610+
<div class="example">
611+
A [=local end=] that wishes to create a new [=Session=] which is furnished with
612+
an assistive technology named `NVDA` might send a Command such as:
613+
614+
```json
615+
{
616+
"id": 24601,
617+
"method": "session.new",
618+
"params": {
619+
"capabilities": {
620+
"alwaysMatch": {
621+
"atName": "NVDA",
622+
"user-defined property": "user-defined value"
623+
}
624+
}
625+
}
626+
}
627+
```
628+
629+
And the [=remote end=] which receives that Command could respond with the
630+
following Message:
631+
632+
```json
633+
{
634+
"id": 24601,
635+
"result": {
636+
"sessionId": "4f974515-cac5-4e45-9604-95d918116e83",
637+
"capabilities": {
638+
"atName": "NVDA",
639+
"atVersion": "2025.1",
640+
"platformName": "Windows"
641+
}
642+
}
643+
}
644+
```
645+
</div>
646+
603647
The settings Module {#module-settings}
604648
--------------------------------------
605649

@@ -744,6 +788,40 @@ The [=remote end steps=] given <var ignore>session</var> and |command parameters
744788

745789
</div>
746790

791+
<div class="example">
792+
A [=local end=] that wishes to modify the value of settings named
793+
`readEntirePage` and `speed` might send a Command such as:
794+
795+
```json
796+
{
797+
"id": 1776,
798+
"method": "settings.setSettings",
799+
"params": {
800+
"settings": [
801+
{
802+
"name": "readEntirePage",
803+
"value": false
804+
},
805+
{
806+
"name": "speed",
807+
"value": 0.8
808+
}
809+
]
810+
}
811+
}
812+
```
813+
814+
And the [=remote end=] which receives that Command could respond with the
815+
following Message:
816+
817+
```json
818+
{
819+
"id": 1776,
820+
"result": {}
821+
}
822+
```
823+
</div>
824+
747825
#### The settings.getSettings Command #### {#command-settings-get-settings}
748826

749827
The <dfn>settings.getSettings command</dfn> returns a list of the requested settings and their values.
@@ -784,6 +862,50 @@ The <a>remote end steps</a> given <var ignore>session</var> and |command paramet
784862

785863
</div>
786864

865+
<div class="example">
866+
A [=local end=] that wishes to retrieve the value of settings named
867+
`virtualBuffers.passThroughAudioIndication` and `cursor` might send a Command
868+
such as:
869+
870+
```json
871+
{
872+
"id": 8675309,
873+
"method": "settings.getSettings",
874+
"params": {
875+
"settings": [
876+
{
877+
"name": "virtualBuffers.passThroughAudioIndication"
878+
},
879+
{
880+
"name": "cursor"
881+
}
882+
]
883+
}
884+
}
885+
```
886+
887+
And the [=remote end=] which receives that Command could respond with the
888+
following Message:
889+
890+
```json
891+
{
892+
"id": 8675309,
893+
"result": {
894+
"settings": [
895+
{
896+
"name": "virtualBuffers.passThroughAudioIndication",
897+
"value": true
898+
},
899+
{
900+
"name": "cursor",
901+
"value": "VPC"
902+
}
903+
]
904+
}
905+
}
906+
```
907+
</div>
908+
787909
#### The settings.getSupportedSettings Command #### {#command-settings-get-supported-settings}
788910

789911
The <dfn>settings.getSupportedSettings command</dfn> returns a list of all settings that the [=remote end=] supports, and their values.
@@ -821,6 +943,40 @@ The <a>remote end steps</a> given <var ignore>session</var> and <var ignore>comm
821943

822944
</div>
823945

946+
<div class="example">
947+
A [=local end=] that wishes to discover the settings available on a given
948+
[=remote end=] might send a Command such as:
949+
950+
```json
951+
{
952+
"id": 781,
953+
"method": "settings.getSupportedSettings",
954+
"params": {}
955+
}
956+
```
957+
958+
And the [=remote end=] which receives that Command could respond with the
959+
following Message:
960+
961+
```json
962+
{
963+
"id": 781,
964+
"result": {
965+
"settings": [
966+
{
967+
"name": "virtualBuffers.passThroughAudioIndication",
968+
"value": true
969+
},
970+
{
971+
"name": "cursor",
972+
"value": "VPC"
973+
}
974+
]
975+
}
976+
}
977+
```
978+
</div>
979+
824980
### Events ### {#module-settings-events}
825981

826982
Issue: Do we need a "setting changed" event?
@@ -955,6 +1111,35 @@ The [=remote end steps=] given <var ignore>session</var> and |command parameters
9551111

9561112
</div>
9571113

1114+
<div class="example">
1115+
A [=local end=] that wishes to simulate pressing
1116+
<kbd><kbd>Control</kbd>+<kbd>h</kbd></kbd> (or, stated more formally:
1117+
depressing the <kbd>Control</kbd> key, depressing the <kbd>h</kbd> key,
1118+
releasing the <kbd>h</kbd> key, and finally releasing the <kbd>Control</kbd>
1119+
key) might send a Command such as:
1120+
1121+
```json
1122+
{
1123+
"id": 19860814,
1124+
"method": "interaction.userIntent",
1125+
"params": {
1126+
"name": "pressKeys",
1127+
"keys": ["\uE009", "h"]
1128+
}
1129+
}
1130+
```
1131+
1132+
And the [=remote end=] which receives that Command could respond with the
1133+
following Message:
1134+
1135+
```json
1136+
{
1137+
"id": 19860814,
1138+
"result": {}
1139+
}
1140+
```
1141+
</div>
1142+
9581143
### Events ### {#module-interaction-events}
9591144

9601145
#### The interaction.capturedOutput Event #### {#event-interaction-capturedOutput}

0 commit comments

Comments
 (0)