Compare commits
4
Commits
stable
...
656ecd911e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
656ecd911e | ||
|
|
8888407d28 | ||
|
|
a37de18e85 | ||
|
|
b55ff78230 |
+48
-23
@@ -2,22 +2,8 @@
|
|||||||
#SingleInstance Force
|
#SingleInstance Force
|
||||||
Persistent
|
Persistent
|
||||||
|
|
||||||
CorrectPassword := "Kaffeebohne"
|
FileInstall("akfe-on.ico", A_Temp "\akfe-on.ico")
|
||||||
|
FileInstall("akfe-off.ico", A_Temp "\akfe-off.ico")
|
||||||
result := InputBox(
|
|
||||||
"Bitte Passwort eingeben:",
|
|
||||||
"Authentifizierung",
|
|
||||||
"Password w200 h90"
|
|
||||||
)
|
|
||||||
|
|
||||||
if (result.Result != "OK") {
|
|
||||||
ExitApp()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result.Value != CorrectPassword) {
|
|
||||||
MsgBox("Falsches Passwort!", "Fehler", "Iconx")
|
|
||||||
ExitApp()
|
|
||||||
}
|
|
||||||
|
|
||||||
global IdleTime := 240 ; seconds
|
global IdleTime := 240 ; seconds
|
||||||
global Enabled := true
|
global Enabled := true
|
||||||
@@ -27,21 +13,38 @@ global LastMoveTime := A_TickCount
|
|||||||
|
|
||||||
MouseGetPos &LastX, &LastY
|
MouseGetPos &LastX, &LastY
|
||||||
|
|
||||||
; Create tray menu
|
|
||||||
|
;=========================================================
|
||||||
|
; Tray menu
|
||||||
|
;=========================================================
|
||||||
|
|
||||||
A_TrayMenu.Delete()
|
A_TrayMenu.Delete()
|
||||||
|
|
||||||
A_TrayMenu.Add("Enabled", ToggleEnabled)
|
A_TrayMenu.Add("Enabled", ToggleEnabled)
|
||||||
A_TrayMenu.Add()
|
|
||||||
A_TrayMenu.Add("Set idle time...", SetIdleTime)
|
A_TrayMenu.Add("Set idle time...", SetIdleTime)
|
||||||
A_TrayMenu.Add()
|
A_TrayMenu.Add()
|
||||||
A_TrayMenu.Add("Exit", (*) => ExitApp())
|
|
||||||
|
|
||||||
|
; Copypasta submenu
|
||||||
|
CopyMenu := Menu()
|
||||||
|
|
||||||
|
CopyMenu.Add("Standardpasswort", SetClipboard.Bind("BitteÄndern!"))
|
||||||
|
CopyMenu.Add("Password Ticket", SetClipboard.Bind("Auf Standardpasswort zurückgesetzt."))
|
||||||
|
CopyMenu.Add("Berechtigt", SetClipboard.Bind("Berechtigung erteilt."))
|
||||||
|
CopyMenu.Add("Erledigt", SetClipboard.Bind("Erledigt."))
|
||||||
|
|
||||||
|
A_TrayMenu.Add("Noodle", CopyMenu)
|
||||||
|
|
||||||
|
A_TrayMenu.Add()
|
||||||
|
A_TrayMenu.Add("Exit", (*) => ExitApp())
|
||||||
|
TraySetIcon(A_Temp "\akfe-on.ico")
|
||||||
UpdateTray()
|
UpdateTray()
|
||||||
|
|
||||||
; Check mouse every second
|
|
||||||
SetTimer(CheckMouse, 20000)
|
SetTimer(CheckMouse, 20000)
|
||||||
|
OnMessage(0x404, TrayIconHandler)
|
||||||
|
|
||||||
; ----------------------
|
;=========================================================
|
||||||
|
; Mouse mover
|
||||||
|
;=========================================================
|
||||||
|
|
||||||
CheckMouse() {
|
CheckMouse() {
|
||||||
global Enabled, IdleTime, LastX, LastY, LastMoveTime
|
global Enabled, IdleTime, LastX, LastY, LastMoveTime
|
||||||
@@ -66,6 +69,18 @@ CheckMouse() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TrayIconHandler(wParam, lParam, msg, hwnd)
|
||||||
|
{
|
||||||
|
; Double left click on tray icon
|
||||||
|
if (lParam = 0x203) {
|
||||||
|
ToggleEnabled()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
;=========================================================
|
||||||
|
; Tray functions
|
||||||
|
;=========================================================
|
||||||
|
|
||||||
ToggleEnabled(*) {
|
ToggleEnabled(*) {
|
||||||
global Enabled
|
global Enabled
|
||||||
|
|
||||||
@@ -87,10 +102,20 @@ UpdateTray() {
|
|||||||
global Enabled
|
global Enabled
|
||||||
|
|
||||||
if Enabled {
|
if Enabled {
|
||||||
|
TraySetIcon(A_Temp "\akfe-on.ico")
|
||||||
A_TrayMenu.Check("Enabled")
|
A_TrayMenu.Check("Enabled")
|
||||||
A_IconTip := "Mouse Mover - Active"
|
A_IconTip := "ArteKaffee - Active"
|
||||||
} else {
|
} else {
|
||||||
|
TraySetIcon(A_Temp "\akfe-off.ico")
|
||||||
A_TrayMenu.Uncheck("Enabled")
|
A_TrayMenu.Uncheck("Enabled")
|
||||||
A_IconTip := "Mouse Mover - Disabled"
|
A_IconTip := "ArteKaffee - Disabled"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
;=========================================================
|
||||||
|
; Clipboard
|
||||||
|
;=========================================================
|
||||||
|
|
||||||
|
SetClipboard(txt, *) {
|
||||||
|
A_Clipboard := txt
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 125 KiB |
Reference in New Issue
Block a user