gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] libvob org/nongnu/libvob/input/impl/RelativeAxi...


From: Tuomas J. Lukka
Subject: [Gzz-commits] libvob org/nongnu/libvob/input/impl/RelativeAxi...
Date: Mon, 30 Jun 2003 03:47:16 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Branch:         
Changes by:     Tuomas J. Lukka <address@hidden>        03/06/30 03:47:16

Modified files:
        org/nongnu/libvob/input/impl: RelativeAxis.java 
        vob/demo/input : bars.py 
Added files:
        test/vob/input : axes.test 

Log message:
        Fix test

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/input/impl/RelativeAxis.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/test/vob/input/axes.test?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/demo/input/bars.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: libvob/org/nongnu/libvob/input/impl/RelativeAxis.java
diff -u libvob/org/nongnu/libvob/input/impl/RelativeAxis.java:1.1 
libvob/org/nongnu/libvob/input/impl/RelativeAxis.java:1.2
--- libvob/org/nongnu/libvob/input/impl/RelativeAxis.java:1.1   Mon Jun 30 
03:08:31 2003
+++ libvob/org/nongnu/libvob/input/impl/RelativeAxis.java       Mon Jun 30 
03:47:16 2003
@@ -28,7 +28,7 @@
            return;
        if(absListener != null)
            absListener.changedAbsolute(
-               rawValue - min / (float)(max - min));
+               (rawValue - min) / (float)(max - min));
     }
 
 
@@ -64,8 +64,10 @@
            choiceDistance = 0;
        if(state == InputDeviceManager.STATE_CALIBRATING)
            calMin = calMax = rawValue;
-       if(state == InputDeviceManager.STATE_NORMAL)
+       if(state == InputDeviceManager.STATE_NORMAL) {
+           min = calMin; max = calMax;
            callAbs();
+       }
     }
 
     public float getChoiceProbability() {
Index: libvob/vob/demo/input/bars.py
diff -u libvob/vob/demo/input/bars.py:1.1 libvob/vob/demo/input/bars.py:1.2
--- libvob/vob/demo/input/bars.py:1.1   Mon Jun 30 03:25:32 2003
+++ libvob/vob/demo/input/bars.py       Mon Jun 30 03:47:16 2003
@@ -6,7 +6,8 @@
 
 class Scene:
     def __init__(self):
-       self.ps2 = vob.input.impl.PS2MouseDevice("/dev/ttyS0", "main")
+       self.ps2 = vob.input.impl.PS2MouseDevice("/dev/input/mouse1", "main",
+                       vob.input.impl.PS2MouseDevice.IMPS_PROTO)
        self.axes = [
            vob.input.impl.StandardBoundedFloatModel(0, 400,
                actionPerformed = lambda x: vob.AbstractUpdateManager.chg())




reply via email to

[Prev in Thread] Current Thread [Next in Thread]