A double scroll lock is used to communicate with my KVM. This should
not have a side effect of locking the screen, so arrange for the screen
to only lock if the scroll lock key is pressed once.
Unfortunately, FVWM does not appear to have "single press" versus
"double press" for key bindings (although it does for mouse
bindings...), so we simulate it using a timer.
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