This project is archived and is in readonly mode.

#1064 ✓invalid

onkeypress & event.key : some keys are not reporting the good code

Reported by Tokiros | November 4th, 2010 @ 10:56 AM | in 2.0 (closed)

My situation :

Belgian Keyboard, IE7 (yes, i know...), Windows XP SP3.

Belgian keyboard layout :

Belgian keyboard layout

When i type on the key '1 / &' on my keyboard the event.key contains 'up'
the key '4 / '' gives 'right'
the key '5 / (' gives 'down'
the 'ù / %' gives 'left' for % (so shift+ù)
the '; / .' gives 'delete' (so shift+;)
and probably others wrong keys are reported

Test case :

I've also tested it with Chrome 7.0.517.41 beta for the same behavior, Firefox 3.6.11 also
Mootools 1.3 have the same problem

Comments and changes to this ticket

  • Tokiros

    Tokiros November 4th, 2010 @ 10:57 AM

    I forgot to say that the tests were done with Mootools 1.2.5

  • Arian

    Arian November 4th, 2010 @ 11:16 AM

    • Milestone set to 1.3.1
    • Milestone order changed from “816” to “0”

    Could you make a short list of the results you get of the keycodes (event.code) and the keyname (event.key). Because as far as I know the keycodes shouldn't change across different keyboard layouts.

    Can you try to include MooTools More 1.3 as well in your jsfiddle, that adds some more keycode/key combinations.

  • Tokiros

    Tokiros November 4th, 2010 @ 11:43 AM

    I've updated it to include more, and it does the same thing, with more keys beeing reported badly

       Key    event.key    event.code
       &      up           38
       "      pagedown     34
       '      right        39
       (      down         40
       !      pageup       33
       #      end          35
       $      home         36
       %      left         37
       .      delete       46
 for mootools 1.2.5
    and for mootools 1.3

  • Christoph Pojer

    Christoph Pojer November 9th, 2010 @ 06:17 PM

    • State changed from “new” to “open”
    • Milestone changed from 1.3.1 to 2.0
    • Assigned user set to “Valerio”
    • Milestone order changed from “8” to “0”

    I don't think we will fix this before 2.0 comes around. This is possibly hard to detect too because every browser chooses to work differently here :) In any case, for now, use the event that works better for you. From personal experience keypress is usually more correct.

  • deos

    deos December 16th, 2010 @ 09:41 AM

    just wanted to add, im having the same issue on a keyboard with german layout (mac)
    im getting the exact same results as shown above in firefox, chrome, safari, opera and IE8 (on win7 in parallels) - testet with the link above (mootools 1.3 version)
    this a quite serious bug imo, please take care of it soon

  • ibolmo

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins