Skip to content

Commit 9452e51

Browse files
committed
Document get-key-blocking optional args
1 parent 37bd48e commit 9452e51

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/2-terminals.markdown

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,16 @@ one if there's none already buffered) you can use `get-key-blocking`:
164164
;
165165
; => \a
166166

167+
`get-key-blocking` optionally accepts a check interval or timeout:
168+
169+
:::clojure
170+
(t/get-key-blocking term :interval 100 :timeout 5000)
171+
;
172+
; Key presses will be checked for every 100 msecs. If you wait
173+
; 5 seconds, nil will be returned.
174+
;
175+
; => nil
176+
167177
Normal alphanumeric keys are returned as simple Character objects like `\a`.
168178

169179
Note that there's no special attribute to determine if the Shift key was

0 commit comments

Comments
 (0)