# Measuring key lift time relative to stimulus onset

**URL:** <https://discourse.psychopy.org/t/measuring-key-lift-time-relative-to-stimulus-onset/12471>\
**Category:** Coding\
**Tags:** timing, screen\
**Created:** [April 16, 2020, 8:59pm UTC](https://discourse.psychopy.org/t/measuring-key-lift-time-relative-to-stimulus-onset/12471 "2020-04-16T20:59:22Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Becca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/becca/32/34260_2.png) [@Becca](https://discourse.psychopy.org/u/Becca)\
**Post date:** [March 18, 2021, 4:43pm UTC](https://discourse.psychopy.org/t/measuring-key-lift-time-relative-to-stimulus-onset/12471/3 "2021-03-18T16:43:42Z")

</div>

Hi There!

Getting key durations times is a bit tricker online and needs some custom javascript. Here is a demo from myself and Thomas Pronk to help you on your way  
run link [online-key-lifts [PsychoPy]](https://run.pavlovia.org/lpxrh6/online-key-lifts)  
code: [Rebecca Hirst / online-key-lifts · GitLab](https://gitlab.pavlovia.org/lpxrh6/online-key-lifts)  
File in case: [online-key-lifts.psyexp](https://discourse.psychopy.org/uploads/short-url/dPQSRIdm0WtjidRfaTXp4l43u8n.psyexp) (18.0 KB)

Essentially we are monitoring for key events on a list of defined keys ( in this case ‘a’, ‘d’ and ‘l’) when the key is lifted you can see the duration time and that is saved to file - so this should be what you can plug in to your experiment.

Hope this helps,  
Becca

---

_[View the full topic](https://discourse.psychopy.org/t/measuring-key-lift-time-relative-to-stimulus-onset/12471)._
