When using cl-sdl2 and textinput event, I get an integer instead of a string. How to get the associated text ?
[...]
(sdl2:with-event-loop (:method :poll)
(:textinput (:text text)
(print text) ; this is a number
(print (code-char text)) ; ok for ASCII characters only ?
(finish-output)))```
If I hit the "b" key, text is 98 and (code-char text) is #b, which is correct.
If I hit the "é" or "à" key, text is -61 (in both cases) and code-char signals an error, because -61 is not a valide code.
Shouldn't sdl/cl-sdl2 convert the input into string ?
How to get the string ?
New contributor
syll is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.