summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@cryptonomic.net>2022-10-02 00:39:35 -0400
committerAndrew Cady <d@cryptonomic.net>2022-10-02 00:41:42 -0400
commit27385c5363aa30404a1cde321f3e60c0d33bea7d (patch)
tree36bc049fc414c0914049bff30b250a2a8846fe4b
parente42103e602cdc1b9d9dff4adc9df6d673bb81d43 (diff)
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.
-rwxr-xr-xcountdown.hs8
1 files 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 =
413 VtyEvent (V.EvKey V.KPageUp []) -> cont $ st & stDisplayTime %~ (addLocalTime (-lengthOfDay)) 413 VtyEvent (V.EvKey V.KPageUp []) -> cont $ st & stDisplayTime %~ (addLocalTime (-lengthOfDay))
414 VtyEvent (V.EvKey V.KDown []) -> cont $ st & stDisplayTime %~ (addLocalTime (60 * 60)) 414 VtyEvent (V.EvKey V.KDown []) -> cont $ st & stDisplayTime %~ (addLocalTime (60 * 60))
415 VtyEvent (V.EvKey V.KUp []) -> cont $ st & stDisplayTime %~ (addLocalTime (-60 * 60)) 415 VtyEvent (V.EvKey V.KUp []) -> cont $ st & stDisplayTime %~ (addLocalTime (-60 * 60))
416 VtyEvent (V.EvKey V.KRight []) -> cont $ st & stDisplayTime %~ (addLocalTime (60)) 416 VtyEvent (V.EvKey V.KRight []) -> cont $ st & stDisplayTime %~ nextCalendarEntryTime
417 VtyEvent (V.EvKey V.KLeft []) -> cont $ st & stDisplayTime %~ (addLocalTime (-60)) 417 VtyEvent (V.EvKey V.KLeft []) -> cont $ st & stDisplayTime %~ previousCalendarEntryTime
418 VtyEvent (V.EvKey V.KRight [MCtrl]) -> cont $ st & stDisplayTime %~ (addLocalTime (10)) 418 VtyEvent (V.EvKey V.KRight [MCtrl]) -> cont $ st & stDisplayTime %~ (addLocalTime (10))
419 VtyEvent (V.EvKey V.KLeft [MCtrl]) -> cont $ st & stDisplayTime %~ (addLocalTime (-10)) 419 VtyEvent (V.EvKey V.KLeft [MCtrl]) -> cont $ st & stDisplayTime %~ (addLocalTime (-10))
420 VtyEvent (V.EvKey V.KRight [MShift]) -> cont $ st & stDisplayTime %~ (addLocalTime (1)) 420 VtyEvent (V.EvKey V.KRight [MShift]) -> cont $ st & stDisplayTime %~ (addLocalTime (1))
@@ -424,8 +424,10 @@ handleEvent chan st e =
424 VtyEvent (V.EvKey V.KEnd []) -> cont $ st & stDisplayTime .~ (newYearsEveLast10 $ st ^. stClockTime) 424 VtyEvent (V.EvKey V.KEnd []) -> cont $ st & stDisplayTime .~ (newYearsEveLast10 $ st ^. stClockTime)
425 VtyEvent (V.EvKey V.KEnd [MShift]) -> cont $ st & stDisplayTime .~ (yearEnd $ st ^. stClockTime) 425 VtyEvent (V.EvKey V.KEnd [MShift]) -> cont $ st & stDisplayTime .~ (yearEnd $ st ^. stClockTime)
426 VtyEvent (V.EvKey V.KEnd [MCtrl]) -> cont $ st & stDisplayTime .~ (newYearsEveNoon $ st ^. stClockTime) 426 VtyEvent (V.EvKey V.KEnd [MCtrl]) -> cont $ st & stDisplayTime .~ (newYearsEveNoon $ st ^. stClockTime)
427 VtyEvent (V.EvKey (V.KChar 'c') []) -> cont $ st & stShowConversion %~ not
428 VtyEvent (V.EvKey (V.KChar 'p') []) -> cont $ st & stPaused %~ not 427 VtyEvent (V.EvKey (V.KChar 'p') []) -> cont $ st & stPaused %~ not
428 VtyEvent (V.EvKey (V.KFun 1) []) -> cont $ st & stPaused %~ not
429 VtyEvent (V.EvKey (V.KChar 'c') []) -> cont $ st & stShowConversion %~ not
430 VtyEvent (V.EvKey (V.KFun 2) []) -> cont $ st & stShowConversion %~ not
429 VtyEvent (V.EvKey (V.KChar ',') []) -> cont $ st & stDisplayTime %~ previousCalendarEntryTime 431 VtyEvent (V.EvKey (V.KChar ',') []) -> cont $ st & stDisplayTime %~ previousCalendarEntryTime
430 VtyEvent (V.EvKey (V.KChar '.') []) -> cont $ st & stDisplayTime %~ nextCalendarEntryTime 432 VtyEvent (V.EvKey (V.KChar '.') []) -> cont $ st & stDisplayTime %~ nextCalendarEntryTime
431 VtyEvent _ -> cont st 433 VtyEvent _ -> cont st