Skip to content

Commit b744078

Browse files
committed
No more get-key-blocking &rest map args
Looking back over the library, I realized that &rest args aren't really used with maps anywhere else, so it doesn't make sense to use them here.
1 parent 9452e51 commit b744078

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

docs/2-terminals.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ 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:
167+
`get-key-blocking` optionally accepts a check interval and/or timeout:
168168

169169
:::clojure
170-
(t/get-key-blocking term :interval 100 :timeout 5000)
170+
(t/get-key-blocking term {:interval 100 :timeout 5000})
171171
;
172172
; Key presses will be checked for every 100 msecs. If you wait
173173
; 5 seconds, nil will be returned.

src/lanterna/screen.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,9 @@
281281
returning nil.
282282
283283
"
284-
[^Screen screen & {:keys [interval timeout] :as opts}]
285-
(block-on get-key [screen] opts))
284+
([^Screen screen] (get-key-blocking screen {}))
285+
([^Screen screen & {:keys [interval timeout] :as opts}]
286+
(block-on get-key [screen] opts)))
286287

287288

288289
(comment

src/lanterna/terminal.clj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,9 @@
246246
returning nil.
247247
248248
"
249-
[^Terminal terminal & {:keys [interval timeout] :as opts}]
250-
(block-on get-key [terminal] opts))
249+
([^Terminal terminal] (get-key-blocking terminal {}))
250+
([^Terminal terminal {:keys [interval timeout] :as opts}]
251+
(block-on get-key [terminal] opts)))
251252

252253

253254
(comment
@@ -260,8 +261,8 @@
260261
(start t)
261262
(set-fg-color t :yellow)
262263
(put-string t "Hello, world!")
263-
(get-key-blocking t :timeout 1000)
264-
(get-key-blocking t :interval 2000)
264+
(get-key-blocking t {:timeout 1000})
265+
(get-key-blocking t {:interval 2000})
265266
(stop t)
266267

267268
)

0 commit comments

Comments
 (0)