You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use the c++ interface. However, when I try to evaluate a pressed key event, I did not get access to key codes.
The reason is that the Event class is not providing any functionality other than access to the type. I cannot even use the standard c functions as the caca_event_t data structure is protected.
Moreover, the Event class provides a public type attribute. I expected that this attribute will hold the event type. However, it is not updated by the getEvent function.
is there something that I missed or is this simply missing functionality
A solution would be to enhance the Event class by getter functions. Even that I do not use mouse functionality (yet), these getters would also be needed for the mouse access functions.
Regards
Sebastian
testcode:
Event event;
dp.getEvent(Event::CACA_EVENT_KEY_PRESS, &event, 0);
if (event.type & CACA_EVENT_KEY_PRESS) // this is not working as the type field is not updated
{
auto key event.getKeyCH(); // what I would expect
auto key = caca_get_event_key_ch(&event.e); // not working either
}
solution sketch for type and key_ch
class myEvent : public Event
{
public:
int getKeyCH() { return caca_get_event_key_ch(&this->e); }
::caca_event_type getType() { return caca_get_event_type(&this->e); }
};
The text was updated successfully, but these errors were encountered:
sebastianohl
changed the title
caca_get_event_key_ch not accessable by c++ interface
caca_get_even(key|mouse)_* not accessable by c++ interface
Dec 22, 2021
Hi,
I am trying to use the c++ interface. However, when I try to evaluate a pressed key event, I did not get access to key codes.
The reason is that the Event class is not providing any functionality other than access to the type. I cannot even use the standard c functions as the caca_event_t data structure is protected.
Moreover, the Event class provides a public type attribute. I expected that this attribute will hold the event type. However, it is not updated by the getEvent function.
is there something that I missed or is this simply missing functionality
A solution would be to enhance the Event class by getter functions. Even that I do not use mouse functionality (yet), these getters would also be needed for the mouse access functions.
Regards
Sebastian
testcode:
solution sketch for type and key_ch
The text was updated successfully, but these errors were encountered: