Skip to content

Commit

Permalink
Merge pull request #490 from go-vgo/bitmap-pr
Browse files Browse the repository at this point in the history
Removed Windows VIRTUALScreen size and Update examples
  • Loading branch information
vcaesar authored Mar 21, 2022
2 parents 94c4b98 + 985c590 commit debc271
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.**

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
7 changes: 4 additions & 3 deletions examples/key/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
24 changes: 9 additions & 15 deletions screen/screen_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions examples/index.html → test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ <h1>Type and check the console</h1>
});
};

// move
window.onmousemove = function(events) {
console.log({
event: "move",
Expand Down

0 comments on commit debc271

Please sign in to comment.