From e9b57bb8745118c2bc5302081aff8772cf6c8fee Mon Sep 17 00:00:00 2001 From: alecpl Date: Thu, 12 Jun 2008 06:47:20 +0000 Subject: - #1484816: keypress (not keydown) for repeat --- program/js/list.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'program') diff --git a/program/js/list.js b/program/js/list.js index bdcf87932..a163f55ba 100644 --- a/program/js/list.js +++ b/program/js/list.js @@ -87,7 +87,7 @@ init: function() // set body events if (this.keyboard) - rcube_event.add_listener({element:document, event:'keydown', object:this, method:'key_press'}); + rcube_event.add_listener({element:document, event:'keypress', object:this, method:'key_press'}); } }, @@ -557,6 +557,8 @@ key_press: function(e) { case 40: case 38: + case 63233: // "down", in safari keypress + case 63232: // "up", in safari keypress return this.use_arrow_key(keyCode, mod_key); break; @@ -576,9 +578,11 @@ key_press: function(e) use_arrow_key: function(keyCode, mod_key) { var new_row; - if (keyCode == 40) // down arrow key pressed + // Safari uses the nonstandard keycodes 63232/63233 for up/down, if we're + // using the keypress event (but not the keydown or keyup event). + if (keyCode == 40 || keyCode == 63233) // down arrow key pressed new_row = this.get_next_row(); - else if (keyCode == 38) // up arrow key pressed + else if (keyCode == 38 || keyCode == 63232) // up arrow key pressed new_row = this.get_prev_row(); if (new_row) -- cgit v1.2.3