diff options
author | Gordon GECOS <u@adam> | 2022-12-16 18:00:53 -0500 |
---|---|---|
committer | Gordon GECOS <u@adam> | 2022-12-16 18:00:53 -0500 |
commit | 7eaa0085c4c44eec5f4fb62aa962fa9f1c7684ec (patch) | |
tree | 6ef5acd046b35f8fee6c36dd0cf940bbc3be04b0 | |
parent | fc550e3de2881808016944bd0dc34059e6ecbb23 (diff) |
change some keybindings
-rwxr-xr-x | countdown.hs | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/countdown.hs b/countdown.hs index a7488de..ab3fe81 100755 --- a/countdown.hs +++ b/countdown.hs | |||
@@ -413,29 +413,36 @@ previousCalendarEntryTime t = fromMaybe t $ goBack t | |||
413 | handleEvent :: BChan CustomEvent -> St -> BrickEvent () CustomEvent -> EventM () (Next St) | 413 | handleEvent :: BChan CustomEvent -> St -> BrickEvent () CustomEvent -> EventM () (Next St) |
414 | handleEvent chan st e = | 414 | handleEvent chan st e = |
415 | case e of | 415 | case e of |
416 | VtyEvent (V.EvKey V.KEsc []) -> halt st | 416 | VtyEvent (V.EvKey V.KEsc []) -> halt st |
417 | VtyEvent (V.EvKey V.KPageDown []) -> cont $ st & stDisplayTime %~ (addLocalTime lengthOfDay) | 417 | VtyEvent (V.EvKey (V.KChar 'p') []) -> cont $ st & stPaused %~ not |
418 | VtyEvent (V.EvKey V.KPageUp []) -> cont $ st & stDisplayTime %~ (addLocalTime (-lengthOfDay)) | 418 | VtyEvent (V.EvKey (V.KFun 1) []) -> cont $ st & stPaused %~ not |
419 | VtyEvent (V.EvKey V.KDown []) -> cont $ st & stDisplayTime %~ (addLocalTime (60 * 60)) | 419 | |
420 | VtyEvent (V.EvKey V.KUp []) -> cont $ st & stDisplayTime %~ (addLocalTime (-60 * 60)) | 420 | VtyEvent (V.EvKey V.KRight [MShift]) -> cont $ st & stDisplayTime %~ (addLocalTime (1)) |
421 | VtyEvent (V.EvKey V.KRight []) -> cont $ st & stDisplayTime %~ nextCalendarEntryTime | 421 | VtyEvent (V.EvKey V.KLeft [MShift]) -> cont $ st & stDisplayTime %~ (addLocalTime (-1)) |
422 | VtyEvent (V.EvKey V.KLeft []) -> cont $ st & stDisplayTime %~ previousCalendarEntryTime | 422 | |
423 | VtyEvent (V.EvKey V.KRight [MCtrl]) -> cont $ st & stDisplayTime %~ (addLocalTime (10)) | 423 | VtyEvent (V.EvKey V.KRight [MCtrl]) -> cont $ st & stDisplayTime %~ (addLocalTime (60)) |
424 | VtyEvent (V.EvKey V.KLeft [MCtrl]) -> cont $ st & stDisplayTime %~ (addLocalTime (-10)) | 424 | VtyEvent (V.EvKey V.KLeft [MCtrl]) -> cont $ st & stDisplayTime %~ (addLocalTime (-60)) |
425 | VtyEvent (V.EvKey V.KRight [MShift]) -> cont $ st & stDisplayTime %~ (addLocalTime (1)) | 425 | |
426 | VtyEvent (V.EvKey V.KLeft [MShift]) -> cont $ st & stDisplayTime %~ (addLocalTime (-1)) | 426 | VtyEvent (V.EvKey V.KPageDown [MCtrl]) -> cont $ st & stDisplayTime %~ (addLocalTime (60 * 60)) |
427 | VtyEvent (V.EvKey V.KHome []) -> cont $ st & stDisplayTime .~ (st ^. stClockTime) | 427 | VtyEvent (V.EvKey V.KPageUp [MCtrl]) -> cont $ st & stDisplayTime %~ (addLocalTime (-60 * 60)) |
428 | VtyEvent (V.EvKey V.KHome [MShift]) -> cont $ st & stDisplayTime .~ (yearStart $ st ^. stClockTime) | 428 | VtyEvent (V.EvKey V.KPageDown []) -> cont $ st & stDisplayTime %~ (addLocalTime lengthOfDay) |
429 | VtyEvent (V.EvKey V.KEnd []) -> cont $ st & stDisplayTime .~ (newYearsEveLast10 $ st ^. stClockTime) | 429 | VtyEvent (V.EvKey V.KPageUp []) -> cont $ st & stDisplayTime %~ (addLocalTime (-lengthOfDay)) |
430 | VtyEvent (V.EvKey V.KEnd [MShift]) -> cont $ st & stDisplayTime .~ (yearEnd $ st ^. stClockTime) | 430 | |
431 | VtyEvent (V.EvKey V.KEnd [MCtrl]) -> cont $ st & stDisplayTime .~ (newYearsEveNoon $ st ^. stClockTime) | 431 | VtyEvent (V.EvKey V.KHome []) -> cont $ st & stDisplayTime .~ (st ^. stClockTime) |
432 | VtyEvent (V.EvKey (V.KChar 'p') []) -> cont $ st & stPaused %~ not | 432 | VtyEvent (V.EvKey V.KHome [MShift]) -> cont $ st & stDisplayTime .~ (yearStart $ st ^. stClockTime) |
433 | VtyEvent (V.EvKey (V.KFun 1) []) -> cont $ st & stPaused %~ not | 433 | VtyEvent (V.EvKey V.KEnd []) -> cont $ st & stDisplayTime .~ (newYearsEveLast10 $ st ^. stClockTime) |
434 | VtyEvent (V.EvKey (V.KChar 'c') []) -> cont $ st & stShowConversion %~ not | 434 | VtyEvent (V.EvKey V.KEnd [MShift]) -> cont $ st & stDisplayTime .~ (yearEnd $ st ^. stClockTime) |
435 | VtyEvent (V.EvKey (V.KFun 2) []) -> cont $ st & stShowConversion %~ not | 435 | VtyEvent (V.EvKey V.KEnd [MCtrl]) -> cont $ st & stDisplayTime .~ (newYearsEveNoon $ st ^. stClockTime) |
436 | VtyEvent (V.EvKey (V.KChar ',') []) -> cont $ st & stDisplayTime %~ previousCalendarEntryTime | 436 | |
437 | VtyEvent (V.EvKey (V.KChar '.') []) -> cont $ st & stDisplayTime %~ nextCalendarEntryTime | 437 | VtyEvent (V.EvKey V.KRight []) -> cont $ st & stDisplayTime %~ nextCalendarEntryTime |
438 | VtyEvent _ -> cont st | 438 | VtyEvent (V.EvKey V.KLeft []) -> cont $ st & stDisplayTime %~ previousCalendarEntryTime |
439 | VtyEvent (V.EvKey (V.KChar '.') []) -> cont $ st & stDisplayTime %~ nextCalendarEntryTime | ||
440 | VtyEvent (V.EvKey (V.KChar ',') []) -> cont $ st & stDisplayTime %~ previousCalendarEntryTime | ||
441 | |||
442 | VtyEvent (V.EvKey (V.KChar 'c') []) -> cont $ st & stShowConversion %~ not | ||
443 | VtyEvent (V.EvKey (V.KFun 2) []) -> cont $ st & stShowConversion %~ not | ||
444 | |||
445 | VtyEvent _ -> cont st | ||
439 | AppEvent (TimeChanged now) -> do | 446 | AppEvent (TimeChanged now) -> do |
440 | let hyper = isNewYearsEve $ st ^. stDisplayTime | 447 | let hyper = isNewYearsEve $ st ^. stDisplayTime |
441 | void $ queueNextEvent hyper chan | 448 | void $ queueNextEvent hyper chan |