<div>hello</div><div>I'm trying to make program that receive keyboard input</div><div>for making program little bit more fun</div><div><br></div><div>as shown in the book, "how to design world"</div><div><br>
</div><div>I wrote the code as like below</div><div>it's just key comparing </div><div>I can't find how to receive keyinput from user in the book</div><div><br></div><div>(define (printkey x)</div><div> (cond [(key=? x 'up)(print "up")]</div>
<div> [(key=? x 'down)(print "down")]</div><div> [(key=? x 'left)(print "left")]</div><div> [(key=? x 'right)(print "right")]</div><div> [(key=? x 'a)(print "a")]</div>
<div> [(key=? x 's)(print "s")]</div><div> [(key=? x 'd)(print "d")]</div><div> [(key=? x 'f)(print "f")]</div><div> [(key=? x 'z)(print "z")]</div>
<div> [(key=? x 'x)(print "x")]))</div><div><br></div><div>could you let me know how to receive keyboard input from user?</div><div>and how to iterate it?</div><div><br></div>