Better fix for keyboard controls; does not disable all kind of keyboard events

release-0.6
thomascube 16 years ago
parent 26f5b0935e
commit 9e7a1b4167

@ -88,7 +88,7 @@ init: function()
// set body events
if (this.keyboard) {
rcube_event.add_listener({element:document, event:'keyup', object:this, method:'key_press'});
rcube_event.add_listener({element:document, event:'keydown', object:rcube_event, method:'cancel'});
rcube_event.add_listener({element:document, event:'keydown', object:this, method:'key_down'});
}
}
},
@ -573,6 +573,26 @@ key_press: function(e)
return true;
},
/**
* Handler for keydown events
*/
key_down: function(e)
{
switch (rcube_event.get_keycode(e))
{
case 40:
case 38:
case 63233:
case 63232:
if (!rcube_event.get_modifier(e) && this.focused)
return rcube_event.cancel(e);
default:
}
return true;
},
/**
* Special handling method for arrow keys

Loading…
Cancel
Save