Commit ba120fc7 authored by ColinTree's avatar ColinTree Committed by Evan W. Patton

Type editor trying to show some special keys (#1007)

Fix #1006
parent 8a6191fb
...@@ -141,7 +141,6 @@ Blockly.TypeBlock.prototype.handleKey = function(e){ ...@@ -141,7 +141,6 @@ Blockly.TypeBlock.prototype.handleKey = function(e){
// Don't steal input from Blockly fields. // Don't steal input from Blockly fields.
if (e.target != this.ac_.getTarget() && if (e.target != this.ac_.getTarget() &&
(e.target.tagName == 'INPUT' || e.target.tagName == 'TEXTAREA')) return; (e.target.tagName == 'INPUT' || e.target.tagName == 'TEXTAREA')) return;
if (e.altKey || e.ctrlKey || e.metaKey || e.keyCode === 9) return; // 9 is tab
//We need to duplicate delete handling here from blockly.js //We need to duplicate delete handling here from blockly.js
if (e.keyCode === 8 || e.keyCode === 46) { if (e.keyCode === 8 || e.keyCode === 46) {
// Delete or backspace. // Delete or backspace.
...@@ -159,6 +158,33 @@ Blockly.TypeBlock.prototype.handleKey = function(e){ ...@@ -159,6 +158,33 @@ Blockly.TypeBlock.prototype.handleKey = function(e){
Blockly.mainWorkspace.hideChaff(); Blockly.mainWorkspace.hideChaff();
return; return;
} }
switch (e.keyCode) {
case 9: // Tab
case 16: // Enter
case 17: // Ctrl
case 18: // Alt
case 19: // Home
case 20: // Caps Lock
case 33: // PageUp
case 34: // PageDown
case 35: // Shift
case 36: // End
case 45: // Ins
case 91: // Meta
case 112: // F1
case 113: // F2
case 114: // F3
case 115: // F4
case 116: // F5
case 117: // F6
case 118: // F7
case 119: // F8
case 120: // F9
case 121: // F10
case 122: // F11
case 123: // F12
return;
}
if (goog.style.isElementShown(goog.dom.getElement(this.typeBlockDiv_))) { if (goog.style.isElementShown(goog.dom.getElement(this.typeBlockDiv_))) {
// Enter in the panel makes it select an option // Enter in the panel makes it select an option
if (e.keyCode === 13) { if (e.keyCode === 13) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment