public/ckeditor/4.4dev/core/selection.js
function getOnKeyDownListener( editor ) {
		var keystrokes = { 37: 1, 39: 1, 8: 1, 46: 1 };

		return function( evt ) {
			var keystroke = evt.data.getKeystroke();

			// Handle only left/right/del/bspace keys.
			if ( !keystrokes[ keystroke ] )
				return;

			var sel = editor.getSelection(),
				ranges = sel.getRanges(),
				range = ranges[ 0 ];

			// Handle only single range and it has to be collapsed.
			if ( ranges.length != 1 || !range.collapsed )
				return;

			var next = range[ keystroke < 38 ? 'getPreviousEditableNode' : 'getNextEditableNode' ]();

			if ( next && next.type == CKEDITOR.NODE_ELEMENT && next.getAttribute( 'contenteditable' ) == 'false' ) {
				editor.getSelection().fake( next );
				evt.data.preventDefault();
				evt.cancel();
			}
		};
	}
function getOnKeyDownListener( editor ) {
		var keystrokes = { 37: 1, 39: 1, 8: 1, 46: 1 };

		return function( evt ) {
			var keystroke = evt.data.getKeystroke();

			// Handle only left/right/del/bspace keys.
			if ( !keystrokes[ keystroke ] )
				return;

			var sel = editor.getSelection(),
				ranges = sel.getRanges(),
				range = ranges[ 0 ];

			// Handle only single range and it has to be collapsed.
			if ( ranges.length != 1 || !range.collapsed )
				return;

			var next = range[ keystroke < 38 ? 'getPreviousEditableNode' : 'getNextEditableNode' ]();

			if ( next && next.type == CKEDITOR.NODE_ELEMENT && next.getAttribute( 'contenteditable' ) == 'false' ) {
				editor.getSelection().fake( next );
				evt.data.preventDefault();
				evt.cancel();
			}
		};
	}
function getOnKeyDownListener ( editor ) { var keystrokes = { 37 : 1 , 39 : 1 , 8 : 1 , 46 : 1 } ; return function ( evt ) { var keystroke = evt . data . getKeystroke ( ) ; // Handle only left/right/del/bspace keys. if ( ! keystrokes [ keystroke ] ) return ; var sel = editor . getSelection ( ) , ranges = sel . getRanges ( ) , range = ranges [ 0 ] ; // Handle only single range and it has to be collapsed. if ( ranges . length != 1 || ! range . collapsed ) return ; var next = range [ keystroke < 38 ? 'getPreviousEditableNode' : 'getNextEditableNode' ] ( ) ; if ( next && next . type == CKEDITOR . NODE_ELEMENT && next . getAttribute ( 'contenteditable' ) == 'false' ) { editor . getSelection ( ) . fake ( next ) ; evt . data . preventDefault ( ) ; evt . cancel ( ) ; } } ; }
Handle left, right, delete and backspace keystrokes next to non-editable elements by faking selection on them.
Handle left right delete and backspace keystrokes next to non - editable elements by faking selection on them .