# Onkeypress with the onPress

**URL:** <https://forum.kirupa.com/t/onkeypress-with-the-onpress/209081>\
**Category:** Uncategorized\
**Created:** [December 5, 2006, 7:59pm UTC](https://forum.kirupa.com/t/onkeypress-with-the-onpress/209081 "2006-12-05T19:59:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![declare](https://avatars.discourse-cdn.com/v4/letter/d/ecb155/32.png) [@declare](https://forum.kirupa.com/u/declare)\
**Post date:** [December 5, 2006, 7:59pm UTC](https://forum.kirupa.com/t/onkeypress-with-the-onpress/209081/1 "2006-12-05T19:59:30Z")

</div>

Can someone show me how to add a (onkeypress with the onPress) to this code? please

pad1.onPress = function() {  
kirupaSound = new Sound(this.\_parent);  
kirupaSound.attachSound(“pad1”);  
kirupaSound.start(0, 99);  
};  
pad1.onRelease = function() {  
kirupaSound.stop();
