I’m trying to setup an interface where an event is triggered by the user pressing a key on the keyboard. So far I have the following code in a button on the stage:
on (keyPress "a"){
trace("you pressed a")
}
on (keyPress "b"){
trace("you pressed b")
}
on (keyPress "c"){
trace("you pressed c")
}
//and so on for each letter of the alphabet...
Which works fine. I was wondering if there was a way to either remove the case sensitive properties of the keypress action, or to force the keyboard to return a caps lock or something. The only way I can think of doing it so far would be something like this:
on (keyPress "a"){
trace("you pressed a")
}
on (keyPress "A"){
trace ("you pressed a")
}
on (keyPress "b"){
trace("you pressed b")
}
on (keyPress "B"){
trace("you pressed b")
}
on (keyPress "c"){
trace("you pressed c")
}
on (keyPress "C"){
trace("you pressed c")
}
//and so on for each letter of the alphabet...
Which obviously will double the amount of code needed - especially as the event for a small c and a capital C would be the same.
So, any ideas?