Permalink
Browse files

add '*' and '?' to the list of confimation keys

This is to to let the keys that request (more) information (help screen,
item list for dropping, etc.) toggle display of the obtained information off.
No two keys required ('?' and ' '), just tap '?' once, look, tap again.
  • Loading branch information...
1 parent e1914e0 commit ad8ac60d8110261aff9f8cf8e71ddcfd801566c5 @Mikolaj Mikolaj committed Feb 5, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/Display2.hs
View
@@ -58,7 +58,8 @@ displayBlankConfirm session txt =
display ((0, 0), normalLevelSize) session (const (attr, ' ')) x ""
getConfirm session
--- | Waits for a space or return.
+-- | Waits for a space or return or '?' or '*'. The last two to let keys that
+-- request (more) information toggle display of the obtained information off.
getConfirm :: MonadIO m => Session -> m Bool
getConfirm session =
getOptionalConfirm return (const $ getConfirm session) session
@@ -69,6 +70,8 @@ getOptionalConfirm h k session =
e <- liftIO $ nextCommand session
case e of
K.Char ' ' -> h True
+ K.Char '?' -> h True
+ K.Char '*' -> h True
K.Return -> h True
K.Esc -> h False
_ -> k e

0 comments on commit ad8ac60

Please sign in to comment.