catchpoint / WebPageTest.agent

Cross-platform WebPageTest agent
Other
210 stars 138 forks source link

Add modifiers support for keypress #663

Open MaryamHuntsperger opened 3 months ago

MaryamHuntsperger commented 3 months ago

Existing kepress command does not support modifiers to dispatch a key combination event such as Ctrl+A.

Using Devtools Protocol (https://chromedevtools.github.io/devtools-protocol/tot/Input/) Input.dispatchKeyEvent modifiers, we have added a new value argument where the users can pass Alt, Ctrl or Shift and dispatch key combinations. The new format is: keypress [tab] key [tab] Alt|Ctrl|Shift.

image

The new command is backward compatible and works as before if no value passed. In case of passing garbage values, it also ignores them. This is behavior is aligned with Devtools Protocol, when a key combination is at system level, it gets simply ignored.