diff --git a/dev/js/src/hint.js b/dev/js/src/hint.js
index 6aed544..885e1ea 100644
--- a/dev/js/src/hint.js
+++ b/dev/js/src/hint.js
@@ -1,5 +1,6 @@
 /**
  * Hint menu for Kalamar.
+ * Based on menu object.
  *
  * @author Nils Diewald
  */
@@ -76,7 +77,7 @@
 
       // Add event listener for key pressed down
       inputFieldElement.addEventListener(
-	"keypress", function (e) {
+	"keydown", function (e) {
 	  var code = _codeFromEvent(e);
 	  if (code === 40) {
 	    that.show(false);
@@ -85,13 +86,20 @@
 	}, false
       );
 
-      // Move infobox 
-      inputFieldElement.addEventListener(
-	"keyup", function (e) {
-	  var input = that._inputField;
-	  input.update();
-	}
-      );
+      this._inputField.container().addEventListener('click', function (e) {
+	if (!this.classList.contains('active')) {
+	  that.show(false);
+	};
+      });
+
+      var _up = function (e) {
+	var input = that._inputField;
+	input.update();
+      };
+
+      // Move infobox
+      inputFieldElement.addEventListener("keyup", _up);
+      inputFieldElement.addEventListener("click", _up);
 
       // Set Analyzer for context
       this._analyzer = analyzerClass.create(
@@ -105,25 +113,6 @@
     },
 
     /**
-     * A new update by keypress
-     */
-    /*
-updateKeyPress : function (e) {
-      if (!this._active)
-	return;
-
-      var character = String.fromCharCode(_codeFromEvent(e));
-
-      e.halt(); // No event propagation
-
-      // Only relevant for key down
-      console.log("TODO: filter view");
-    },
-    */
-
-    // updateKeyDown : function (e) {},
-
-    /**
      * Return hint menu and probably init based on an action
      */
     menu : function (action) {
@@ -187,13 +176,6 @@
 	c.appendChild(menu.element());
 	menu.show('');
 	menu.focus();
-// Update bounding box
-/*
-      }
-      else if (!ifContext) {
-	//	this.hide();
-      };
-*/
       // Focus on input field
       // this.inputField.element.focus();
       };
diff --git a/dev/js/src/hint/item.js b/dev/js/src/hint/item.js
index f23cabc..4b879f8 100644
--- a/dev/js/src/hint/item.js
+++ b/dev/js/src/hint/item.js
@@ -8,6 +8,7 @@
 	.upgradeTo(this)
 	._init(params);
     },
+
     _init : function (params) {
       if (params[0] === undefined ||
 	  params[1] === undefined)
@@ -32,7 +33,7 @@
       return this._content;
     },
     
-    onclick : function () {
+    onclick : function (e) {
       var m = this.menu();
       var h = m.hint();
       m.hide();
@@ -43,8 +44,12 @@
       input.update();
 
       h.active = false;
+
+      e.halt();
+
       h.show(true);
     },
+
     name : function () {
       return this._name;
     },
diff --git a/dev/js/src/menu.js b/dev/js/src/menu.js
index 0d5e6ac..2bc356b 100644
--- a/dev/js/src/menu.js
+++ b/dev/js/src/menu.js
@@ -75,7 +75,7 @@
     },
 
     // Arrow key and prefix treatment
-    _keypress : function (e) {
+    _keydown : function (e) {
       var code = _codeFromEvent(e);
 
       switch (code) {
@@ -126,17 +126,19 @@
 	this.show();
 	e.halt();
 	break;
-      default:
-	if (e.key !== undefined &&
-	    e.key.length != 1)
-	  return;
+      };
+    },
 
-	// Add prefix
-	this._prefix.add(e.key.toLowerCase());
+    // Add characters to prefix
+    _keypress : function (e) {
+      var c = String.fromCharCode(_codeFromEvent(e)).toLowerCase();
 
-	if (!this.show()) {
-	  this.prefix('').show();
-	};
+      // Add prefix
+      this._prefix.add(c);
+
+      if (!this.show()) {
+	this.prefix('').show();
+	e.halt();
       };
     },
 
@@ -165,6 +167,15 @@
 
       // Arrow keys
       e.addEventListener(
+	'keydown',
+	function (ev) {
+	  that._keydown(ev)
+	},
+	false
+      );
+
+      // Strings
+      e.addEventListener(
 	'keypress',
 	function (ev) {
 	  that._keypress(ev)
