From ad726015e7bb5aaaf6d8f3b98fca2b21bf15c830 Mon Sep 17 00:00:00 2001 From: David Snopek Date: Tue, 23 May 2023 15:17:06 -0500 Subject: Revert the changes from PR #1044 and #1045 and standardize on `Object **` encoding in ptrcall --- test/src/example.cpp | 7 +++++++ test/src/example.h | 2 ++ 2 files changed, 9 insertions(+) (limited to 'test/src') diff --git a/test/src/example.cpp b/test/src/example.cpp index 6d24379..e605a45 100644 --- a/test/src/example.cpp +++ b/test/src/example.cpp @@ -348,3 +348,10 @@ bool Example::_has_point(const Vector2 &point) const { return false; } + +void Example::_input(const Ref &event) { + const InputEventKey *key_event = Object::cast_to(*event); + if (key_event) { + emit_custom_signal(String("_input: ") + key_event->get_key_label(), key_event->get_unicode()); + } +} diff --git a/test/src/example.h b/test/src/example.h index ebf9156..8c8b250 100644 --- a/test/src/example.h +++ b/test/src/example.h @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -129,6 +130,7 @@ public: // Virtual function override (no need to bind manually). virtual bool _has_point(const Vector2 &point) const override; + virtual void _input(const Ref &event) override; }; VARIANT_ENUM_CAST(Example::Constants); -- cgit v1.2.3