INNER CODE UNIT · C

IN_Android_OnInputEvent

Qfusion/qfusion · source/android/android_input.c:115

static int32_t IN_Android_OnInputEvent( struct android_app *app, AInputEvent *event ) {
	int32_t type = AInputEvent_getType( event );
	int64_t time;

	if( type == AINPUT_EVENT_TYPE_KEY ) {
		int32_t keycode = AKeyEvent_getKeyCode( event );
		int key;

		if( keycode >= ( sizeof( s_android_scantokey ) / sizeof( s_android_scantokey[0] ) ) ) {
			return 0;
		}

		if( ( keycode >= AKEYCODE_DPAD_UP ) && ( keycode <= AKEYCODE_DPAD_RIGHT ) &&
			( AInputEvent_getSource( event ) == AINPUT_SOURCE_KEYBOARD ) ) {
			key = keycode + ( K_UPARROW - AKEYCODE_DPAD_UP );
		} else {
			key = s_android_scantokey[keycode];
		}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…