From 985c5902849f23422d4ae477b2312ab72370e879 Mon Sep 17 00:00:00 2001 From: vcaesar Date: Mon, 21 Mar 2022 10:05:02 -0700 Subject: [PATCH] Removed Windows VIRTUALScreen size and Update examples --- .github/pull_request_template.md | 2 +- README.md | 3 ++- examples/key/main.go | 7 ++++--- screen/screen_c.h | 24 +++++++++--------------- {examples => test}/index.html | 1 + 5 files changed, 17 insertions(+), 20 deletions(-) rename {examples => test}/index.html (98%) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index c331d4f..cd8ee71 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -5,7 +5,7 @@ The pull request will be closed without any reasons if it does not satisfy any o 3. Please read contributing guidelines: [CONTRIBUTING](https://github.com/go-vgo/robotgo/blob/master/CONTRIBUTING.md) 4. Describe what your pull request does and which issue you're targeting (if any and **Please use English**) 5. ... if it is not related to any particular issues, explain why we should not reject your pull request. -6. The Commits must use English, must be test and No useless submissions. +6. The Commits must **use English**, must be test and No useless submissions. **You MUST delete the content above including this line before posting, otherwise your pull request will be invalid.** diff --git a/README.md b/README.md index 1126aba..19df754 100644 --- a/README.md +++ b/README.md @@ -202,7 +202,8 @@ func main() { robotgo.TypeStr("だんしゃり", 0, 1) // robotgo.TypeStr("テストする") - robotgo.TypeStr("Hi galaxy. こんにちは世界.") + robotgo.TypeStr("Hi, Seattle space needle, Gold gate bridge, One world trade center.") + robotgo.TypeStr("Hi galaxy, hi stars, hi MT.Rainier, hi sea. こんにちは世界.") robotgo.Sleep(1) // ustr := uint32(robotgo.CharCodeAt("Test", 0)) diff --git a/examples/key/main.go b/examples/key/main.go index ec90626..db807f7 100644 --- a/examples/key/main.go +++ b/examples/key/main.go @@ -18,15 +18,16 @@ import ( ) func typeStr() { - // importing "Hello World" + // typing "Hello World" robotgo.TypeStr("Hello World!", 0, 1) robotgo.KeySleep = 100 robotgo.TypeStr("だんしゃり") - robotgo.TypeStr("Hi galaxy. こんにちは世界. 你好, 再见!") + robotgo.TypeStr("Hi galaxy, hi stars, hi MT.Rainier, hi sea. こんにちは世界.") + robotgo.TypeStr("So, hi, bye! 你好, 再见!") robotgo.Sleep(1) - robotgo.TypeStr("So, hi, bye!") + robotgo.TypeStr("Hi, Seattle space needle, Gold gate bridge, One world trade center.") robotgo.MilliSleep(100) ustr := uint32(robotgo.CharCodeAt("So, hi, bye!", 0)) diff --git a/screen/screen_c.h b/screen/screen_c.h index 8c353cd..bc7fba5 100644 --- a/screen/screen_c.h +++ b/screen/screen_c.h @@ -22,15 +22,9 @@ MMSizeInt32 getMainDisplaySize(void) { (int32_t)DisplayWidth(display, screen), (int32_t)DisplayHeight(display, screen)); #elif defined(IS_WINDOWS) - if (GetSystemMetrics(SM_CMONITORS) == 1) { - return MMSizeInt32Make( + return MMSizeInt32Make( (int32_t)GetSystemMetrics(SM_CXSCREEN), (int32_t)GetSystemMetrics(SM_CYSCREEN)); - } else { - return MMSizeInt32Make( - (int32_t)GetSystemMetrics(SM_CXVIRTUALSCREEN), - (int32_t)GetSystemMetrics(SM_CYVIRTUALSCREEN)); - } #endif } @@ -56,19 +50,19 @@ MMRectInt32 getScreenRect(int32_t display_id) { (int32_t)DisplayWidth(display, screen), (int32_t)DisplayHeight(display, screen)); #elif defined(IS_WINDOWS) - if (GetSystemMetrics(SM_CMONITORS) == 1) { + // if (GetSystemMetrics(SM_CMONITORS) == 1) { return MMRectInt32Make( (int32_t)0, (int32_t)0, (int32_t)GetSystemMetrics(SM_CXSCREEN), (int32_t)GetSystemMetrics(SM_CYSCREEN)); - } else { - return MMRectInt32Make( - (int32_t)GetSystemMetrics(SM_XVIRTUALSCREEN), - (int32_t)GetSystemMetrics(SM_YVIRTUALSCREEN), - (int32_t)GetSystemMetrics(SM_CXVIRTUALSCREEN), - (int32_t)GetSystemMetrics(SM_CYVIRTUALSCREEN)); - } + // } else { + // return MMRectInt32Make( + // (int32_t)GetSystemMetrics(SM_XVIRTUALSCREEN), + // (int32_t)GetSystemMetrics(SM_YVIRTUALSCREEN), + // (int32_t)GetSystemMetrics(SM_CXVIRTUALSCREEN), + // (int32_t)GetSystemMetrics(SM_CYVIRTUALSCREEN)); + // } #endif } diff --git a/examples/index.html b/test/index.html similarity index 98% rename from examples/index.html rename to test/index.html index c78a17c..e18582c 100644 --- a/examples/index.html +++ b/test/index.html @@ -27,6 +27,7 @@ }); }; + // move window.onmousemove = function(events) { console.log({ event: "move",