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

Safari Keylistener - Arrow Key Issue

Expand Messages
  • berg.matt
    For some reason in Safari, when I am using the keylistener for the arrow key events, 38 and 40, the defined function is called twice in a row. This doesn t
    Message 1 of 2 , Dec 29, 2006
      For some reason in Safari, when I am using the keylistener for the
      arrow key events, 38 and 40, the defined function is called twice in a
      row. This doesn't happen with any of the other keys, nor does it
      happen on Mac Firefox. Any one have any ideas on why this is happening?

      Here is an example of the code I am using:

      var kl = new YAHOO.util.KeyListener(document, {
      keys:[38,40,46,67,68,69,78,81,87] }, { fn:keys_list }, "keyup" );
      kl.enable();

      function keys_list(type, args, obj) {
      if (key == "38" || key == "40") {
      row_move(row, key);
      }
      }

      The row_move function is called twice when just hitting up or down once.

      Thanks.

      Matt
    • berg.matt
      Man, no one else has experienced this issue?
      Message 2 of 2 , Jan 5, 2007
        Man, no one else has experienced this issue?

        --- In ydn-javascript@yahoogroups.com, "berg.matt" <berg.matt@...> wrote:
        >
        > For some reason in Safari, when I am using the keylistener for the
        > arrow key events, 38 and 40, the defined function is called twice in a
        > row. This doesn't happen with any of the other keys, nor does it
        > happen on Mac Firefox. Any one have any ideas on why this is happening?
        >
        > Here is an example of the code I am using:
        >
        > var kl = new YAHOO.util.KeyListener(document, {
        > keys:[38,40,46,67,68,69,78,81,87] }, { fn:keys_list }, "keyup" );
        > kl.enable();
        >
        > function keys_list(type, args, obj) {
        > if (key == "38" || key == "40") {
        > row_move(row, key);
        > }
        > }
        >
        > The row_move function is called twice when just hitting up or down once.
        >
        > Thanks.
        >
        > Matt
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.