Opened 11 years ago

Closed 11 years ago

#10899 closed Bug (invalid)

KeyCode is different in chrome when Ctrl key is pressed

Reported by: Jonathan Creamer Owned by:
Priority: Normal Milestone:
Component: Core : Keystrokes Version: 4.2
Keywords: Cc:

Description

I'm noticing a weird behavior with Chrome and the keycode.

http://jsbin.com/ovOyoge/1/edit

In Chrome, if you hold Ctrl + Shift + KEY, the code is different than in FireFox. For example, in Chrome if you press Ctrl + Shift + J it shows "10" for the keycode rather than the 74 it SHOULD show and does in FireFox.

Thanks!

Change History (1)

comment:1 Changed 11 years ago by Jakub Ś

Keywords: keyboard removed
Resolution: invalid
Status: newclosed

I'm not sure which code you use but using below:

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());
						if(event.data.getKeystroke() === (CKEDITOR.CTRL + CKEDITOR.SHIFT + 90)){//z
							console.log(event.data.getKeystroke());
						}	
					});		
				});
			});	

Gives 3342426 in all cases.

This is how keystrokes should be used.

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