nanogui: rotate mouse movements 90 degree in nano-X


Previous by date: 20 Feb 2007 16:27:18 +0000 Re: Changing display font in pushbutton control, jasinski.utfpr.edu.br
Next by date: 20 Feb 2007 16:27:18 +0000 Re: Changing display font in pushbutton control, Uwe Klatt
Previous in thread: 20 Feb 2007 16:27:18 +0000 Re: rotate mouse movements 90 degree in nano-X, Greg Haerr
Next in thread:

Subject: RES: [nanogui] rotate mouse movements 90 degree in nano-X
From: ####@####.####
Date: 20 Feb 2007 16:27:18 +0000
Message-Id: <20070220130235.o0qeqwv1llhc0csk@mail.utfpr.edu.br>

Hi Greg,

I'm sorry I don't remember the details right now, since It was done a while ago.
But I'm pretty sure I tried to #define FLIP_MOUSE_IN_PORTAIT_MODE with values 0
and 1 and none of them did the job of rotating the mouse movements (at least
not completely).

If I knew it should've worked, I'd have spent some more time looking at it, but
it's unlikely that I'll get back to that right now   ;-)

Thanks again!

Ricardo Jasinski
---------------------
####@####.####

------------------------
Ricardo -

Your solution is fine, but it is hardcoded in the mouse driver and doesn't allow
the display to be rotated differently at runtime.  Try changing the value of the
#define in engine/devmouse.c and see whether that works and doesn't require your
hardcoded driver mods.

Regards,

Greg

--------
I don't know it this is the best solution, but I've altered the mouse driver
Read() function like this:

+---- Original code -----+------ Modified Code -------+
|                        |#ifdef LCD_LANDSCAPE_MODE   |
|   ...                  |  *dx = delta_x;            |
|   *dx = delta_x;       |  *dy = delta_y;            |
|   *dy = delta_y;       |#else                       |
|   ...                  |  *dx = delta_y;            |
|                        |  *dy = - delta_x;          |
|                        |#endif                      |
+------------------------+----------------------------+

This finished the job of rotating the mouse movements. I also apendded the
following lines to my display driver Open() routine:

#ifdef LCD_PORTRAIT_MODE
    psd->portrait = MWPORTRAIT_LEFT;
    psd->xvirtres = psd->yres;
    psd->yvirtres = psd->xres;
    psd->orgsubdriver = &lcd_subdriver;
    set_subdriver(psd, &fbportrait_left, FALSE); #endif // LCD_PORTRAIT_MODE

but from your description it looks like you've got it done already.

Hope it helps, and if you (or someone else) come up with a better solution
please let me know!


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Previous by date: 20 Feb 2007 16:27:18 +0000 Re: Changing display font in pushbutton control, jasinski.utfpr.edu.br
Next by date: 20 Feb 2007 16:27:18 +0000 Re: Changing display font in pushbutton control, Uwe Klatt
Previous in thread: 20 Feb 2007 16:27:18 +0000 Re: rotate mouse movements 90 degree in nano-X, Greg Haerr
Next in thread:


Powered by ezmlm-browse 0.20.