diff --git a/src/utils/injectunsafekeystrokeshandling.js b/src/utils/injectunsafekeystrokeshandling.js index a6f38d1..754489c 100644 --- a/src/utils/injectunsafekeystrokeshandling.js +++ b/src/utils/injectunsafekeystrokeshandling.js @@ -123,12 +123,26 @@ const safeKeycodes = [ 16, // Shift 17, // Ctrl 18, // Alt + 19, // Pause 20, // CapsLock 27, // Escape 33, // PageUp 34, // PageDown 35, // Home - 36 // End + 36, // End, + 45, // Insert, + 91, // Windows, + 93, // Menu key, + 144, // NumLock + 145, // ScrollLock, + 173, // Mute/Unmute + 174, // Volume up + 175, // Volume down, + 176, // Next song, + 177, // Previous song, + 178, // Stop, + 179, // Play/Pause, + 255 // Display brightness (increase and decrease) ]; // Function keys. diff --git a/tests/input.js b/tests/input.js index 2cdaf8b..975c259 100644 --- a/tests/input.js +++ b/tests/input.js @@ -644,8 +644,18 @@ describe( 'Input feature', () => { } ); viewDocument.fire( 'keydown', { keyCode: 16 } ); // Shift + viewDocument.fire( 'keydown', { keyCode: 19 } ); // Pause viewDocument.fire( 'keydown', { keyCode: 35 } ); // Home viewDocument.fire( 'keydown', { keyCode: 112 } ); // F1 + viewDocument.fire( 'keydown', { keyCode: 255 } ); // Display brightness + + // Media control keys + viewDocument.fire( 'keydown', { keyCode: 173 } ); // Mute + viewDocument.fire( 'keydown', { keyCode: 174 } ); // Volume up + viewDocument.fire( 'keydown', { keyCode: 175 } ); // Volume down + viewDocument.fire( 'keydown', { keyCode: 176 } ); // Next song + viewDocument.fire( 'keydown', { keyCode: 177 } ); // Previous song + viewDocument.fire( 'keydown', { keyCode: 179 } ); // Stop expect( getModelData( model ) ).to.equal( 'fo[ob]ar' ); } );