comparison clojure/com/aurellem/run/bootstrap_0.clj @ 324:7876781520ea

fixed set-cursor so that moving the cursor backwards works
author Robert McIntyre <rlm@mit.edu>
date Wed, 04 Apr 2012 01:04:06 -0500
parents 92ee94945327
children a5cdb2f76307
comparison
equal deleted inserted replaced
323:92ee94945327 324:7876781520ea
376 Moves the cursor n steps relative to its current 376 Moves the cursor n steps relative to its current
377 position." 377 position."
378 [n script] 378 [n script]
379 (let [key (if (< 0 n) ↓ ↑)] 379 (let [key (if (< 0 n) ↓ ↑)]
380 (multiple-times 380 (multiple-times
381 n (partial repeat-until-different 381 (Math/abs n)
382 key list-offset) script))) 382 (partial repeat-until-different
383 key list-offset)
384 script)))
383 385
384 (defn set-cursor 386 (defn set-cursor
385 "Assumes the arrow keys currently control the cursor. Sets 387 "Assumes the arrow keys currently control the cursor. Sets
386 the cursor to the desired position. Works for any menu 388 the cursor to the desired position. Works for any menu
387 that uses a cursor including the start menu, item menu, 389 that uses a cursor including the start menu, item menu,