# \[F8\] How to simulate a button being pressed

**URL:** <https://forum.kirupa.com/t/f8-how-to-simulate-a-button-being-pressed/232984>\
**Category:** flash\
**Created:** [July 19, 2007, 7:27am UTC](https://forum.kirupa.com/t/f8-how-to-simulate-a-button-being-pressed/232984 "2007-07-19T07:27:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![OneMrBean](https://avatars.discourse-cdn.com/v4/letter/o/e9bcb4/32.png) [@OneMrBean](https://forum.kirupa.com/u/OneMrBean)\
**Post date:** [July 19, 2007, 7:27am UTC](https://forum.kirupa.com/t/f8-how-to-simulate-a-button-being-pressed/232984/1 "2007-07-19T07:27:43Z")

</div>

Hello,  
I was wondering if Flash 8 is able to simulate a button being pressed on the keyboard. I know it is able to detect if a button is being pressed by the user, but this is slightly different.

For example:

```php
// Pressing Spacebar would set the Enter key to being pressed
if(Key.isDown(KEY.SPACE)){
    Key.ENTER = true; // this line does not work. It is a theoretical example.
}

```

Thanks to anyone who tries to help out.

- Bean
