Removed Windows VIRTUALScreen size and Update examples

This commit is contained in:
vcaesar 2022-03-21 10:05:02 -07:00
parent 895aed8f22
commit 985c590284
5 changed files with 17 additions and 20 deletions

View File

@ -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.**

View File

@ -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))

View File

@ -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))

View File

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

View File

@ -27,6 +27,7 @@
});
};
// move
window.onmousemove = function(events) {
console.log({
event: "move",