TinyMCE wpView: exclude more non-printable keyCodes in isSpecialKey(), fixes #29115

Built from https://develop.svn.wordpress.org/trunk@29606


git-svn-id: http://core.svn.wordpress.org/trunk@29380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2014-08-25 20:41:16 +00:00
parent 6a734800a7
commit a2ad27c03e
3 changed files with 5 additions and 3 deletions

View File

@ -354,11 +354,13 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
}); });
// Excludes arrow keys, delete, backspace, enter, space bar. // Excludes arrow keys, delete, backspace, enter, space bar.
// Ref: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent.keyCode
function isSpecialKey( key ) { function isSpecialKey( key ) {
return ( ( key <= 47 && key !== VK.SPACEBAR && key !== VK.ENTER && key !== VK.DELETE && key !== VK.BACKSPACE && ( key < 37 || key > 40 ) ) || return ( ( key <= 47 && key !== VK.SPACEBAR && key !== VK.ENTER && key !== VK.DELETE && key !== VK.BACKSPACE && ( key < 37 || key > 40 ) ) ||
key === 144 || key === 145 || // Num Lock, Scroll Lock key >= 224 || // OEM or non-printable
( key >= 144 && key <= 150 ) || // Num Lock, Scroll Lock, OEM
( key >= 91 && key <= 93 ) || // Windows keys ( key >= 91 && key <= 93 ) || // Windows keys
( key >= 112 && key <= 123 ) ); // F keys ( key >= 112 && key <= 135 ) ); // F keys
} }
// (De)select views when arrow keys are used to navigate the content of the editor. // (De)select views when arrow keys are used to navigate the content of the editor.

File diff suppressed because one or more lines are too long