mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-03 07:33:55 +00:00
fix input method cause null pointer
This commit is contained in:
parent
aad4a55edb
commit
78729d4c2f
@ -138,7 +138,9 @@ CFStringRef createStringForKey(CGKeyCode keyCode)
|
|||||||
CFDataRef layoutData =
|
CFDataRef layoutData =
|
||||||
(CFDataRef)TISGetInputSourceProperty(currentKeyboard,
|
(CFDataRef)TISGetInputSourceProperty(currentKeyboard,
|
||||||
kTISPropertyUnicodeKeyLayoutData);
|
kTISPropertyUnicodeKeyLayoutData);
|
||||||
|
|
||||||
if (layoutData == nil) { return 0; }
|
if (layoutData == nil) { return 0; }
|
||||||
|
|
||||||
const UCKeyboardLayout *keyboardLayout =
|
const UCKeyboardLayout *keyboardLayout =
|
||||||
(const UCKeyboardLayout *)CFDataGetBytePtr(layoutData);
|
(const UCKeyboardLayout *)CFDataGetBytePtr(layoutData);
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ func arobotgo() {
|
|||||||
Println("color@@@", color)
|
Println("color@@@", color)
|
||||||
|
|
||||||
robotgo.TypeString("Hello World")
|
robotgo.TypeString("Hello World")
|
||||||
|
// robotgo.KeyTap("a", "control")
|
||||||
robotgo.KeyTap("f1", "control")
|
robotgo.KeyTap("f1", "control")
|
||||||
// robotgo.KeyTap("enter")
|
// robotgo.KeyTap("enter")
|
||||||
// robotgo.KeyToggle("enter", "down")
|
// robotgo.KeyToggle("enter", "down")
|
||||||
|
Loading…
Reference in New Issue
Block a user