study_assets_root/rdk/jspsych-5.0.3/plugins/jspsych-RDK.js
//Function to start the keyboard listener
Function to start the keyboard listener
Function to start the keyboard listener
function startKeyboardListener(){
			if (trial.choices != jsPsych.NO_KEYS) {
				keyboardListener = jsPsych.pluginAPI.getKeyboardResponse({
					callback_function: after_response, 
					valid_responses: trial.choices, 
					rt_method: 'performance', 
					persist: false, 
					allow_held_key: false 
				});
			}
		}
function startKeyboardListener ( ) { if ( trial . choices != jsPsych . NO_KEYS ) { keyboardListener = jsPsych . pluginAPI . getKeyboardResponse ( { callback_function : after_response , valid_responses : trial . choices , rt_method : 'performance' , persist : false , allow_held_key : false } ) ; } }
Function to start the keyboard listener
Function to start the keyboard listener
//Start the response listener if there are choices for keys //Create the keyboard listener to listen for subjects' key response //Function to call once the subject presses a valid key //The keys that will be considered a valid response and cause the callback function to be called //The type of method to record timing information. 'performance' is not yet supported by all browsers, but it is supported by Chrome. Alternative is 'date', but 'performance' is more precise. //If set to false, keyboard listener will only trigger the first time a valid key is pressed. If set to true, it has to be explicitly cancelled by the cancelKeyboardResponse plugin API. //Only register the key once, after this getKeyboardResponse function is called. (Check JsPsych docs for better info under 'jsPsych.pluginAPI.getKeyboardResponse').