Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keyboard input in Internet Explorer 10 #352

Closed
samhed opened this issue Mar 19, 2014 · 7 comments
Closed

keyboard input in Internet Explorer 10 #352

samhed opened this issue Mar 19, 2014 · 7 comments

Comments

@samhed
Copy link
Member

samhed commented Mar 19, 2014

When trying to type for example "hello" in noVNC in IE 10 i instead get "85,,/". It is impossible to input normal characters, the only keys that seem to generate the correct input are 1,2,3,4,5,6,7,8,9,0 and the num-pad numbers.

This problem is not present in IE 11, Firefox and Chrome.

Tested on Windows 7.

@samhed
Copy link
Member Author

samhed commented Mar 19, 2014

When using tests/input.html this is what I get when pressing the letter a:

Internet Explorer 10:
3: raw key event keydown (key: 65, char: undefined, which: undefined)< br>
4: raw key event keypress (key: 97, char: undefined, which: undefined)< br>
5: RFB keypress down keysym: 65457 key name: 65457< br>
6: raw key event keyup (key: 65, char: undefined, which: undefined)< br>
7: RFB keypress up keysym: 65457 key name: 65457< br>

(* I added spaces before the br-tag to avoid creating line-breaks in this post)

Chrome:
3: raw key event keydown (key: 65, char: 0, which: 65)
4: raw key event keypress (key: 97, char: 97, which: 97)
5: RFB keypress down keysym: 97 key name: 97
6: raw key event keyup (key: 65, char: 0, which: 65)
7: RFB keypress up keysym: 97 key name: 97

@jalfd
Copy link

jalfd commented Mar 19, 2014

Reproduced, and I think I've got a fix. I'll need to test it a bit first though, to ensure it doesn't break anything else.

I'm not sure why this didn't occur when I initially tested the keyboard handling code, but now it seems like IE10 only sets the keyCode property on keypress events, but seemingly with the same meaning as charCode normally has (that is, a Unicode code point for the character being entered).

@jalfd
Copy link

jalfd commented Apr 4, 2014

I pushed a fix to https://github.com/Medical-Insight/noVNC/tree/fix-ie10-keyboard
I'm a bit busy with work at the moment though, so I haven't had time to test it in every browser configuration. It seems to work in IE10, IE11 and a recent Firefox and Chrome with a handful of keypresses, but I haven't tested all the combinations of modifier keys, dead keys and layout-specific keys on different OSes.

If anyone else has time to give it a test run and see if there are any regressions, that'd be really helpful!

@samhed
Copy link
Member Author

samhed commented Apr 4, 2014

A quick test against IE10 on Windows 7 seems to work well! No problems encountered on Fedora 18 with Firefox 28 and Chrome 34 either, except for the dead keys in Firefox ( #350 ).

@Kobura-
Copy link

Kobura- commented Apr 7, 2014

Thanks jalfd!

Consistent behavior across all browsers now, most keys working as intended (some keys just aren't recognized under OSX, like ^´`).

Browsers tested so far:
Windows 7 (VirtualBox VM) - IE10, IE11, FF 28.0
OSX 10.9.2 - Chrome 33, FF 28.0, Safari 7.0.3
German MacBook keyboard.

@samhed
Copy link
Member Author

samhed commented Apr 9, 2014

I have now tested with mobile devices that use the normal keyboard code as well: Firefox 28 on Android 4.3 and Safari 7 on iOS 7, it works great!

samhed added a commit that referenced this issue Apr 14, 2014
…sight/noVNC/tree/fix-ie10-keyboard).

Fix keyboard handling for IE10 (issue #352)
* Keyboard events in IE10 do not provide any useful information on the properties 'which', 'char' or 'charCode'. Instead, it seems to store the char code in the keyCode property.
@samhed
Copy link
Member Author

samhed commented Apr 14, 2014

I took the liberty of merging this fix (60a415a), thank you again @jalfd

@samhed samhed closed this as completed Apr 14, 2014
@samhed samhed added the fixed label Apr 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants