◆ __init__()
| pygaze._keyboard.oskeyboard.OSKeyboard.__init__ |
( |
| self, |
|
|
| keylist = settings.KEYLIST, |
|
|
| timeout = settings.KEYTIMEOUT ) |
◆ get_key()
| pygaze._keyboard.oskeyboard.OSKeyboard.get_key |
( |
| self, |
|
|
| keylist = u'default', |
|
|
| timeout = u'default', |
|
|
| flush = False ) |
Wait for keyboard input
arguments
None
keyword arguments
keylist -- list of keys that are allowed (e.g.
['1','a','enter']), None to allow all keys or
'default' to use klist property (default = 'default')
timeout -- time in milliseconds after which None is returned
when no keypress is registered (default = None);
None for no timeout or 'default' to use the timeout
property (default = 'default')
flush -- Boolean indicating if all input from before
calling get_key should be ignored, if set to
False keypresses from before calling this
function will be registered, otherwise every
keyboard input from before calling this function
will be flushed (default = False)
returns
key, presstime -- key is a string, indicating which button has
been pressed or None when no key has been
pressed
presstime is the time (measured from
expbegintime) a keypress or a timeout occured
Reimplemented from pygaze._keyboard.basekeyboard.BaseKeyboard.
◆ set_keylist()
| pygaze._keyboard.oskeyboard.OSKeyboard.set_keylist |
( |
| self, |
|
|
| keylist = None ) |
Set a list of accepted keys
arguments
None
keyword arguments
keylist -- list of keys that are allowed (e.g.
['1','a','enter']) or None to allow all keys
(default = None)
returns
None -- sets klist property
Reimplemented from pygaze._keyboard.basekeyboard.BaseKeyboard.
◆ set_timeout()
| pygaze._keyboard.oskeyboard.OSKeyboard.set_timeout |
( |
| self, |
|
|
| timeout = None ) |
Set a timeout (in milliseconds)
arguments
None
keyword arguments
timeout -- time in milliseconds after which None is returned
on a call to get_key method when no keypress is
registered (default = None)
returns
None -- sets timeout property
Reimplemented from pygaze._keyboard.basekeyboard.BaseKeyboard.
◆ experiment
| pygaze._keyboard.oskeyboard.OSKeyboard.experiment = settings.osexperiment |
◆ keyboard
| pygaze._keyboard.oskeyboard.OSKeyboard.keyboard |
Initial value:= keyboard(self.experiment, keylist=keylist,
timeout=timeout)
The documentation for this class was generated from the following file: