]> git.draconx.ca Git - fvwmconf.git/commitdiff
Don't lock the screen on a double scroll lock.
authorNick Bowler <nbowler@draconx.ca>
Tue, 20 Mar 2012 23:34:01 +0000 (19:34 -0400)
committerNick Bowler <nbowler@draconx.ca>
Tue, 20 Mar 2012 23:34:01 +0000 (19:34 -0400)
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.

common/bindings

index f87c13609aa14ea79c2b77873ed5c4a2239300da..afc2962b13401d71416f10e1dca5172207e038a8 100644 (file)
@@ -35,8 +35,20 @@ Key grave A C  Exec exec $[TERMINAL]
 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