Browse Source

ShaderEditor: add menu without shift key

Tom SPIRA 6 years ago
parent
commit
332dd82396
2 changed files with 7 additions and 4 deletions
  1. 4 4
      hide/view/shadereditor/ShaderEditor.hx
  2. 3 0
      hrt/shgraph/nodes/FloatConst.hx

+ 4 - 4
hide/view/shadereditor/ShaderEditor.hx

@@ -135,14 +135,14 @@ class ShaderEditor extends hide.view.Graph {
 		});
 
 		element.on("keydown", function(e) {
-			if (e.shiftKey && e.keyCode != 16) {
+			if (e.ctrlKey && e.keyCode == 83) {
+				save();
+				return;
+			} else if (e.keyCode != 16) {
 				if (addMenu == null || !addMenu.is(":visible"))
 					openAddMenu();
 
 				return;
-			} else if (e.ctrlKey && e.keyCode == 83) {
-				save();
-				return;
 			}
 		});
 

+ 3 - 0
hrt/shgraph/nodes/FloatConst.hx

@@ -37,6 +37,9 @@ class FloatConst extends ShaderConst {
 		element.append(new hide.Element('<input type="text" id="value" style="width: ${width*0.5}px" value="${value}" />'));
 
 		var input = element.children("input");
+		input.on("keydown", function(e) {
+			e.stopPropagation();
+		});
 		input.on("change", function(e) {
 			var tmpValue = Std.parseFloat(input.val());
 			if (Math.isNaN(tmpValue) ) {