cksource / ckeditor4-plugin-a11ychecker

Accessibility checker for CKEditor 4
Other
19 stars 12 forks source link

Keyboard shortcuts are not working properly #230

Closed Michal-N1 closed 7 years ago

Michal-N1 commented 7 years ago

On Firefox 50.0.2 & Chrome 49.0.2623.112 m, Windows Vista (Polish language) + tested also on second PC (but don't have the spec), plugin version 1.1.0 (clear version, the bug is also on your website in demo) keyboard shortcuts are not working properly - right alt + e is opening the plugin (should be ctrl+alt+e). This is annoying for people, who like me have Polish keyboard and have to type Polish character 'ę', which need to use alt+e, because every time this shortcut opens the plugin window.

The problem is in line 37 in plugin.js file: {open:CKEDITOR.CTRL+CKEDITOR.ALT+69,next:CKEDITOR.CTRL+69,prev:CKEDITOR.CTRL+CKEDITOR.SHIFT+69,listen:CKEDITOR.SHIFT+27,close:27};

For those who also have this issue and need to fast resolve it - just delete CKEDITOR.ALT+ part and everything works fine (this change the shortcut to ctrl+e, you should also change the number to bind other key, because ctrl+e is already used).

mlewand commented 7 years ago

Yes, it might have some conflicts. Reason why (right) alt + e is because on PL keyboard right "alt" key is actually AlrGr - which pretty much emulates pressing ctrl + alt together.

It's hard for us to get around all the bindings like this, but you can customize the hotkey very easily using CKEditor configuration.

You can take following code as an example:

config.a11ychecker_keystrokes = {
    open: CKEDITOR.CTRL + CKEDITOR.ALT + 68, /*D*/
    next: CKEDITOR.CTRL + 68, /*D*/
    prev: CKEDITOR.CTRL + CKEDITOR.SHIFT + 68, /*D*/
    listen: CKEDITOR.SHIFT + 27, /*Esc*/
    close: 27 /*Esc*/
};

You can see it as an example usage in keystrokes test that I have just pushed.

This will work much better for you, as you won't have to edit code base, and also when you update AC you will keep your config.

This issue shows that we don't have a good documentation on this part, I'll extract it into an other issue.