A class implementing a keyboard input.
Calling expyriment.control.intialize(exp) will automatically create a keyboard instance and will reference it in exp.keyboard for easy access.
Methods
Create a keyboard input.
| Parameters : | default_keys : int or list, optional
|
|---|
Check if keypress is in event queue.
| Parameters : | default_keys : int or list, optional
check_for_control_keys : bool, optional
|
|---|---|
| Returns : | key : int
|
Clear the event queue from keyboard events.
Getter for default keys
Check if quit_key or pause_key has been pressed.
Reads pygame event cue if no key_event is specified.
| Parameters : | key_event : int, optional
|
|---|---|
| Returns : | out : bool
|
Reads out all keydown events and clears queue.
Wait for keypress(es) (optionally for a certain amount of time).
This function will wait for a keypress and returns the found key as well as the reaction time. (This function clears the event queue!)
| Parameters : | keys : int or list, optional
duration : int, optional
wait_for_keyup : bool, optional
check_for_control_keys : bool, optional
|
|---|
Wait for character(s) (optionally for a certain amount of time).
This function will wait for one or more characters and returns the found character as well as the reaction time. (This function clears the event queue!)
| Parameters : | char : int or list
duration : int, optional
check_for_control_keys : bool, optional
|
|---|---|
| Returns : | found : char
rt : int
|