From 710a03c8031b8280d4d7ad9b91e141e2ab5a3705 Mon Sep 17 00:00:00 2001 From: Prashant Gupta Date: Thu, 7 Mar 2019 18:39:38 -0800 Subject: [PATCH] adding glide --- .gitignore | 1 + glide.lock | 54 +++++++++++++++++++++++++++++++++++++++++++++++ glide.yaml | 4 ++++ src/mouseMover.go | 16 ++++++++++++-- 4 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 glide.lock create mode 100644 glide.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a725465 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +vendor/ \ No newline at end of file diff --git a/glide.lock b/glide.lock new file mode 100644 index 0000000..559b9bd --- /dev/null +++ b/glide.lock @@ -0,0 +1,54 @@ +hash: 2f203324a3ca8f6d3a3e571dc0393f79835b0ea6194850ddc6b03e9355dfddcb +updated: 2019-03-07T18:33:39.501851-08:00 +imports: +- name: github.com/BurntSushi/xgb + version: 27f122750802c950b2c869a5b63dafcf590ced95 + subpackages: + - shape + - xinerama + - xproto +- name: github.com/BurntSushi/xgbutil + version: f7c97cef3b4e6c88280a5a7091c3314e815ca243 + subpackages: + - ewmh + - xevent + - xprop +- name: github.com/go-ole/go-ole + version: 97b6244175ae18ea6eef668034fd6565847501c9 + subpackages: + - oleutil +- name: github.com/go-vgo/robotgo + version: 7e017b4cb4d39e6af9cad664c075739fe9cc76fd + subpackages: + - clipboard +- name: github.com/lxn/win + version: e90c084872a829e2193ded9dbdb9a0180ddcfac0 +- name: github.com/otiai10/gosseract + version: ca64adaa320dc563d0966d58d3811512cb3362dc +- name: github.com/robotn/gohook + version: bbbbefb5ff8541a05870596ea081ad8581b5879f +- name: github.com/shirou/gopsutil + version: 27ec6a0789cefd42d1aa3ea7455b48fce7a401db + subpackages: + - cpu + - host + - internal/common + - mem + - net + - process +- name: github.com/shirou/w32 + version: bb4de0191aa41b5507caa14b0650cdbddcd9280b +- name: github.com/StackExchange/wmi + version: e0a55b97c70558c92ce14085e41b35a894e93d3d +- name: github.com/vcaesar/imgo + version: 13af122cf2fa6117048933e141c0b52f19116ca6 +- name: golang.org/x/image + version: 0694c2d4d067f97ebef574d63a763ee8ab559da7 + subpackages: + - bmp +- name: golang.org/x/sys + version: 1c9583448a9c3aa0f9a6a5241bf73c0bd8aafded + subpackages: + - unix + - windows +testImports: [] diff --git a/glide.yaml b/glide.yaml new file mode 100644 index 0000000..06e0d96 --- /dev/null +++ b/glide.yaml @@ -0,0 +1,4 @@ +package: . +import: +- package: github.com/go-vgo/robotgo + version: ~0.70.0 diff --git a/src/mouseMover.go b/src/mouseMover.go index d7f831f..103253e 100644 --- a/src/mouseMover.go +++ b/src/mouseMover.go @@ -41,7 +41,7 @@ func moveMouse(comm chan struct{}, quit chan struct{}) { movePixel *= -1 case <-comm: isIdle = false - fmt.Println("val received: ", isIdle) + //fmt.Println("val received: ", isIdle) case <-quit: return } @@ -72,7 +72,19 @@ func isMouseClicked(comm chan struct{}) { for { mleft := robotgo.AddEvent("mleft") if mleft == 0 { - //fmt.Println("mleft clicked") + fmt.Println("mleft clicked") + time.Sleep(100 * time.Millisecond) + comm <- struct{}{} + } + } + }() + + go func() { + for { + mright := robotgo.AddEvent("mright") + if mright == 0 { + fmt.Println("mright clicked") + time.Sleep(100 * time.Millisecond) comm <- struct{}{} } }