0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 07:13:08 -05:00

Let the browser handle shift-delete.

Apparently it's "cut" on Windows. Who knew.
This commit is contained in:
Neil Jenkins 2014-11-20 12:45:36 +07:00
parent 3296e7576e
commit cb9292721c
3 changed files with 17 additions and 11 deletions

View file

@ -3094,15 +3094,18 @@ proto._onKey = function ( event ) {
key = 'f' + ( code - 111 );
}
// We need to apply the backspace/delete handlers regardless of modifiers.
// We need to apply the backspace/delete handlers regardless of
// control key modifiers.
if ( key !== 'backspace' && key !== 'delete' ) {
if ( event.altKey ) { modifiers += 'alt-'; }
if ( event.altKey ) { modifiers += 'alt-'; }
if ( event.ctrlKey ) { modifiers += 'ctrl-'; }
if ( event.metaKey ) { modifiers += 'meta-'; }
if ( event.shiftKey ) { modifiers += 'shift-'; }
key = modifiers + key;
}
// However, on Windows, shift-delete is apparently "cut" (WTF right?), so
// we want to let the browser handle shift-delete.
if ( event.shiftKey ) { modifiers += 'shift-'; }
key = modifiers + key;
if ( keyHandlers[ key ] ) {
keyHandlers[ key ]( this, event );

File diff suppressed because one or more lines are too long

View file

@ -2009,15 +2009,18 @@ proto._onKey = function ( event ) {
key = 'f' + ( code - 111 );
}
// We need to apply the backspace/delete handlers regardless of modifiers.
// We need to apply the backspace/delete handlers regardless of
// control key modifiers.
if ( key !== 'backspace' && key !== 'delete' ) {
if ( event.altKey ) { modifiers += 'alt-'; }
if ( event.altKey ) { modifiers += 'alt-'; }
if ( event.ctrlKey ) { modifiers += 'ctrl-'; }
if ( event.metaKey ) { modifiers += 'meta-'; }
if ( event.shiftKey ) { modifiers += 'shift-'; }
key = modifiers + key;
}
// However, on Windows, shift-delete is apparently "cut" (WTF right?), so
// we want to let the browser handle shift-delete.
if ( event.shiftKey ) { modifiers += 'shift-'; }
key = modifiers + key;
if ( keyHandlers[ key ] ) {
keyHandlers[ key ]( this, event );