Hi,
I'm writting a plugin for CKEDITOR, and I'm trying to enable/disable toolbar items.
I set the button state using the setState() method, wrapped in the editor.on('selectionChange') event.
The thing is :
Note that this event is fired only when selection's start element (container of a selecion start) changes, not on every possible selection change
With this behaviour, if I click in an element (<p>), the selectionChange is triggered. Then if I select part of the text in this element, the selectionChange event is not triggered, so I cannot enable my button.
I took a look at the clipboard plugin, but I cannot manage to make it work the same way as the copy/cut buttons.
Thanks a lot

Well, I finally managed to
Well, I finally managed to make it work. I had to add :
var mouseupTimeout; // Use editor.document instead of editable in non-IEs for observing mouseup // since editable won't fire the event if selection process started within // iframe and ended out of the editor (#9851). editable.attachListener( CKEDITOR.env.ie ? editable : editor.document.getDocumentElement(), 'mouseup', function() { mouseupTimeout = setTimeout( function() { setToolbarStates(); }, 0 ); } ); // Make sure that deferred mouseup callback isn't executed after editor instance // had been destroyed. This may happen when editor.destroy() is called in parallel // with mouseup event (i.e. a button with onclick callback) (#10219). editor.on( 'destroy', function() { clearTimeout( mouseupTimeout ); } );Now, it's all ok.