Reply To: newKey with numeric choices

PennController for IBEX Forums Support newKey with numeric choices Reply To: newKey with numeric choices

#6820
Jeremy
Keymaster

Hello,

PennController should automatically detect when the argument is an actual number, or a string exclusively consisting of digits. Visibly it fails to do so, and therefore expects a keypress producing the character with code 12, which is inaccessible in a single keystroke.

To fool PennController, add a dummy non-digit character to your digit string, for example (this one’s called the “replacement character,” I doubt anyone would have configured their keyboard to type it in a single keystroke):

newKey("1or2", "�12")
    .wait()
    .test.pressed("1")
    .success( newText("success", "You're right!").print() )
    .failure( newText("failure", "You're wrong, 0.999... and 1 do refer to the same number").print() )

Jeremy