-
-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getKeyboardResponse
can return a lower case version of the key
in some circumstances
#3325
Comments
Hi @TAOKA-Daiki, I just double checked this and, at least in Chromium, the event.key property is |
Thank you for early reply and checking, @jodeleeuw. My jsPsych v7 program runs on the Google Chrome version 126.0.6478.61 (64 bit for Windows). |
Can you clarify what the issue is? The key strings are not case sensitive, so if you are using "enter" that will work just as well as "Enter". When the event is generated by the browser it uses the capitalization that is shown in the documentation. Are you seeing a case where "Enter" does not work but "enter" does? |
I have checked the source code of jsPsych.js and understood the reason for the issue. As you said, the areResponsesCaseSensitive property of the KeyboardListerAPI in jsPsych v7 is false by default (in line 681 of jsPsych.js). And in the getKeyboardResponse method, the list of key names given to valid_responses is converted to lowercase (in line 741 of jsPsych.js). I am currently working on tweaking my custom plugin (modified from plugin-html-keyboard-response.js). My custom plugin accepts numeric and Backspace keys and displays the input value on screen, and then participant determines the input by pressing the Enter key. What I have stuck this time is the after_response = (info) => {} function in the custom plugin. Understanding the internal processing of jsPsych helped me understand the reason for the problem. |
Thanks for clarifying! I think we should consider outputting the standard |
getKeyboardResponse
can return a lower case version of the key
in some circumstances
… the `key` in some circumstances #3325
This will be fixed in v8.0 |
The description of the parameter choices in html-keyboard-response in jsPsych v7 seems to be incorrect.
jsPsych v7 plugin page of html-keyboard-response
Enter key was detected with 'enter', not 'Enter'.
The down arrow key was detected with 'arrowdown', not 'ArrowDown'.
The version of jsPsych used for testing was V7.3.4.
At least as of 2024/06/21, the reference link attached in the table was not informative.
Please correct the description of the plugin page and provide a list of correct key names that jsPsych can accept.
Thank you in advance.
The text was updated successfully, but these errors were encountered: