summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
Diffstat (limited to 'windows')
-rw-r--r--windows/neo-vars/src/source/initialize.ahk28
-rw-r--r--windows/neo-vars/src/source/tray.ahk7
2 files changed, 25 insertions, 10 deletions
diff --git a/windows/neo-vars/src/source/initialize.ahk b/windows/neo-vars/src/source/initialize.ahk
index ee01fac..a9fec08 100644
--- a/windows/neo-vars/src/source/initialize.ahk
+++ b/windows/neo-vars/src/source/initialize.ahk
@@ -34,11 +34,9 @@ disable=Deaktiviere %name%
#LTrim ; Quelltext kann eingerückt werden
SetCapsLockState Off
-SaveNumLockState()
-SetNumLockState On
-OnExit, exitprogram
SetScrollLockState Off
-KeyboardLED(2,"off") ; deaktivieren, falls sie doch brennt
+SetNEONumLockState()
+OnExit, exitprogram
EnvGet, WindowsEnvAppDataFolder, APPDATA
if (WindowsEnvAppDataFolder == "") {
@@ -96,9 +94,27 @@ EbeneAktualisieren := "NEOEbeneAktualisieren"
SaveNumLockState() {
global
if GetKeyState("NumLock","T")
- SavedNumLockState = On
+ SavedNumLockState:="On"
+ else
+ SavedNumLockState:="Off"
+}
+
+SetNEONumLockState() {
+ global
+ SaveNumLockState()
+ if (SavedNumLockState == "Off") {
+ SetNumLockState, On
+ Sleep, 1 ; damit sich das Aktivieren von NumLock nicht mit dem Deaktivieren der LED prügeln muss
+ }
+ KeyboardLED(2,"off") ; deaktivieren, falls sie doch brennt
+}
+
+SetOldNumLockState() {
+ global
+ if (SavedNumLockState == "On")
+ KeyboardLED(2,"on")
else
- SavedNumLockState = Off
+ SetNumLockState, Off
}
%EbeneAktualisieren%()
diff --git a/windows/neo-vars/src/source/tray.ahk b/windows/neo-vars/src/source/tray.ahk
index b58c54d..ffef082 100644
--- a/windows/neo-vars/src/source/tray.ahk
+++ b/windows/neo-vars/src/source/tray.ahk
@@ -59,7 +59,7 @@ hide:
return
exitprogram:
- SetNumLockState, %SavedNumLockState%
+ SetOldNumLockState()
exitapp
return
@@ -71,14 +71,13 @@ Traytogglesuspend() {
menu, tray, rename, %enable%, %disable%
menu, tray, tip, %name%
menu, tray, icon, %ResourceFolder%\neo_enabled.ico,,1
- SaveNumLockState()
- SetNumLockState On
+ SetNEONumLockState()
suspend, off ; Schaltet Suspend aus -> NEO
} else {
menu, tray, rename, %disable%, %enable%
menu, tray, tip, %name% : Deaktiviert
menu, tray, icon, %ResourceFolder%\neo_disabled.ico,,1
- SetNumLockState, %SavedNumLockState%
+ SetOldNumLockState()
suspend, on ; Schaltet Suspend ein -> QWERTZ
}
}