Skip to content

Record first keypress and RT #3193

Discussion options

You must be logged in to vote

Good catch, did not think about that :)

I checked the source code and the getKeyboardResponse indeed does not propagate the event. I think your solution will always but the first keypress in the first input field, even if a participant has a focus in the second input field? For future reference I adjusted the code a little bit so that it works irrespective of the input field

    let startTime, first_key_info;
    function first_keypress_handler(e){
        // Check if we already have info
        if(first_key_info)
          return;

        first_key_info= {
          rt : Math.round( performance.now() - startTime), 
          key : e.key
        }
    }

    var trial = {
        type: j…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@dreamerie
Comment options

@dreamerie
Comment options

@ChristopheBossens
Comment options

Answer selected by dreamerie
@dreamerie
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants