summaryrefslogtreecommitdiff
path: root/program/js/common.js
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2007-03-28 10:39:38 +0000
committerthomascube <thomas@roundcube.net>2007-03-28 10:39:38 +0000
commit9bbb17c1c6b45616825e606044272fe080787441 (patch)
treec0cd75b420f5908fde76cd0fd087b7c157450ab9 /program/js/common.js
parentb566ffd2276bf469fd0e850dade0da18a4f0835b (diff)
Abstract event keycode detection
Diffstat (limited to 'program/js/common.js')
-rw-r--r--program/js/common.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/program/js/common.js b/program/js/common.js
index 82d7ed17c..be9a131c2 100644
--- a/program/js/common.js
+++ b/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)
*/