From 3c757672888502cb4ceccf251e8be70416a3eca8 Mon Sep 17 00:00:00 2001 From: JoelEinbinder Date: Fri, 28 Jul 2017 11:38:30 -0700 Subject: [PATCH] Fix media keys to use new key strings and codes (#164) VolumeUp, VolumeDown, and VolumeMute were changed to AudioVolumeUp, AudioVolumeDown, and AudioVolumeMute The media keys like MediaTrackNext were also missing, so I added them. --- lib/Input.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/Input.js b/lib/Input.js index c49ae3dd..0093a90a 100644 --- a/lib/Input.js +++ b/lib/Input.js @@ -31,7 +31,7 @@ class Keyboard { * @return {!Promise} */ async down(key, options) { - let {text} = options || {}; + let { text } = options || {}; this._modifiers |= this._modifierBit(key); await this._client.send('Input.dispatchKeyEvent', { type: text ? 'keyDown' : 'rawKeyDown', @@ -244,9 +244,13 @@ let keys = { 'F24': 135, 'NumLock': 144, 'ScrollLock': 145, - 'VolumeMute': 181, - 'VolumeDown': 182, - 'VolumeUp': 183, + 'AudioVolumeMute': 173, + 'AudioVolumeDown': 174, + 'AudioVolumeUp': 175, + 'MediaTrackNext': 176, + 'MediaTrackPrevious': 177, + 'MediaStop': 178, + 'MediaPlayPause': 179, ';': 186, ':': 186, '=': 187, @@ -290,6 +294,6 @@ function codeForKey(key) { return 0; } -module.exports = {Keyboard, Mouse}; +module.exports = { Keyboard, Mouse }; helper.tracePublicAPI(Keyboard); helper.tracePublicAPI(Mouse);