[svn] r6755 - in trunk/tools/wiipresent: . docs

packagers at lists.rpmforge.net packagers at lists.rpmforge.net
Wed Apr 8 01:20:04 CEST 2009


Author: dag
Date: 2009-04-08 00:20:04 +0100 (Wed, 08 Apr 2009)
New Revision: 6755

Modified:
   trunk/tools/wiipresent/README
   trunk/tools/wiipresent/TODO
   trunk/tools/wiipresent/docs/wiipresent.1
   trunk/tools/wiipresent/wiipresent.c
Log:
Small set of changes.

Modified: trunk/tools/wiipresent/README
===================================================================
--- trunk/tools/wiipresent/README	2009-04-07 21:40:04 UTC (rev 6754)
+++ trunk/tools/wiipresent/README	2009-04-07 23:20:04 UTC (rev 6755)
@@ -1,12 +1,13 @@
 = WiiPresent - Presentations using the Wiimote
 
 WiiPresent is a small program that enables you to use a Nintendo WiiMote
-for giving presentationsi using Open Office, xpdf, evince or Acrobat Reader.
+for giving presentations using Open Office, xpdf, evince or Acrobat Reader.
+It was designed as an off-the-shelf tool with no need to customize it.
 
 But WiiPresent can also control multimedia applications or firefox.
-
 It does this by translating WiiMote events into keypresses for applications.
 
+
 == Build requirements
 You need the following libraries in order to build and use WiiPresent:
 
@@ -15,7 +16,11 @@
  - bluez libraries and headers
  - libcwiimote libraries and headers (build with -D_NO_BLOCKING_UPDATE)
 
-== Keys in NORMAL mode
+We tried to minimize the dependencies for WiiPresent.
+
+
+== Key mappings
+=== Keys in NORMAL mode
 - left/right: change slide/channel/tab
 - up/down: change volume/change link
 - -/+: change volume/zoom
@@ -24,15 +29,17 @@
 - home: back/home
 - exit: unavailable
 
-== Keymaps in WINDOW mode (B)
+=== Keymaps in WINDOW mode (B)
 - B+A: Enable/disable mouse-mode
 - B+up/down: scroll up and down
 - B+left/right: switch between applications
 - B+minus/plus: change workspace
 - B+2: blank screen/mute audio
 
-== Keymaps in MOUSE mode
+=== Keymaps in MOUSE mode
 - left/right: switch between applications
 - up/down: scroll up/down
 - -/+: left and right mouse-buttons
 - A: left mouse-button
+
+// vim: set syntax=asciidoc:

Modified: trunk/tools/wiipresent/TODO
===================================================================
--- trunk/tools/wiipresent/TODO	2009-04-07 21:40:04 UTC (rev 6754)
+++ trunk/tools/wiipresent/TODO	2009-04-07 23:20:04 UTC (rev 6755)
@@ -5,7 +5,9 @@
 - Make sound when presentation is over
 - Record timings and print timestamp + keypress
   (follow keypresses so we know on what slide we are too)
-- Make the mouse pointer move based on IR data
+- Make the mouse pointer move based on IR data (use WMD implementation)
+- Report when batteries of IR sensorbar are low
+  (calculate distance and compare with dot strength)
 - Implement the power button to disconnect the device cleanly
   (this is a bug in libwiimote)
 - Use playertoggle to switch between skip forward and next playback
@@ -21,4 +23,4 @@
 
 == Bugs in libwiimote
 - Battery status updates do not seem to work ?
-- Infrared only works when we acceleration sensors are enabled
+- Infrared only works when acceleration sensors are enabled

Modified: trunk/tools/wiipresent/docs/wiipresent.1
===================================================================
--- trunk/tools/wiipresent/docs/wiipresent.1	2009-04-07 21:40:04 UTC (rev 6754)
+++ trunk/tools/wiipresent/docs/wiipresent.1	2009-04-07 23:20:04 UTC (rev 6755)
@@ -2,7 +2,7 @@
 .\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
 .\" Instead of manually editing it, you probably should edit the DocBook XML
 .\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "WIIPRESENT" "1" "03/02/2009" "" ""
+.TH "WIIPRESENT" "1" "03/17/2009" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -23,9 +23,15 @@
 \-d name, \-\-display=name
 X display to use
 .TP
+\-i, \-\-infrared
+use infrared sensor to move mouse pointer
+.TP
 \-l length, \-\-length=minutes
 presentation length in minutes
 .TP
+\-t, \-\-tilt
+use tilt sensors to move mouse pointer
+.TP
 \-h, \-\-help
 display this help and exit
 .TP

Modified: trunk/tools/wiipresent/wiipresent.c
===================================================================
--- trunk/tools/wiipresent/wiipresent.c	2009-04-07 21:40:04 UTC (rev 6754)
+++ trunk/tools/wiipresent/wiipresent.c	2009-04-07 23:20:04 UTC (rev 6755)
@@ -53,7 +53,7 @@
 int prefer_blanking_return = 0;
 int allow_exposures_return = 0;
 
-static void XFakeKeycode(int keycode, int modifiers){
+static void XFakeKeypress(int keycode, int modifiers) {
     if ( modifiers & ControlMask )
         XTestFakeKeyEvent(display, XKeysymToKeycode(display, XK_Control_L), True, 0);
 
@@ -69,7 +69,9 @@
     XTestFakeKeyEvent(display, XKeysymToKeycode(display, keycode), True, 0);
 
     XSync(display, False);
+}
 
+static void XFakeKeyrelease(int keycode, int modifiers) {
     XTestFakeKeyEvent(display, XKeysymToKeycode(display, keycode), False, 0);
 
     if ( modifiers & ShiftMask )
@@ -83,8 +85,15 @@
 
     if ( modifiers & ControlMask )
         XTestFakeKeyEvent(display, XKeysymToKeycode(display, XK_Control_L), False, 0);
+
+    XSync(display, False);
 }
 
+static void XFakeKeycode(int keycode, int modifiers) {
+    XFakeKeypress(keycode, modifiers);
+    XFakeKeyrelease(keycode, modifiers);
+}
+
 void XMovePointer(Display *display, int xpos, int ypos, int relative) {
     if (relative)
         XTestFakeRelativeMotionEvent(display, xpos, ypos, 0);
@@ -210,8 +219,9 @@
 
     int c;
 
-    // Make stdout unbuffered
+    // Make stdout and stderr unbuffered
     setvbuf(stdout, NULL, _IONBF, 0);
+    setvbuf(stderr, NULL, _IONBF, 0);
 
     while (1) {
         int option_index = 0;
@@ -499,6 +509,7 @@
 
         // WINDOW MODE
         if (wmote.keys.b) {
+
             if (wmote.keys.a) {
                 mousemode = ! mousemode;
                 if (mousemode) {
@@ -541,16 +552,6 @@
                 }
             }
 
-            // Page up
-            if (wmote.keys.up) {
-                XFakeKeycode(XK_Page_Up, 0);
-            }
-
-            // Page down
-            if (wmote.keys.down) {
-                XFakeKeycode(XK_Page_Down, 0);
-            }
-
             // FIXME: We have to keep Alt pressed if we want to browse between apps
             if (wmote.keys.left) {
                 XFakeKeycode(XK_Tab, Mod1Mask | ShiftMask);




More information about the commits mailing list