Eyetracker
 
Loading...
Searching...
No Matches
pygaze._joystick.pygamejoystick.PyGameJoystick Class Reference
Inheritance diagram for pygaze._joystick.pygamejoystick.PyGameJoystick:
pygaze._joystick.basejoystick.BaseJoystick

Public Member Functions

 __init__ (self, joybuttonlist=settings.JOYBUTTONLIST, timeout=settings.JOYTIMEOUT)
 
 set_joybuttonlist (self, joybuttonlist=None)
 
 set_timeout (self, timeout=None)
 
 get_joybutton (self, joybuttonlist='default', timeout='default')
 
 get_joyaxes (self, timeout='default')
 
 get_joyballs (self, timeout='default')
 
 get_joyhats (self, timeout='default')
 
 get_joyinput (self, joybuttonlist='default', timeout='default')
 
- Public Member Functions inherited from pygaze._joystick.basejoystick.BaseJoystick
 __init__ (self)
 

Public Attributes

 js = Joystick(0)
 
list jbuttonlist = None
 
 timeout = timeout
 

Detailed Description

A joystick for collecting responses

Constructor & Destructor Documentation

◆ __init__()

pygaze._joystick.pygamejoystick.PyGameJoystick.__init__ ( self,
joybuttonlist = settings.JOYBUTTONLIST,
timeout = settings.JOYTIMEOUT )
Initializes joystick object (joybuttonlist: list of buttons; timeout: timeout in ms)
        
        arguments
        None
        
        keyword arguments
        joybuttonlist   -- list of joystick buttons that are allowed (e.g.
                       [0,2,4]) or None to allow all buttons
                       (default = JOYBUTTONLIST)
        timeout -- time in milliseconds after which None is returned
                   on a call to a get_* method when no input is
                   registered (default = JOYTIMEOUT)

Member Function Documentation

◆ get_joyaxes()

pygaze._joystick.pygamejoystick.PyGameJoystick.get_joyaxes ( self,
timeout = 'default' )
Waits for joystick axis movement
        
        arguments
        None
        
        keyword arguments
        timeout -- time in milliseconds after which None is returned
                   when no buttonpress is registered; None for no
                   timeout or 'default' to use the timeout property
                   (default = 'default')
        
        returns
        axespos, time   -- axespos is a [x,y,z] position list for the
                       positions of the joystick axes (usually [x,y,z]
                       for the main stick); x, y and z are floats
                       time is the time (measured from expbegintime)
                       an axismovement or a timeout occured

Reimplemented from pygaze._joystick.basejoystick.BaseJoystick.

◆ get_joyballs()

pygaze._joystick.pygamejoystick.PyGameJoystick.get_joyballs ( self,
timeout = 'default' )
Waits for joystick trackball movement
        
        arguments
        None
        
        keyword arguments
        timeout -- time in milliseconds after which None is returned
                   when no buttonpress is registered; None for no
                   timeout or 'default' to use the timeout property
                   (default = 'default')
        
        returns
        ballpos, time   -- ballpos is a [ball1,ball2,...,ballN] position
                       list for the positions of the joystick balls;
                       each ball position is a (x,y) tuple
                       time is the time (measured from expbegintime) a
                       ballmovement or a timeout occured

Reimplemented from pygaze._joystick.basejoystick.BaseJoystick.

◆ get_joybutton()

pygaze._joystick.pygamejoystick.PyGameJoystick.get_joybutton ( self,
joybuttonlist = 'default',
timeout = 'default' )
Waits for joystick buttonpress
        
        arguments
        None
        
        keyword arguments
        joybuttonlist   -- list of buttons that are allowed (e.g.
                       [0,2,4]), None to allow all buttons or
                       'default' to use jbuttonlist property
                       (default = 'default')
        timeout -- time in milliseconds after which None is returned
                   when no buttonpress is registered; None for no
                   timeout or 'default' to use the timeout property
                   (default = 'default')
        
        returns
        button, presstime   -- button is an integer, indicating which button
                       has been pressed or None when no button has
                       been pressed
                       presstime is the time (measured from
                       expbegintime) a buttonpress or a timeout
                       occured

Reimplemented from pygaze._joystick.basejoystick.BaseJoystick.

◆ get_joyhats()

pygaze._joystick.pygamejoystick.PyGameJoystick.get_joyhats ( self,
timeout = 'default' )
Waits for joystick hat movement
        
        arguments
        None
        
        keyword arguments
        timeout -- time in milliseconds after which None is returned
                   when no buttonpress is registered; None for no
                   timeout or 'default' to use the timeout property
                   (default = 'default')
        
        returns
        hatpos, time    -- hatpos is a [hat1,hat2,...,hatN] position list
                       for the positions of the joystick hats; each
                       hat position is a (x,y) tuple
                       time is the time (measured from expbegintime) a
                       hatmovement or a timeout occured

Reimplemented from pygaze._joystick.basejoystick.BaseJoystick.

◆ get_joyinput()

pygaze._joystick.pygamejoystick.PyGameJoystick.get_joyinput ( self,
joybuttonlist = 'default',
timeout = 'default' )
Waits for any kind of joystick input
        
        arguments
        None
        
        keyword arguments
        joybuttonlist   -- list of buttons that are allowed (e.g.
                       [0,2,4]), None to allow all buttons or
                       'default' to use jbuttonlist property
                       (default = 'default')
        timeout -- time in milliseconds after which None is returned
                   when no buttonpress is registered; None for no
                   timeout or 'default' to use the timeout property
                   (default = 'default')
        
        returns
        event, input, time  -- event is a string or None on a timeout,
                           indicating what kind of input was given:
                           'joybuttonpress', input is an integer
                           button number
                           'joyaxismotion', input is a [x,y,z]
                           position list for the positions of the
                           joystick axes (usually [x,y,z] for the
                           main stick); x, y and z are floats
                           'joyballmotion', input is a
                           [ball1,ball2,...,ballN] position list for
                           the positions of the joystick balls; each
                           ball position is a (x,y) tuple
                           'joyhatmotion', input is a
                           [hat1,hat2,...,hatN] position list for
                           the positions of the joystick hats; each
                           hat position is a (x,y) tuple
                           time is the time (measured from
                           expbegintime) any input or a timeout
                           occured

Reimplemented from pygaze._joystick.basejoystick.BaseJoystick.

◆ set_joybuttonlist()

pygaze._joystick.pygamejoystick.PyGameJoystick.set_joybuttonlist ( self,
joybuttonlist = None )
Set a list of accepted joystick buttons
        
        arguments
        None
        
        keyword arguments
        joybuttonlist   -- list of joystick buttons that are allowed (e.g.
                       [0,2,4]) or None to allow all buttons
                       (default = None)
        returns
        Nothing -- sets the jbuttonlist property

Reimplemented from pygaze._joystick.basejoystick.BaseJoystick.

◆ set_timeout()

pygaze._joystick.pygamejoystick.PyGameJoystick.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_clicked method when no click is
                   registered (default = None)
        
        returns
        Nothing -- sets timeout property

Reimplemented from pygaze._joystick.basejoystick.BaseJoystick.

Member Data Documentation

◆ jbuttonlist

list pygaze._joystick.pygamejoystick.PyGameJoystick.jbuttonlist = None

◆ js

pygaze._joystick.pygamejoystick.PyGameJoystick.js = Joystick(0)

◆ timeout

pygaze._joystick.pygamejoystick.PyGameJoystick.timeout = timeout

The documentation for this class was generated from the following file: