Loading ...
Sorry, an error occurred while loading the content.
 

List of keycodes for YAHOO.util.KeyListener?

Expand Messages
  • randomjuju
    Hi there! It d be really great if the YAHOO.util.KeyListener class came with a list of keycodes. For example, YAHOO.util.KeyListener.KEY_ESC = 27. I ll file a
    Message 1 of 4 , Jan 5, 2007
      Hi there!

      It'd be really great if the YAHOO.util.KeyListener class came with a list of keycodes.  For example, YAHOO.util.KeyListener.KEY_ESC = 27.

      I'll file a real feature request, but I wanted to make sure this hasn't already been done first.

      Thanks very much!

      -Jon
    • Josh
      Here is an excellent resource... http://www.cambiaresearch.com/cambia3/snippets/javascript/reference/javascript_charcodes.aspx I would worry that the size of
      Message 2 of 4 , Jan 5, 2007
        Here is an excellent resource...
        http://www.cambiaresearch.com/cambia3/snippets/javascript/reference/javascript_charcodes.aspx

        I would worry that the size of the js files would grow unjustly for
        this convenience...but who knows... :)

        Josh

        --- In ydn-javascript@yahoogroups.com, "randomjuju" <jon.chambers@...>
        wrote:
        >
        > Hi there!
        >
        > It'd be really great if the YAHOO.util.KeyListener class came with a
        > list of keycodes. For example, YAHOO.util.KeyListener.KEY_ESC = 27.
        >
        > I'll file a real feature request
        > <https://sourceforge.net/tracker/?group_id=165715&atid=836479> , but I
        > wanted to make sure this hasn't already been done first.
        >
        > Thanks very much!
        >
        > -Jon
        >
      • randomjuju
        Sure. That may well be. As a compromise, a lot of key codes can be generated procedurally (i.e. x .charCodeAt(0)). Maybe just include the keys for which
        Message 3 of 4 , Jan 5, 2007
          Sure. That may well be.

          As a compromise, a lot of key codes can be generated procedurally
          (i.e. 'x'.charCodeAt(0)). Maybe just include the keys for which that
          isn't possible (ESC, arrow keys, etc.)?

          Also, I may be having a crisis of understanding key codes here:

          'x'.charCodeAt(0) == 120
          'X'.charCodeAt(0) == 88

          How are the ASCII values of characters related to their key codes, if
          at all? The site you suggested lists only 88 as the key code for 'X',
          and does so for the wrong case.

          Thanks!

          -Jon

          --- In ydn-javascript@yahoogroups.com, "Josh" <joshlrogers@...> wrote:
          >
          > Here is an excellent resource...
          >
          http://www.cambiaresearch.com/cambia3/snippets/javascript/reference/javascript_charcodes.aspx
          >
          > I would worry that the size of the js files would grow unjustly for
          > this convenience...but who knows... :)
          >
          > Josh
          >
          > --- In ydn-javascript@yahoogroups.com, "randomjuju" <jon.chambers@>
          > wrote:
          > >
          > > Hi there!
          > >
          > > It'd be really great if the YAHOO.util.KeyListener class came with a
          > > list of keycodes. For example, YAHOO.util.KeyListener.KEY_ESC = 27.
          > >
          > > I'll file a real feature request
          > > <https://sourceforge.net/tracker/?group_id=165715&atid=836479> , but I
          > > wanted to make sure this hasn't already been done first.
          > >
          > > Thanks very much!
          > >
          > > -Jon
          > >
          >
        • Josh
          I believe I may be misunderstanding you actually... The site I gave you gives the javascript key codes for each button. I have found that the case is of no
          Message 4 of 4 , Jan 5, 2007
            I believe I may be misunderstanding you actually...

            The site I gave you gives the javascript key codes for each button. I
            have found that the case is of no consequence in this matter. I might
            need to know what you are attempting to achieve.....I made sure that
            88 was correct after reading your post with this code:

            YAHOO.util.Event.addListener(document, "keydown", keyHandler);

            keyHandler (event)
            {
            if(! event.keyCode)
            {
            alert(event.which);
            }
            else
            {
            alert(event.keyCode);
            }

            };


            By pressing the x key you will always get value 88 as the keyCode. So
            what are you trying to do exactly?

            Josh


            --- In ydn-javascript@yahoogroups.com, "randomjuju" <jon.chambers@...>
            wrote:
            >
            > Sure. That may well be.
            >
            > As a compromise, a lot of key codes can be generated procedurally
            > (i.e. 'x'.charCodeAt(0)). Maybe just include the keys for which that
            > isn't possible (ESC, arrow keys, etc.)?
            >
            > Also, I may be having a crisis of understanding key codes here:
            >
            > 'x'.charCodeAt(0) == 120
            > 'X'.charCodeAt(0) == 88
            >
            > How are the ASCII values of characters related to their key codes, if
            > at all? The site you suggested lists only 88 as the key code for 'X',
            > and does so for the wrong case.
            >
            > Thanks!
            >
            > -Jon
            >
            > --- In ydn-javascript@yahoogroups.com, "Josh" <joshlrogers@> wrote:
            > >
            > > Here is an excellent resource...
            > >
            >
            http://www.cambiaresearch.com/cambia3/snippets/javascript/reference/javascript_charcodes.aspx
            > >
            > > I would worry that the size of the js files would grow unjustly for
            > > this convenience...but who knows... :)
            > >
            > > Josh
            > >
            > > --- In ydn-javascript@yahoogroups.com, "randomjuju" <jon.chambers@>
            > > wrote:
            > > >
            > > > Hi there!
            > > >
            > > > It'd be really great if the YAHOO.util.KeyListener class came with a
            > > > list of keycodes. For example, YAHOO.util.KeyListener.KEY_ESC = 27.
            > > >
            > > > I'll file a real feature request
            > > > <https://sourceforge.net/tracker/?group_id=165715&atid=836479> ,
            but I
            > > > wanted to make sure this hasn't already been done first.
            > > >
            > > > Thanks very much!
            > > >
            > > > -Jon
            > > >
            > >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.