@@ -13,6 +13,7 @@ data AppKbCmd t = AppKbCmd {
1313 , _appKbCmd_open :: Event t ()
1414 , _appKbCmd_print :: Event t ()
1515 , _appKbCmd_quit :: Event t ()
16+ , _appKbCmd_forceQuit :: Event t ()
1617 , _appKbCmd_new :: Event t ()
1718 , _appKbCmd_capturedInput :: Event t ()
1819}
@@ -30,13 +31,21 @@ holdAppKbCmd = do
3031 printEv = captureKeyWithCtrl ' p'
3132 quitEv = captureKeyWithCtrl ' q'
3233 newEv = captureKeyWithCtrl ' n'
33- captureEv = leftmost [saveEv, openEv, quitEv, newEv]
34+
35+ -- TODO this doesn't seem to work, prob cuz vty isn't handling shift correctly on mac
36+ forceQuitEv = fforMaybe inp $ \ i -> case i of
37+ V. EvKey (V. KChar ' q' ) [V. MCtrl , V. MShift ] -> Just ()
38+ V. EvKey (V. KChar ' q' ) [V. MShift , V. MCtrl ] -> Just ()
39+ _ -> Nothing
40+
41+ captureEv = leftmost [saveEv, openEv, quitEv, newEv, forceQuitEv]
3442
3543 return $ AppKbCmd {
3644 _appKbCmd_save = saveEv
3745 , _appKbCmd_open = openEv
3846 , _appKbCmd_print = printEv
3947 , _appKbCmd_quit = quitEv
48+ , _appKbCmd_forceQuit = forceQuitEv
4049 , _appKbCmd_new = newEv
4150 , _appKbCmd_capturedInput = captureEv
4251 }
0 commit comments