mirror of
https://github.com/Yvee1/hascard.git
synced 2024-11-22 04:33:06 +03:00
Use Shift+Tab for showing answer
Also change capitalization of keys in info text.
This commit is contained in:
parent
e7031eed43
commit
458cf138d6
@ -41,12 +41,12 @@ drawUI s = [maybe emptyWidget (`drawPopup` s) (s^.popup), drawCardUI s <=> draw
|
||||
|
||||
drawInfo :: CS -> Widget Name
|
||||
drawInfo s = if not (s ^. showControls) then emptyWidget else
|
||||
strWrap . ("ESC: quit" <>) $ case s ^. cardState of
|
||||
DefinitionState {} -> ", ENTER: flip card / continue"
|
||||
MultipleChoiceState {} -> ", ENTER: submit answer / continue"
|
||||
MultipleAnswerState {} -> ", ENTER: select / continue, c: submit selection"
|
||||
OpenQuestionState {} -> ", LEFT/RIGHT/TAB: navigate gaps, ENTER: submit answer / continue, Ctrl+F1: show answer"
|
||||
ReorderState {} -> ", ENTER: grab, c: submit answer"
|
||||
strWrap . ("Esc: quit" <>) $ case s ^. cardState of
|
||||
DefinitionState {} -> ", Enter: flip card / continue"
|
||||
MultipleChoiceState {} -> ", Enter: submit answer / continue"
|
||||
MultipleAnswerState {} -> ", Enter: select / continue, c: submit selection"
|
||||
OpenQuestionState {} -> ", Left/Right/Tab: navigate gaps, Enter: submit answer / continue, Shift+Tab: show answer"
|
||||
ReorderState {} -> ", Enter: grab, c: submit answer"
|
||||
|
||||
drawCardBox :: Widget Name -> Widget Name
|
||||
drawCardBox w = C.center $
|
||||
@ -360,7 +360,7 @@ handleEvent (VtyEvent e) =
|
||||
|
||||
(OpenQuestionState {_highlighted = i, _number = n, _gapInput = kvs, _correctGaps = cGaps, _failed=fail}, OpenQuestion _ _ perforated) ->
|
||||
case ev of
|
||||
V.EvKey (V.KFun 1) [V.MCtrl] -> zoom (cs.cardState) $ do
|
||||
V.EvKey (V.KChar '\t') [V.MShift] -> zoom (cs.cardState) $ do
|
||||
gapInput .= correctAnswers
|
||||
entered .= True
|
||||
failed .= True
|
||||
@ -391,7 +391,7 @@ handleEvent (VtyEvent e) =
|
||||
|
||||
V.EvKey (V.KChar c) [] -> zoom (cs.cardState) $ do
|
||||
unless frozen $ gapInput.at i.non "" %= (++[c])
|
||||
case c of
|
||||
when frozen $ case c of
|
||||
'k' -> up
|
||||
'j' -> down
|
||||
_ -> return ()
|
||||
@ -425,8 +425,8 @@ handleEvent (VtyEvent e) =
|
||||
_ -> return ()
|
||||
|
||||
where frozen = M.foldr (&&) True cGaps
|
||||
down = when frozen $ scroll s 1
|
||||
up = when frozen $ scroll s (-1)
|
||||
down = scroll s 1
|
||||
up = scroll s (-1)
|
||||
|
||||
(ReorderState {_highlighted = i, _entered = submitted, _grabbed=dragging, _number = n, _order = kvs }, Reorder _ _ elts) ->
|
||||
case ev of
|
||||
|
@ -63,10 +63,10 @@ info = unlines
|
||||
, ""
|
||||
, " * Enter confirms a selection, flips a card or continues to the next card"
|
||||
, ""
|
||||
, " * Use TAB or the arrow keys for navigating gaps in open questions"
|
||||
, " * Use Tab or the arrow keys for navigating gaps in open questions"
|
||||
, ""
|
||||
, " * Use the c key for confirming reorder questions or multiple choice questions with more than 1 possible answer"
|
||||
, ""
|
||||
, " * Use Ctrl+F1 to show the answers of a open question"
|
||||
, " * Use Shift+Tab to show the answers of a open question"
|
||||
, ""
|
||||
, " * Use Ctrl+Left and Ctrl+Right to move to previous and next cards without having to answer them; this is disabled in review mode"]
|
||||
|
Loading…
Reference in New Issue
Block a user