# keyboard.getKeys() record keypress at key press rather than key release

**URL:** <https://discourse.psychopy.org/t/keyboard-getkeys-record-keypress-at-key-press-rather-than-key-release/23527>\
**Category:** Coding\
**Created:** [June 12, 2021, 7:07pm UTC](https://discourse.psychopy.org/t/keyboard-getkeys-record-keypress-at-key-press-rather-than-key-release/23527 "2021-06-12T19:07:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zora](https://avatars.discourse-cdn.com/v4/letter/z/f475e1/32.png) [@Zora](https://discourse.psychopy.org/u/Zora)\
**Post date:** [June 12, 2021, 7:07pm UTC](https://discourse.psychopy.org/t/keyboard-getkeys-record-keypress-at-key-press-rather-than-key-release/23527/1 "2021-06-12T19:07:05Z")

</div>

Hello,

in our experiment participants are supposed to wait until a beep ends and then press a key. We’re recording the key presses with keyboard.getKeys() (for time accuracy.)  
**The next interval is supposed to start when the button is pressed. However, with keyboard.getKeys() it currently starts when the button is released.**  
This can lead to situations where the participant is pressing the button before the beep occurs and release it afterwards (worst case: this will mess up our reaction times).

I have checked the documentation but can’t seem to **find a way to record key presses on key press rather than key release using keyboard.getKeys()**. Any help would be appreciated!
