Пример #1
0
//export keySnifferCallback
func keySnifferCallback(char C.char, flags C.XPLMKeyFlags, virtualKey C.char, ref unsafe.Pointer) C.int {
	id := (*C.char)(ref)
	data, _ := keySnifferCallbacks[id]
	return C.int(data.callback(xplm.KeyCode(char), xplm.KeyFlags(flags), xplm.VirtualKeyCode(virtualKey), data.ref))

}
Пример #2
0
//export windowHandleKey
func windowHandleKey(windowId C.XPLMWindowID, char C.char, flags C.XPLMKeyFlags, virtualKey C.char, ref unsafe.Pointer, losingFocus C.int) C.int {
	id := (*C.char)(ref)
	regInfo := windows[id]
	return C.int(regInfo.HandleKeyFunc(WindowID(windowId), xplm.KeyCode(char), xplm.KeyFlags(flags), xplm.VirtualKeyCode(virtualKey), regInfo.Ref, losingFocus == 1))
}