From a19dff444c77780f4decf2b2ea61866eb5057e16 Mon Sep 17 00:00:00 2001 From: Kelven Yang Date: Tue, 14 Feb 2012 16:01:20 -0800 Subject: [PATCH] bug 13637: don't send ENTER/BACKSPACE in javascript KEY-PRESS event. Reviewed-By: Anthony --- console-proxy/js/ajaxviewer.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/console-proxy/js/ajaxviewer.js b/console-proxy/js/ajaxviewer.js index 14c80fde5c1..3c49f9a701d 100644 --- a/console-proxy/js/ajaxviewer.js +++ b/console-proxy/js/ajaxviewer.js @@ -323,6 +323,10 @@ JsCookedKeyboardMapper.prototype.inputFeed = function(eventType, code, modifiers this.mappedInput.push({type : AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_SHIFT, modifiers: modifiers}); return; } + + // ENTER/BACKSPACE key should already have been sent through KEY DOWN/KEY UP event + if(code == AjaxViewer.JS_KEY_ENTER || code == AjaxViewer.JS_KEY_BACKSPACE) + return; this.mappedInput.push({type : AjaxViewer.KEY_DOWN, code: X11Keysym, modifiers: modifiers}); this.mappedInput.push({type : AjaxViewer.KEY_UP, code: X11Keysym, modifiers: modifiers});