1 #include <android/input.h>
2 #include <msp/graphics/window_private.h>
4 #include "keys_private.h"
11 string Keyboard::get_button_name(unsigned btn) const
13 return Device::get_button_name(btn);
16 void Keyboard::input_event(const Graphics::Window::Event &event)
18 int type = AInputEvent_getType(event.aevent);
19 if(type!=AINPUT_EVENT_TYPE_KEY)
22 int action = AKeyEvent_getAction(event.aevent);
25 case AKEY_EVENT_ACTION_DOWN:
26 case AKEY_EVENT_ACTION_UP:
27 if(unsigned key = key_from_sys(AKeyEvent_getKeyCode(event.aevent)))
28 set_button_state(key, action==AKEY_EVENT_ACTION_DOWN, true);