Author: duncan
Date: Wed Oct 18 22:38:52 2006
New Revision: 8415
Modified:
branches/rel-1/freevo/freevo_config.py
branches/rel-1/freevo/local_conf.py.example
branches/rel-1/freevo/src/rc.py
Log:
Changes merged from rel-1-6 branch
Modified: branches/rel-1/freevo/freevo_config.py
==============================================================================
--- branches/rel-1/freevo/freevo_config.py (original)
+++ branches/rel-1/freevo/freevo_config.py Wed Oct 18 22:38:52 2006
@@ -499,8 +499,10 @@
KEYMAP = DEFAULT_KEYMAP
#
-# List of /dev/input/event# devices to monitor. If you monitor your keyboard
-# both here and with USE_SDL_KEYBOARD, then you will get duplicate events.
+# List of /dev/input/event# devices to monitor. You can specify either the
+# device node (e.g. '/dev/input/event1') or the name of the device (e.g.
+# 'ATI Remote Wonder II'). If you monitor your keyboard both here and with
+# USE_SDL_KEYBOARD, then you will get duplicate events.
#
EVENT_DEVS = []
Modified: branches/rel-1/freevo/local_conf.py.example
==============================================================================
--- branches/rel-1/freevo/local_conf.py.example (original)
+++ branches/rel-1/freevo/local_conf.py.example Wed Oct 18 22:38:52 2006
@@ -252,9 +252,10 @@
#
#
-# List of /dev/input/event# devices to monitor. If you monitor your keyboard
-# both here and with USE_SDL_KEYBOARD, then you will get duplicate events.
-#
+# List of /dev/input/event# devices to monitor. You can specify either the
+# device node (e.g. '/dev/input/event1') or the name of the device (e.g.
+# 'ATI Remote Wonder II'). If you monitor your keyboard both here and with
+# USE_SDL_KEYBOARD, then you will get duplicate events.
#
# EVENT_DEVS = []
Modified: branches/rel-1/freevo/src/rc.py
==============================================================================
--- branches/rel-1/freevo/src/rc.py (original)
+++ branches/rel-1/freevo/src/rc.py Wed Oct 18 22:38:52 2006
@@ -313,12 +313,34 @@
self._devs = []
for dev in config.EVENT_DEVS:
- try:
- e = evdev.evdev(dev)
+ e = None
+
+ if os.path.exists(dev):
+ try:
+ e = evdev.evdev(dev)
+ except:
+ print "Problem opening event device '%s'" % dev
+ else:
+ name = dev
+ for dev in os.listdir('/dev/input'):
+ if not dev.startswith('event'):
+ continue
+
+ try:
+ dev = '/dev/input/' + dev
+ e = evdev.evdev(dev)
+ except:
+ continue
+
+ if e.get_name() == name:
+ break
+ else:
+ e = None
+ print "Could not find any device named '%s'" % name
+
+ if e is not None:
print "Added input device '%s': %s" % (dev, e.get_name())
self._devs.append(e)
- except:
- print "Problem opening event device '%s'" % dev
def poll(self, rc):
"""
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog