-
New Feature
-
Resolution: Done
-
Normal
-
None
-
None
-
None
-
None
Current
doKeyDown_: function (evt) { switch (evt.key) { case 'Escape': // blah break; case 'Space': // blah break; } }
Proposed new API
doKeyDown_: function (evt) { if (evt.isPressed(Keys.ESCAPE)) { // blah } else if (evt.isPressed(Keys.SPACE)) { // blah } }
isPressed(...keys: string[]): boolean
Parameters:
1. keys: which key including modifiers if any
Returns:
Is the key pressed?
Keys
A collection of constants. Users don't have to remember how to spell the correct keyword.
Please refer to Selenium [Keys](https://www.selenium.dev/selenium/docs/api/py/_modules/selenium/webdriver/common/keys.html#Keys)