# On keypress - case sensitive?

**URL:** <https://forum.kirupa.com/t/on-keypress-case-sensitive/212371>\
**Category:** Uncategorized\
**Created:** [January 10, 2007, 4:26pm UTC](https://forum.kirupa.com/t/on-keypress-case-sensitive/212371 "2007-01-10T16:26:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![teammelk](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@teammelk](https://forum.kirupa.com/u/teammelk)\
**Post date:** [January 10, 2007, 4:26pm UTC](https://forum.kirupa.com/t/on-keypress-case-sensitive/212371/1 "2007-01-10T16:26:21Z")

</div>

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:

```auto
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:

```auto
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?
