mirror of
https://github.com/prashantgupta24/automatic-mouse-mover.git
synced 2024-12-23 08:54:10 +00:00
30 lines
490 B
Go
30 lines
490 B
Go
|
package mousemover
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
"sync"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
//MouseMover is the main struct for the app
|
||
|
type MouseMover struct {
|
||
|
quit chan struct{}
|
||
|
logFile *os.File
|
||
|
state *state
|
||
|
}
|
||
|
|
||
|
//state manages the internal working of the app
|
||
|
type state struct {
|
||
|
mutex sync.RWMutex
|
||
|
isAppRunning bool
|
||
|
isSysSleeping bool
|
||
|
lastMouseMovedTime time.Time
|
||
|
didNotMoveCount int
|
||
|
override *override
|
||
|
}
|
||
|
|
||
|
//only needed for tests
|
||
|
type override struct {
|
||
|
valueToReturn bool
|
||
|
}
|