Key grave A CM Exec exec $[TERMINAL] -e zsh -f
Key F3 A M Module FvwmConsole -terminal urxvt
-# Screen locking
-Key Scroll_Lock A A Exec exec xscreensaver-command -lock
+# Screen locking. Since a double scroll lock is used to communicate with the
+# KVM, take some care to only lock the screen if the scroll lock key is pressed
+# once.
+DestroyFunc FinishLock
+AddToFunc FinishLock
+ + I Key Scroll_Lock A A LockScreen
+ + I $*
+
+DestroyFunc LockScreen
+AddToFunc LockScreen
+ + I Schedule 750 FinishLock Exec exec xscreensaver-command -lock
+ + I Key Scroll_Lock A A FinishLock Deschedule $[schedule.last]
+
+Key Scroll_Lock A A LockScreen
DestroyFunc DoPageMove
AddToFunc DoPageMove