From a23c0e42afdedf5bbaad9cdd789f18d8fd2af431 Mon Sep 17 00:00:00 2001 From: thomasb Date: Wed, 28 Mar 2007 10:39:38 +0000 Subject: Abstract event keycode detection git-svn-id: https://svn.roundcube.net/trunk@527 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/js/common.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'roundcubemail/program/js/common.js') diff --git a/roundcubemail/program/js/common.js b/roundcubemail/program/js/common.js index 82d7ed17c..be9a131c2 100644 --- a/roundcubemail/program/js/common.js +++ b/roundcubemail/program/js/common.js @@ -103,6 +103,15 @@ function roundcube_browser() // static functions for event handling var rcube_event = { + /** + * returns the event key code + */ + get_keycode: function(e) + { + e = e || window.event; + return e && e.keyCode ? e.keyCode : (e && e.which ? e.which : 0); + }, + /** * returns modifier key (constants defined at top of file) */ -- cgit v1.2.3