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
-
stack : Array
readonly
Defaults to
[]
Methods
-
Returns
-
cleanUp( event )
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
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
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
Sums up inputs number for each key code and returns it.
Returns
Number
-
increment( keyCode )
Increments registered input events for stack record for a given
keyCode
.Parameters
keyCode : Number
-
push( keyCode )
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 )
Removes the last record from the stack for the provided
keyCode
.Parameters
keyCode : Number
-
resetInputs( [ keyCode ] )
Resets the
inputs
value to0
for a givenkeyCode
or in entire stack if akeyCode
is not specified.Parameters
[ keyCode ] : Number