Module easyinput :: Class easyinput
[frames] | no frames]

Class easyinput

source code


A class to ease the input bind of actions. Setup:

Instance Methods
 
__init__(self, config='', bridge={}, debug=False) source code
 
action(self, evt=None)
evt=0 or 1
source code
 
add_config(self, config)
Merge a text file config in the main config data collector where the latter override the former
source code
 
alwaysrunToggle(self, evt=None)
evt=0 or 1
source code
 
back(self, evt=None)
evt=0 to 1
source code
 
dbgprint(self, msg) source code
 
finish(self)
Invoke this before this class object will be off duty
source code
 
forward(self, evt=None)
evt=0 to 1
source code
 
headdown(self, evt=None)
evt=0 to 1
source code
 
heading(self, evt=None)
evt=-1.
source code
 
headup(self, evt=None)
evt=0 to 1
source code
 
jump(self, evt=None)
evt=0 or 1
source code
 
left(self, evt=None)
evt=0 to 1
source code
 
pitch(self, evt=None)
evt=-1.
source code
 
pyga_joysetup(self)
Pygame joystick(s) startup - returns the number of joysticks found
source code
 
pyga_joytask(self, task)
If there is a joy event it will be sent a proper string message and event value to the messenger queue
source code
 
quitme(self, evt=None)
evt=0 or 1
source code
 
right(self, evt=None)
evt=0 to 1
source code
 
run(self, evt=None)
evt=0 or 1
source code
 
set_mouse_read(self, readmouse, activate) source code
 
thrust(self, evt=None)
evt=-1.
source code
 
zoom(self, evt=None) source code

Inherited from direct.showbase.DirectObject.DirectObject: accept, acceptOnce, addTask, classTree, detectLeaks, doMethodLater, getAllAccepting, ignore, ignoreAll, isAccepting, isIgnoring, removeAllTasks, removeTask

Class Variables
  DEFAULT_CONFIG = '\n//JOY ------\nbind joy0-button1 "action"\n...
  mouse_speed_factor = 5.0
Method Details

__init__(self, config='', bridge={}, debug=False)
(Constructor)

source code 
Parameters:
  • config - \n sepatated string of 3 element lines: [0]=bind [1]=event name [2]=bridge keyword.
  • bridge - dictionary of event keyword:handler elements.
Overrides: direct.showbase.DirectObject.DirectObject.__init__

heading(self, evt=None)

source code 

evt=-1. to 1. - for x movements to use for steering

pitch(self, evt=None)

source code 

evt=-1. to 1. - for z movements by default the evt collect headup and headdown events override or bind this in your subclass

thrust(self, evt=None)

source code 

evt=-1. to 1. - for y movements by default the evt collect forward and back events override or bind this in your subclass


Class Variable Details

DEFAULT_CONFIG

Value:
'''
//JOY ------
bind joy0-button1 "action"
//+- y axis movement : by default will fire forward/back events
bind joy0-axis1 "thrust"
bind joy0-button2 "jump"
//+- x axis movement : by default will fire moveleft/moveright events
bind joy0-axis0 "heading"
...