mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-31 06:13: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)TISGetInputSourceProperty(currentKeyboard,
|
||||
kTISPropertyUnicodeKeyLayoutData);
|
||||
|
||||
if (layoutData == nil) { return 0; }
|
||||
|
||||
const UCKeyboardLayout *keyboardLayout =
|
||||
(const UCKeyboardLayout *)CFDataGetBytePtr(layoutData);
|
||||
|
||||
|
@ -16,6 +16,7 @@ func arobotgo() {
|
||||
Println("color@@@", color)
|
||||
|
||||
robotgo.TypeString("Hello World")
|
||||
// robotgo.KeyTap("a", "control")
|
||||
robotgo.KeyTap("f1", "control")
|
||||
// robotgo.KeyTap("enter")
|
||||
// robotgo.KeyToggle("enter", "down")
|
||||
|
Loading…
Reference in New Issue
Block a user