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 : | 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
Getter for logging.
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.
Set logging of this object on or off
| Parameters : | onoff : bool 
  | 
|---|
Notes
See also design.experiment.set_log_level fur further information about event logging.
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 
  | 
|---|---|
| Returns : | found : char 
 rt : int 
  | 
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 
  |