mirror of
https://github.com/prashantgupta24/automatic-mouse-mover.git
synced 2024-12-22 00:14:11 +00:00
incorporating new activity tracker changes
This commit is contained in:
parent
de4a8882d9
commit
e69e37282a
@ -31,7 +31,7 @@ func onReady() {
|
||||
//notify.SendMessage("starting the app")
|
||||
|
||||
case <-ammStop.ClickedCh:
|
||||
fmt.Println("pausing the app")
|
||||
fmt.Println("stopping the app")
|
||||
mouseMover.Quit()
|
||||
|
||||
case <-mQuit.ClickedCh:
|
||||
|
21
glide.lock
generated
21
glide.lock
generated
@ -1,5 +1,5 @@
|
||||
hash: 0e9d554853b2c3ed23ba323715540d961c06465a1a125959a698d6162e17f91d
|
||||
updated: 2019-03-20T12:29:04.478748-07:00
|
||||
updated: 2019-03-22T15:34:56.64781-07:00
|
||||
imports:
|
||||
- name: github.com/BurntSushi/xgb
|
||||
version: 27f122750802c950b2c869a5b63dafcf590ced95
|
||||
@ -41,6 +41,8 @@ imports:
|
||||
version: 193b4935d4b146c729d763c2c59a0d3e7f3cee8a
|
||||
subpackages:
|
||||
- clipboard
|
||||
- name: github.com/konsorten/go-windows-terminal-sequences
|
||||
version: f55edac94c9bbba5d6182a4be46d86a2c9b5b50e
|
||||
- name: github.com/lxn/win
|
||||
version: 0040366d745006bbf7528ac96de2de375846aa79
|
||||
- name: github.com/otiai10/gosseract
|
||||
@ -48,8 +50,13 @@ imports:
|
||||
- name: github.com/oxtoacart/bpool
|
||||
version: 8c4636f812cc8920c26e2002b988c878b1fd6f5e
|
||||
- name: github.com/prashantgupta24/activity-tracker
|
||||
version: 7330e5e8a948db11beb7aef23996d37ef26977f4
|
||||
version: d60ddb4a3211e471b1a3fcd9b5dec960a453c79c
|
||||
subpackages:
|
||||
- internal/pkg/logging
|
||||
- internal/pkg/mouse
|
||||
- internal/pkg/service
|
||||
- pkg/activity
|
||||
- pkg/tracker
|
||||
- src/activity
|
||||
- src/mouse
|
||||
- name: github.com/robotn/gohook
|
||||
@ -65,16 +72,22 @@ imports:
|
||||
- process
|
||||
- name: github.com/shirou/w32
|
||||
version: bb4de0191aa41b5507caa14b0650cdbddcd9280b
|
||||
- name: github.com/sirupsen/logrus
|
||||
version: dae0fa8d5b0c810a8ab733fbd5510c7cae84eca4
|
||||
- name: github.com/StackExchange/wmi
|
||||
version: e0a55b97c70558c92ce14085e41b35a894e93d3d
|
||||
- name: github.com/vcaesar/imgo
|
||||
version: 13af122cf2fa6117048933e141c0b52f19116ca6
|
||||
- name: golang.org/x/crypto
|
||||
version: b7391e95e576cacdcdd422573063bc057239113d
|
||||
subpackages:
|
||||
- ssh/terminal
|
||||
- name: golang.org/x/image
|
||||
version: 0694c2d4d067f97ebef574d63a763ee8ab559da7
|
||||
version: 3fc05d484e9f77dd51816890e05f2602e4ca4d65
|
||||
subpackages:
|
||||
- bmp
|
||||
- name: golang.org/x/sys
|
||||
version: 6c81ef8f67ca3f42fc9cd71dfbd5f35b0c4b5771
|
||||
version: f49334f85ddcf0f08d7fb6dd7363e9e6d6b777eb
|
||||
subpackages:
|
||||
- unix
|
||||
- windows
|
||||
|
@ -26,6 +26,7 @@ func (m *mouseMover) Start() {
|
||||
frequency := 5 //value always in seconds
|
||||
activityTracker := &tracker.Instance{
|
||||
Frequency: frequency,
|
||||
//LogLevel: "debug", //if we want verbose logging
|
||||
}
|
||||
|
||||
heartbeatCh := activityTracker.Start()
|
||||
@ -42,7 +43,7 @@ func (m *mouseMover) Start() {
|
||||
select {
|
||||
case wasMouseMoveSuccess := <-commCh:
|
||||
if wasMouseMoveSuccess {
|
||||
fmt.Println("moving mouse at : \n", time.Now())
|
||||
fmt.Printf("\nmoving mouse at : %v\n\n", time.Now())
|
||||
movePixel *= -1
|
||||
}
|
||||
case <-time.After(timeout * time.Millisecond):
|
||||
@ -71,7 +72,7 @@ func moveMouse(movePixel int, commCh chan bool) {
|
||||
|
||||
func (m *mouseMover) Quit() {
|
||||
//making it idempotent
|
||||
if !m.isRunning {
|
||||
if m != nil && m.isRunning {
|
||||
m.quit <- struct{}{}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user