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.
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:
But in the real version they could just be properties of the enum or something.