Example #1
0
func XPLMUnregisterHotKey(hotkeyId HotKeyID) {
	for key, regInfo := range hotkeys {
		if regInfo.id == hotkeyId {
			C.free(unsafe.Pointer(key))
			delete(hotkeys, key)
		}
	}
	C.XPLMUnregisterHotKey(C.XPLMHotKeyID(hotkeyId))
}
Example #2
0
func GetHotKeyInfo(hotkeyId HotKeyID) (virtualKey xplm.VirtualKeyCode, flags xplm.KeyFlags, description string, pluginId plugins.PluginId) {
	descBuf := (*C.char)(C.malloc(255))
	defer C.free(unsafe.Pointer(descBuf))
	C.XPLMGetHotKeyInfo(
		C.XPLMHotKeyID(hotkeyId),
		(*C.char)(unsafe.Pointer(&virtualKey)),
		(*C.XPLMKeyFlags)(unsafe.Pointer(&flags)),
		descBuf,
		(*C.XPLMPluginID)(unsafe.Pointer(&pluginId)))
	description = C.GoString(descBuf)
	return
}
Example #3
0
func SetHotKeyCombination(hotkeyId HotKeyID, virtualKey xplm.VirtualKeyCode, flags xplm.KeyFlags) {
	C.XPLMSetHotKeyCombination(C.XPLMHotKeyID(hotkeyId), C.char(virtualKey), C.XPLMKeyFlags(flags))
}