Well, some hours later I found out that _input->parse_input_event()
takes a Ref<godot::InputEvent>
as argument, which is (if I'm not wrong) a Godot Reference to an Object. Anyway, if you declare it in the private
fields :
private:
InputEventAction *_up;
Ref<InputEvent> *_up_ref;
you can then define it eg in _ready()
:
_up = InputEventAction::_new();
_up_ref = Ref(_up);
and then modify _up
as you wish ; the reference, of course, will direct to the modified content. When you use it, no need to recast it, simply do
_input.parse_input_event(_up);
typically inside _process()
.
Comments to this answer very welcome !