indigo icon indicating copy to clipboard operation
indigo copied to clipboard

Add Key.isNumeric / Key.asNumber

Open davesmith00000 opened this issue 8 months ago • 0 comments

Would be handly to be able to say "was the key a number" and "optionally give me the key's number, if it was a number. Currently doing it was something like this:

def keyToNumber(keyCode: Int): Option[Int] =
      if keyCode >= Key.KEY_0.code && keyCode <= Key.KEY_9.code then
        Option(keyCode - Key.KEY_0.code)
      else None

But in the real version they could just be properties of the enum or something.

davesmith00000 avatar Jun 13 '24 07:06 davesmith00000