Opened 10 years ago

Closed 10 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


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)

layout1.png (82.3 KB) - added by Jakub Ś 10 years ago.
Keyboard.JPG (366.0 KB) - added by Jakub Ś 10 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 10 years ago by Jakub Ś

Status: newpending
Version: 4.0.1

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 and Alt Cas+8 for [, Alt Cas+- for 9 for French Canadian.

Sorry if these sound stupid but:

  1. Are you getting this in other programs or only in editor?
  2. Are you getting this only in editor 4.x or 3.x is also affected?
  3. Which keyboard and language settings have you used? This can be checked by clicking keyboard properties. You will get keyboard layout then (see attached pic)

Changed 10 years ago by Jakub Ś

Attachment: layout1.png added

Changed 10 years ago by Jakub Ś

Attachment: Keyboard.JPG added

comment:2 Changed 10 years ago by Jakub Ś

Component: GeneralCore : Keystrokes
Status: pendingconfirmed
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:

  1. 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)
  2. Next you have to press buttons Shown in Keyboard.JPG

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 ){

comment:3 Changed 10 years ago by Jakub Ś

Milestone: CKEditor 4.0.2

comment:4 Changed 10 years ago by Olek Nowodziński

Owner: set to Olek Nowodziński
Status: confirmedassigned

comment:5 Changed 10 years ago by Olek Nowodziński

Status: assignedreview

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 10 years ago by Frederico Caldeira Knabben

Cc: Damian Teresa Monahan added
Status: reviewreview_passed

Please have the comments fixed when masterising.

comment:7 Changed 10 years ago by Olek Nowodziński

Resolution: fixed
Status: review_passedclosed

Fixed with git:df9435d.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy