mirror of
https://github.com/go-vgo/robotgo
synced 2026-05-23 09:48:59 +00:00
fix input method cause null pointer
This commit is contained in:
parent
aad4a55edb
commit
78729d4c2f
2 changed files with 3 additions and 0 deletions
|
|
@ -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 a new issue