Hi,
Here's my plugin's code wich detect if backspace key is pressed:
It works when backspace key is pressed then released (ex: when I delete a string character by character).
But it doesn't work anymore if I hold down the backspace key (onKeyPressed).
How can I detect if the backspace key is hold down ?
PLease help.
Here's my plugin's code wich detect if backspace key is pressed:
var onKey = function( event )
{
switch ( event.data.keyCode )
{
case 8 : // BACKSPACE
//code...
}
};
CKEDITOR.plugins.add('detectbackspace',
{
init: function(editor)
{
var pluginName = 'detectbackspace';
editor.on( 'key', onKey, editor );
}
});It works when backspace key is pressed then released (ex: when I delete a string character by character).
But it doesn't work anymore if I hold down the backspace key (onKeyPressed).
How can I detect if the backspace key is hold down ?
PLease help.

Re: Detect if the backspace key is hold down ?
No response... as usual !
So can someone tells me how to get the type of an event (event.type) with CKeditor API ?
Re: Detect if the backspace key is hold down ?
Use the $ to get the native event: http://docs.cksource.com/ckeditor_api/s ... ent.html#$
Re: Detect if the backspace key is hold down ?
But please could you show me how to get the native event, I'm lost.
I spend 3 days on it (check the doc) but I still don't know how to make
it works in my plugin.
Thanks for advance.
Re: Detect if the backspace key is hold down ?
and the available methods of event.$ are:
name value :key sender value :[object Object] editor value :[object Object] data value :[object Object] listenerData value :undefined stop value :function () { d = true; } cancel value :function () { f = true; } removeListener value :function () { l.removeListener(d, e); }What method is supposed to give me the type of the event ?
Are you sure it's possible ?
Re: Detect if the backspace key is hold down ?
You need to setup your native listener and then you'll be able to read the event.$
Re: Detect if the backspace key is hold down ?
I tried but I really don't know how to setup my native listener (too few indications in the doc).
So could you please give me a piece of code or something that makes me get it ?
Thanks for advance.
Re: Detect if the backspace key is hold down ?
I get some clues here:
I'm too much confused ! (I'm under Linux/FF).
http://unixpapa.com/js/key.html
The tip is when a key is hold down there's an auto-repeat, but I saw
that in FF under Linux there's no auto-repeat
So it seems really tricky.
Can someone pleaaaase help me to detect when the backspace key is holding down ???