File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
addons/block_code/ui/picker/categories Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -691,6 +691,16 @@ static func get_built_in_blocks(_class_name: String) -> Array[Block]:
691
691
static func _get_input_blocks () -> Array [Block ]:
692
692
var block_list : Array [Block ]
693
693
694
+ var editor_input_actions : Dictionary = {}
695
+ var editor_input_action_deadzones : Dictionary = {}
696
+ if Engine .is_editor_hint ():
697
+ var actions := InputMap .get_actions ()
698
+ for action in actions :
699
+ if action .begins_with ("spatial_editor" ):
700
+ var events := InputMap .action_get_events (action )
701
+ editor_input_actions [action ] = events
702
+ editor_input_action_deadzones [action ] = InputMap .action_get_deadzone (action )
703
+
694
704
InputMap .load_from_project_settings ()
695
705
696
706
var block : Block = BLOCKS ["parameter_block" ].instantiate ()
@@ -701,4 +711,10 @@ static func _get_input_blocks() -> Array[Block]:
701
711
block .category = "Input"
702
712
block_list .append (block )
703
713
714
+ if Engine .is_editor_hint ():
715
+ for action in editor_input_actions .keys ():
716
+ InputMap .add_action (action , editor_input_action_deadzones [action ])
717
+ for event in editor_input_actions [action ]:
718
+ InputMap .action_add_event (action , event )
719
+
704
720
return block_list
You can’t perform that action at this time.
0 commit comments