# Keyboard Input in AS3

**URL:** <https://forum.kirupa.com/t/keyboard-input-in-as3/262600>\
**Category:** flash\
**Created:** [June 7, 2008, 3:26pm UTC](https://forum.kirupa.com/t/keyboard-input-in-as3/262600 "2008-06-07T15:26:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![itbkris](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@itbkris](https://forum.kirupa.com/u/itbkris)\
**Post date:** [June 7, 2008, 3:26pm UTC](https://forum.kirupa.com/t/keyboard-input-in-as3/262600/1 "2008-06-07T15:26:12Z")

</div>

Is there a way to know when the printscreen key is pressed? I want to black out images when it is hit but it does not have a charCode. Any ideas?

-Kris

---

<div class="post-metadata">

**Author:** ![itbkris](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@itbkris](https://forum.kirupa.com/u/itbkris)\
**Post date:** [June 7, 2008, 3:50pm UTC](https://forum.kirupa.com/t/keyboard-input-in-as3/262600/2 "2008-06-07T15:50:41Z")

</div>

It works in AS2 with this code:

this.onEnterFrame = function (){  
if (Key.isDown(44)) {  
trace(“Dont try to capture me!”);  
System.setClipboard(“Dont try to capture me!”);  
}  
}

Now to convert it.

---

<div class="post-metadata">

**Author:** ![itbkris](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@itbkris](https://forum.kirupa.com/u/itbkris)\
**Post date:** [June 7, 2008, 4:09pm UTC](https://forum.kirupa.com/t/keyboard-input-in-as3/262600/3 "2008-06-07T16:09:57Z")

</div>

Got it, just loaded the AS2 clip into the AS3 movie and the code ran fine.
