mirror of
https://github.com/Relintai/ui_extensions.git
synced 2024-11-12 10:25:27 +01:00
Fix build for 4.0.
This commit is contained in:
parent
38acc650db
commit
eb6be07648
@ -32,7 +32,14 @@ void BSInputEventKey::from_input_event_key(const Ref<InputEventKey> event) {
|
||||
set_command(event->get_command());
|
||||
|
||||
set_pressed(event->is_pressed());
|
||||
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
set_scancode(event->get_scancode());
|
||||
#else
|
||||
set_keycode(event->get_keycode());
|
||||
#endif
|
||||
|
||||
set_unicode(event->get_unicode());
|
||||
set_echo(event->is_echo());
|
||||
}
|
||||
@ -43,8 +50,13 @@ bool BSInputEventKey::action_match(const Ref<InputEvent> &p_event, bool *p_press
|
||||
if (key.is_null())
|
||||
return false;
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
uint32_t code = get_scancode_with_modifiers();
|
||||
uint32_t event_code = key->get_scancode_with_modifiers();
|
||||
#else
|
||||
uint32_t code = get_keycode_with_modifiers();
|
||||
uint32_t event_code = key->get_keycode_with_modifiers();
|
||||
#endif
|
||||
|
||||
bool match = code == event_code;
|
||||
if (match) {
|
||||
|
@ -23,7 +23,13 @@ SOFTWARE.
|
||||
#ifndef BS_INPUT_EVENT_KEY_H
|
||||
#define BS_INPUT_EVENT_KEY_H
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
#include "core/os/input_event.h"
|
||||
#else
|
||||
#include "core/input/input_event.h"
|
||||
#endif
|
||||
|
||||
class BSInputEventKey : public InputEventKey {
|
||||
GDCLASS(BSInputEventKey, InputEventKey);
|
||||
|
Loading…
Reference in New Issue
Block a user