Opened 12 years ago
Closed 12 years ago
#9966 closed Bug (fixed)
Square brackets not working in IE or Chrome
Reported by: | boite bidon | Owned by: | Olek Nowodziński |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.0.2 |
Component: | Core : Keystrokes | Version: | 4.0.1 |
Keywords: | Cc: | Damian, Teresa Monahan |
Description
It's impossible to type in square brackets [ or ] in IE or Chrome. It works on Firefox. I also tried it on your website demo and encountered the same bug. Nothing happens when I type it in. FYI on my keyboard I have to do Alt Car + another button to get ]. And every other combination of button and Alt Car works fine.
Attachments (2)
Change History (9)
comment:1 Changed 12 years ago by
Status: | new → pending |
---|---|
Version: | 4.0.1 |
Changed 12 years ago by
Attachment: | layout1.png added |
---|
Changed 12 years ago by
Attachment: | Keyboard.JPG added |
---|
comment:2 Changed 12 years ago by
Component: | General → Core : Keystrokes |
---|---|
Status: | pending → confirmed |
Version: | → 4.0.1 |
I have managed to reproduce this from CKEditor 4.0.1 in Safari, Opera, Chrome and IE (It only works in Firefox).
Please note that this issue has worked in 4 beta and CKE 4.0.
To reproduce:
- Please look at layout1.png - I believe this is the key to reproduce this. You have to set input language and keyboard to French (Canada)
- Next you have to press buttons Shown in Keyboard.JPG
NOTE:
I have noticed that below code produces:
Till version 4.0 - 1114129,5570578,5570779 From version 4.0.1 - 1114129,5570578 (last one is not caught)
var editor = CKEDITOR.replace( 'editor1' ); editor.on( 'pluginsLoaded', function( evt ) { editor.on( 'contentDom', function( e ) { var editable = editor.editable(); var doc = editor.document; editable.attachListener( doc, 'keydown', function( event ){ console.log(event.data.getKeystroke()); }); }); });
comment:3 Changed 12 years ago by
Milestone: | → CKEditor 4.0.2 |
---|
comment:4 Changed 12 years ago by
Owner: | set to Olek Nowodziński |
---|---|
Status: | confirmed → assigned |
comment:5 Changed 12 years ago by
Status: | assigned → review |
---|
The problem is really funny:
Originally, US PC keyboards (specifically, the US 101-key PC/AT keyboards) did not have an AltGr key, since that was relevant to only non-US markets; they simply had "left" and "right" Alt keys.
The right Alt key is usually an equivalent of the AltGr key, as both of them share the same scancode and are indistinguishable from software. However, on some keyboards it may not be the case, or (most often on laptop keyboards) the right Alt key may be missing altogether. To allow the specific functionality of AltGr when typing non-English text on such keyboards, Windows began to allow it to be emulated by pressing the Alt key together with the Control key: Ctrl+Alt ≈ AltGr
Therefore, it is recommended that this combination not be used as a modifier in Windows keyboard shortcuts as, depending on the keyboard layout and configuration, someone trying to type a special character with it may accidentally trigger the shortcut,[4] or the keypresses for the shortcut may be inadvertently interpreted as the user trying to input a special character.)
Source: Wikipedia.
If ALT CAR
(ALT GR
) can stand for CTRL+ALT
, then indeed the magicline plugin access keystroke (CTRL+ALT+[/]
) overwrites default key combination for typing square brackets.
I proposed a basic patch in the branch t/9966@cksource that changes magicline keystroke: CTRL+ALT+[/]
-> CTRL+SHIFT+[/]
. If this keystroke is safe (IMO it is, but still needs double-check), it solves the problem entirely.
comment:6 Changed 12 years ago by
Cc: | Damian Teresa Monahan added |
---|---|
Status: | review → review_passed |
Please have the comments fixed when masterising.
comment:7 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Fixed with git:df9435d.
This might be my system settings but:
I have tried setting French in my Windows in various editing programs (CKEditor, element with contenteditable set to true, MS Word) and I was able to type square brackets when using
Alt Cas+5 for [
,Alt Cas+- for ]
for French keyboard andAlt Cas+8 for [
,Alt Cas+- for 9
for French Canadian.Sorry if these sound stupid but: