Доработка. Теперь события ввода приходят только для активных элементов
This commit is contained in:
@@ -158,7 +158,7 @@ func _on_drag_begin(event) -> void:
|
||||
|
||||
|
||||
## Обработчик событий вввода. Вызывается godot
|
||||
func _input(event):
|
||||
func _on_gui_input(event):
|
||||
if event is InputEventMouseMotion:
|
||||
if drag_fsm == DragFSM.DRAG:
|
||||
emit_signal('drag_continue', event)
|
||||
|
||||
@@ -40,6 +40,7 @@ func get_node_scene(): return node_type_file
|
||||
func _assert_meta(i_col: int, i_row: int, pname: String, node): assert(node.has_meta(pname), 'ошибка: нет мета-свойства \"%s\" у ячейки колонка:%d ряд:%d' % [pname, i_col, i_row])
|
||||
func get_node_user_data(i_col: int, i_row: int): return get_node_meta(i_col, i_row, META_NAME_USER_DATA)
|
||||
func set_node_user_data(i_col: int, i_row: int, val) -> void: set_node_meta(i_col, i_row, META_NAME_USER_DATA, val)
|
||||
func _unhandled_key_input(event: InputEvent) -> void: _gui_input(event)
|
||||
|
||||
|
||||
## Закрепляет заголовок таблицы. [param scrl] - Прокрутка,
|
||||
@@ -182,9 +183,9 @@ func set_columns_aligment(alignments: Array) -> void:
|
||||
|
||||
|
||||
##
|
||||
func _input(event) -> void:
|
||||
func _gui_input(event) -> void:
|
||||
if event is InputEventKey:
|
||||
if in_focus and event.pressed:
|
||||
if not event.pressed:
|
||||
if event.keycode == selector_key_up:
|
||||
selector_up()
|
||||
elif event.keycode == selector_key_down:
|
||||
|
||||
Reference in New Issue
Block a user