Skip to content

Conversation

@JoelEinbinder
Copy link
Contributor

This patch lets key names be code in addition to key. When specifying a code, the proper text is generated assuming a standard US keyboard layout. e.g Digit5 -> "5" or "%" depending on Shift.

location is now specified.

Using unknown key names now throws an error.

Typing newlines now correctly presses enter.

this._pressedKeys.add(key);
this._modifiers |= this._modifierBit(key);
async down(key, options = { text: undefined }) {
const description = this._keyDescriptionForString(key);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should throw if there's no description for the key

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

*/
async up(key) {
this._modifiers &= ~this._modifierBit(key);
this._pressedKeys.delete(key);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this throws if there's no key description as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@aslushnikov
Copy link
Contributor

let's at least reference bugs this is about.

@JoelEinbinder
Copy link
Contributor Author

This should help/fix
#681
#777
#723

@JoelEinbinder JoelEinbinder merged commit 126ab7b into puppeteer:master Oct 23, 2017
ithinkihaveacat pushed a commit to ithinkihaveacat/puppeteer that referenced this pull request Oct 31, 2017
BREAKING CHANGE:

This patch lets key names be code in addition to key. When specifying a code, the proper text is generated assuming a standard US keyboard layout. e.g Digit5 -> "5" or "%" depending on Shift.

* location is now specified. puppeteer#777

* Using unknown key names now throws an error. puppeteer#723

* Typing newlines now correctly presses enter. puppeteer#681
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants