That method is part of Node.
I recommend that you look at the Node class where you have the input (), _ready () _process () among others.
_input
void _input(godot::Ref<godot::InputEvent> event);
unhandledinput
void _unhandled_input(const Ref<InputEvent> event);
unhandledkey_input
void _unhandled_key_input(const Ref<InputEventKey> event);
.................................................................
.................................................................
.................................................................
To define it _input.
void YouClassName::_input(godot::Ref<godot::InputEvent> event)
{
}
And don't forget to register the method, otherwise it won't work.
void YouClassName::_register_methods()
{
register_method("_input",&YouClassName::_input);
}
.................................................................
.................................................................
.................................................................
An important issue, if you want to use the input event, you have to import the input.hpp library and implement it as follows.
#include "Input.hpp"
void YouClassName::_input(godot::Ref<godot::InputEvent> event)
{
Input* _input = Input::get_singleton();
if(_input == nullptr) return;
if(_input->is_action_pressed("a"))
{
}
if(_input->is_action_pressed("d"))
{
}
if(_input->is_action_just_released("a") || _input->is_action_just_released("d"))
{
}
}