Lucas Zawacki : joy.cpl: Added trace messages to show joystick input.

Alexandre Julliard julliard at winehq.org
Fri Jun 8 13:36:13 CDT 2012


Module: wine
Branch: master
Commit: 69dda4cdcd4a00bd6cf9cc859868711df9d74e26
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=69dda4cdcd4a00bd6cf9cc859868711df9d74e26

Author: Lucas Zawacki <lfzawacki at gmail.com>
Date:   Thu Jun  7 14:44:14 2012 -0300

joy.cpl: Added trace messages to show joystick input.

---

 dlls/joy.cpl/main.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/dlls/joy.cpl/main.c b/dlls/joy.cpl/main.c
index 1c8b6ac..2882575 100644
--- a/dlls/joy.cpl/main.c
+++ b/dlls/joy.cpl/main.c
@@ -174,6 +174,20 @@ INT_PTR CALLBACK list_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
  * Joystick testing functions
  *
  */
+static void dump_joy_state(DIJOYSTATE* st, int num_buttons)
+{
+    int i;
+    TRACE("Ax (% 5d,% 5d,% 5d)\n", st->lX,st->lY, st->lZ);
+    TRACE("RAx (% 5d,% 5d,% 5d)\n", st->lRx, st->lRy, st->lRz);
+    TRACE("Slider (% 5d,% 5d)\n", st->rglSlider[0], st->rglSlider[1]);
+    TRACE("Pov (% 5d,% 5d,% 5d,% 5d)\n", st->rgdwPOV[0], st->rgdwPOV[1], st->rgdwPOV[2], st->rgdwPOV[3]);
+
+    TRACE("Buttons ");
+    for(i=0; i < num_buttons; i++)
+        TRACE("  %c",st->rgbButtons[i] ? 'x' : 'o');
+    TRACE("\n");
+}
+
 static void poll_input(const struct Joystick *joy, DIJOYSTATE *state)
 {
     HRESULT  hr;
@@ -205,6 +219,8 @@ static DWORD WINAPI input_thread(void *param)
         int i;
         poll_input(&data->joysticks[data->chosen_joystick], &state);
 
+        dump_joy_state(&state, data->joysticks[data->chosen_joystick].num_buttons);
+
         /* Indicate pressed buttons */
         for (i = 0; i < data->joysticks[data->chosen_joystick].num_buttons; i++)
             if (state.rgbButtons[i])




More information about the wine-cvs mailing list