File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -104,9 +104,10 @@ ask: func [
104
104
question [series! ] "Prompt to user"
105
105
/hide "Turns off echoing inputs"
106
106
/char "Waits only on single key press and returns char as a result"
107
+ limit [bitset! string! block! char! none! ] "Limit input to specified chars or control words"
107
108
] [
108
109
prin question
109
- input/: hide
110
+ either char [wait-for-key /only limit][ input/: hide]
110
111
]
111
112
112
113
confirm : func [
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ file-checksum: function [
131
131
132
132
wait-for-key : func [
133
133
"Wait for single key press and return char (or word for control keys) as a result"
134
- /only limit [bitset! string! block! ] "Limit input to specified chars or control words"
134
+ /only limit [bitset! string! block! none! char! ] "Limit input to specified chars or control words"
135
135
/local port old-awake
136
136
] [
137
137
;; using existing input port
@@ -153,6 +153,8 @@ wait-for-key: func[
153
153
true
154
154
]
155
155
]
156
+ ;; handle single char limit
157
+ if char? limit [limit: to string! limit]
156
158
;; wait for user input
157
159
wait /only port
158
160
;; put back original awake actor and read-line mode
You can’t perform that action at this time.
0 commit comments