From 27385c5363aa30404a1cde321f3e60c0d33bea7d Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sun, 2 Oct 2022 00:39:35 -0400 Subject: alter keybindings for better compatibility with ConnectBot (ssh client for Android) F1 and F2 respectively can be used to toggle pause or toggle visibility of conversion table. The left/right arrow keys skip between events. These keys are available in ConnectBot even without enabling the on-screen keyboard. --- countdown.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/countdown.hs b/countdown.hs index f9da70e..2a1f654 100755 --- a/countdown.hs +++ b/countdown.hs @@ -413,8 +413,8 @@ handleEvent chan st e = VtyEvent (V.EvKey V.KPageUp []) -> cont $ st & stDisplayTime %~ (addLocalTime (-lengthOfDay)) VtyEvent (V.EvKey V.KDown []) -> cont $ st & stDisplayTime %~ (addLocalTime (60 * 60)) VtyEvent (V.EvKey V.KUp []) -> cont $ st & stDisplayTime %~ (addLocalTime (-60 * 60)) - VtyEvent (V.EvKey V.KRight []) -> cont $ st & stDisplayTime %~ (addLocalTime (60)) - VtyEvent (V.EvKey V.KLeft []) -> cont $ st & stDisplayTime %~ (addLocalTime (-60)) + VtyEvent (V.EvKey V.KRight []) -> cont $ st & stDisplayTime %~ nextCalendarEntryTime + VtyEvent (V.EvKey V.KLeft []) -> cont $ st & stDisplayTime %~ previousCalendarEntryTime VtyEvent (V.EvKey V.KRight [MCtrl]) -> cont $ st & stDisplayTime %~ (addLocalTime (10)) VtyEvent (V.EvKey V.KLeft [MCtrl]) -> cont $ st & stDisplayTime %~ (addLocalTime (-10)) VtyEvent (V.EvKey V.KRight [MShift]) -> cont $ st & stDisplayTime %~ (addLocalTime (1)) @@ -424,8 +424,10 @@ handleEvent chan st e = VtyEvent (V.EvKey V.KEnd []) -> cont $ st & stDisplayTime .~ (newYearsEveLast10 $ st ^. stClockTime) VtyEvent (V.EvKey V.KEnd [MShift]) -> cont $ st & stDisplayTime .~ (yearEnd $ st ^. stClockTime) VtyEvent (V.EvKey V.KEnd [MCtrl]) -> cont $ st & stDisplayTime .~ (newYearsEveNoon $ st ^. stClockTime) - VtyEvent (V.EvKey (V.KChar 'c') []) -> cont $ st & stShowConversion %~ not VtyEvent (V.EvKey (V.KChar 'p') []) -> cont $ st & stPaused %~ not + VtyEvent (V.EvKey (V.KFun 1) []) -> cont $ st & stPaused %~ not + VtyEvent (V.EvKey (V.KChar 'c') []) -> cont $ st & stShowConversion %~ not + VtyEvent (V.EvKey (V.KFun 2) []) -> cont $ st & stShowConversion %~ not VtyEvent (V.EvKey (V.KChar ',') []) -> cont $ st & stDisplayTime %~ previousCalendarEntryTime VtyEvent (V.EvKey (V.KChar '.') []) -> cont $ st & stDisplayTime %~ nextCalendarEntryTime VtyEvent _ -> cont st -- cgit v1.2.3