Update of /cvsroot/freevo/freevo/src/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv6800
Modified Files:
joy.py
Log Message:
Patch from Dan Eriksen that:
- crash when plugin is activated, but no device is specified in config
- bad/confusing error message
- treat joystick axis as bool input (adds a dead zone, fixes jitter problems with
analog joysticks)
Index: joy.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/plugins/joy.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** joy.py 11 Jul 2003 02:02:29 -0000 1.4
--- joy.py 20 Jul 2003 14:37:25 -0000 1.5
***************
*** 12,15 ****
--- 12,21 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.5 2003/07/20 14:37:25 rshortt
+ # Patch from Dan Eriksen that:
+ # - crash when plugin is activated, but no device is specified in config
+ # - bad/confusing error message
+ # - treat joystick axis as bool input (adds a dead zone, fixes jitter problems with
analog joysticks)
+ #
# Revision 1.4 2003/07/11 02:02:29 rshortt
# Fix for new events, we must call rc.key_event_mapper for the right event
***************
*** 84,88 ****
except OSError:
print 'Unable to open %s, trying /dev/js%s...' % \
! (self.device_name, self.device_name)
self.device_name = '/dev/js'+str((config.JOY_DEV - 1))
--- 90,94 ----
except OSError:
print 'Unable to open %s, trying /dev/js%s...' % \
! (self.device_name, str((config.JOY_DEV - 1)))
self.device_name = '/dev/js'+str((config.JOY_DEV - 1))
***************
*** 119,132 ****
sleep(0.3) # the direction pad can use lower debounce time
if data[2] == 2:
! if ((data[3] == 1) & (data[1] < 0)):
button = 'up'
command = config.JOY_CMDS['up']
! if ((data[3] == 1) & (data[1] > 0)):
button = 'down'
command = config.JOY_CMDS['down']
! if ((data[3] == 0) & (data[1] < 0)):
button = 'left'
command = config.JOY_CMDS['left']
! if ((data[3] == 0) & (data[1] > 0)):
button = 'right'
command = config.JOY_CMDS['right']
--- 125,138 ----
sleep(0.3) # the direction pad can use lower debounce time
if data[2] == 2:
! if ((data[3] == 1) & (data[1] < -16384)):
button = 'up'
command = config.JOY_CMDS['up']
! if ((data[3] == 1) & (data[1] > 16384)):
button = 'down'
command = config.JOY_CMDS['down']
! if ((data[3] == 0) & (data[1] < -16384)):
button = 'left'
command = config.JOY_CMDS['left']
! if ((data[3] == 0) & (data[1] > 16384)):
button = 'right'
command = config.JOY_CMDS['right']
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog