Skip to content

Comments

Prevent key holding#22

Open
zameji wants to merge 1 commit intoaddrummond:masterfrom
zameji:master
Open

Prevent key holding#22
zameji wants to merge 1 commit intoaddrummond:masterfrom
zameji:master

Conversation

@zameji
Copy link

@zameji zameji commented Jul 10, 2019

By keeping track whether the key has been pressed and released, we prevent the user from keeping the key down and fast-forwarding through the sentence.
Inspired by a more general version on StackOverflow

By keeping track whether the key has been pressed and released, we prevent the user from keeping the key down and fast-forwarding through the sentence.
Inspired by a more general version: https://stackoverflow.com/questions/34119155/prevent-holding-enter-key-in-an-input-field
@addrummond
Copy link
Owner

addrummond commented Jul 10, 2019

Hi Jiri, thanks for taking the time to submit this.

I don't think that there is any point in trying to stop users from doing this. If users want to go through the sentence as fast as possible without reading it, then they can do that, regardless of whether or not separate presses of the space bar are required. The best thing to do is to add comprehension questions, so that participants who answer a significant number of comprehension questions incorrectly can be filtered out.

This modification also adds a small degree of additional latency, since the next word is displayed only once the space bar is released.

See also discussion here:

https://groups.google.com/forum/#!searchin/ibexexperiments/hold$20key$20down$20space%7Csort:date/ibexexperiments/8_poa2W9zhA/gq1ITZogBAAJ

@zameji
Copy link
Author

zameji commented Jul 11, 2019

Hi & thanks for the quick response. I suppose we can't prevent the users completely, but I don't want to make it easy for them. This would also prevent the few cases where the user holds the spacebar too long and skips the next word by accident. Obviously, it's entirely up to you to decide whether it makes sense in the master branch or not.
Regarding the latency - actually, the next word is displayed immediately, it is only the word after that that is affected, waiting for the "keyup - keydown" event pair.

@addrummond
Copy link
Owner

Ah I see. Ok, I think I agree with the logic for including this. I may look into whether it's possible to do this without registering and unregistering event listeners.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants