CKEDITOR.plugins.undo.KeyEventsStack
This class represents a stack of pressed keys and stores information
about how many input
events each key press has caused.
Filtering
Properties
-
Defaults to
[]
Methods
-
constructor() → KeyEventsStack
CKEDITOR.plugins.undo.KeyEventsStack#constructor
-
cleanUp( event )
CKEDITOR.plugins.undo.KeyEventsStack#cleanUp
Cleans the stack based on a provided
keydown
event object. The rationale behind this method is that some keystrokes cause thekeydown
event to be fired in the editor, but not thekeyup
event. For instance, Alt+Tab will firekeydown
, but since the editor is blurred by it, then there is nokeyup
, so the keystroke is not removed from the stack.Parameters
event : event
-
getLast( [ keyCode ] ) → Object
CKEDITOR.plugins.undo.KeyEventsStack#getLast
Returns the last key recorded in the stack. If
keyCode
is provided, then it will return the last record for thiskeyCode
.Parameters
[ keyCode ] : Number
Returns
Object
Last matching record or
null
.
-
getLastIndex( [ keyCode ] ) → Number
CKEDITOR.plugins.undo.KeyEventsStack#getLastIndex
Returns the index of the last registered
keyCode
in the stack. If nokeyCode
is provided, then the function will return the index of the last item. If an item is not found, it will return-1
.Parameters
[ keyCode ] : Number
Returns
Number
-
getTotalInputs() → Number
CKEDITOR.plugins.undo.KeyEventsStack#getTotalInputs
-
increment( keyCode )
CKEDITOR.plugins.undo.KeyEventsStack#increment
Increments registered input events for stack record for a given
keyCode
.Parameters
keyCode : Number
-
push( keyCode )
CKEDITOR.plugins.undo.KeyEventsStack#push
Pushes a literal object with two keys:
keyCode
andinputs
(whose initial value is set to0
) to stack. It is intended to be called on thekeydown
event.Parameters
keyCode : Number
-
remove( keyCode )
CKEDITOR.plugins.undo.KeyEventsStack#remove
Removes the last record from the stack for the provided
keyCode
.Parameters
keyCode : Number
-
resetInputs( [ keyCode ] )
CKEDITOR.plugins.undo.KeyEventsStack#resetInputs
Resets the
inputs
value to0
for a givenkeyCode
or in entire stack if akeyCode
is not specified.Parameters
[ keyCode ] : Number