예제 #1
0
func processEvents(cb Callbacks, queue *C.AInputQueue) {
	var event *C.AInputEvent
	for C.AInputQueue_getEvent(queue, &event) >= 0 {
		if C.AInputQueue_preDispatchEvent(queue, event) != 0 {
			continue
		}
		processEvent(cb, event)
		C.AInputQueue_finishEvent(queue, event, 0)
	}
}
예제 #2
0
파일: android.go 프로젝트: garry415/mobile
func processEvents(env *C.JNIEnv, queue *C.AInputQueue) {
	var event *C.AInputEvent
	for C.AInputQueue_getEvent(queue, &event) >= 0 {
		if C.AInputQueue_preDispatchEvent(queue, event) != 0 {
			continue
		}
		processEvent(env, event)
		C.AInputQueue_finishEvent(queue, event, 0)
	}
}
예제 #3
0
파일: android.go 프로젝트: 2722/lantern
func processEvents(env *C.JNIEnv, q *C.AInputQueue) {
	var e *C.AInputEvent
	for C.AInputQueue_getEvent(q, &e) >= 0 {
		if C.AInputQueue_preDispatchEvent(q, e) != 0 {
			continue
		}
		processEvent(env, e)
		C.AInputQueue_finishEvent(q, e, 0)
	}
}
예제 #4
0
파일: main.go 프로젝트: remogatto/goandroid
func (m *mainLoop) processInput(inputQueue *C.AInputQueue) {
	var event *C.AInputEvent
	for {
		if ret := C.AInputQueue_getEvent(inputQueue, &event); ret < 0 {
			break
		}
		if C.AInputQueue_preDispatchEvent(inputQueue, event) != 0 {
			continue
		}
		handled := m.dispatchEvent(event)
		var handledC C.int
		if handled {
			handledC = 1
		}
		C.AInputQueue_finishEvent(inputQueue, event, handledC)
	}
}