diff options
| author | Fabio Alessandrelli | 2018-02-23 12:17:15 +0100 |
|---|---|---|
| committer | Fabio Alessandrelli | 2018-02-23 13:01:28 +0100 |
| commit | 920d2bfdfa582b81b0e47d8a0a5de5817289c6dc (patch) | |
| tree | 97a850c3192afb9c51efb6194b7e5c08c000fd0c /scene/gui/scroll_bar.cpp | |
| parent | ff122a7e1fe4e061e564978450ee8bf442247a36 (diff) | |
| download | godot-920d2bfdfa582b81b0e47d8a0a5de5817289c6dc.tar.gz godot-920d2bfdfa582b81b0e47d8a0a5de5817289c6dc.tar.zst godot-920d2bfdfa582b81b0e47d8a0a5de5817289c6dc.zip | |
Diffstat (limited to 'scene/gui/scroll_bar.cpp')
| -rw-r--r-- | scene/gui/scroll_bar.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index 94e149c8a..e1cabd3f8 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -199,8 +199,6 @@ void ScrollBar::_gui_input(Ref<InputEvent> p_event) { } } - Ref<InputEventKey> k = p_event; - if (p_event->is_pressed()) { if (p_event->is_action("ui_left")) { @@ -228,20 +226,13 @@ void ScrollBar::_gui_input(Ref<InputEvent> p_event) { return; set_value(get_value() + (custom_step >= 0 ? custom_step : get_step())); - } else if (k.is_valid()) { - - switch (k->get_scancode()) { - case KEY_HOME: { + } else if (p_event->is_action("ui_home")) { - set_value(get_min()); + set_value(get_min()); - } break; - case KEY_END: { + } else if (p_event->is_action("ui_end")) { - set_value(get_max()); - - } break; - } + set_value(get_max()); } } } |
