From a2e387b44880fe539e04e9ed1301c220905c08ce Mon Sep 17 00:00:00 2001 From: vcaesar Date: Sat, 9 Apr 2022 10:33:02 -0700 Subject: [PATCH] Optimize keyboard code and Update examples --- README.md | 2 +- examples/key/main.go | 2 +- key.go | 2 +- key/goKey.h | 6 ------ key/keypress.h | 3 +++ key/keypress_c.h | 1 + 6 files changed, 7 insertions(+), 9 deletions(-) delete mode 100644 key/goKey.h diff --git a/README.md b/README.md index 19df754..2f11fc9 100644 --- a/README.md +++ b/README.md @@ -202,7 +202,7 @@ func main() { robotgo.TypeStr("だんしゃり", 0, 1) // robotgo.TypeStr("テストする") - robotgo.TypeStr("Hi, Seattle space needle, Gold gate bridge, One world trade center.") + robotgo.TypeStr("Hi, Seattle space needle, Golden gate bridge, One world trade center.") robotgo.TypeStr("Hi galaxy, hi stars, hi MT.Rainier, hi sea. こんにちは世界.") robotgo.Sleep(1) diff --git a/examples/key/main.go b/examples/key/main.go index db807f7..b2eb9e3 100644 --- a/examples/key/main.go +++ b/examples/key/main.go @@ -27,7 +27,7 @@ func typeStr() { robotgo.TypeStr("So, hi, bye! 你好, 再见!") robotgo.Sleep(1) - robotgo.TypeStr("Hi, Seattle space needle, Gold gate bridge, One world trade center.") + robotgo.TypeStr("Hi, Seattle space needle, Golden gate bridge, One world trade center.") robotgo.MilliSleep(100) ustr := uint32(robotgo.CharCodeAt("So, hi, bye!", 0)) diff --git a/key.go b/key.go index cef5bef..190270a 100644 --- a/key.go +++ b/key.go @@ -12,7 +12,7 @@ package robotgo /* // #include "key/keycode.h" -#include "key/goKey.h" +#include "key/keypress_c.h" */ import "C" diff --git a/key/goKey.h b/key/goKey.h deleted file mode 100644 index b377f6c..0000000 --- a/key/goKey.h +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright 2016 The go-vgo Project Developers. - -#include -#include "../base/types.h" -#include "keypress_c.h" -#include "keycode_c.h" diff --git a/key/keypress.h b/key/keypress.h index d461322..6e69c71 100644 --- a/key/keypress.h +++ b/key/keypress.h @@ -2,7 +2,10 @@ #ifndef KEYPRESS_H #define KEYPRESS_H +#include #include "../base/os.h" +#include "../base/types.h" + #include "keycode.h" #include diff --git a/key/keypress_c.h b/key/keypress_c.h index 64c1fd1..4d4959f 100644 --- a/key/keypress_c.h +++ b/key/keypress_c.h @@ -1,6 +1,7 @@ #include "keypress.h" #include "../base/deadbeef_rand_c.h" #include "../base/microsleep.h" +#include "keycode_c.h" #include /* For isupper() */ #if defined(IS_MACOSX)