[<<] [<] Page 1 of 1 [>] [>>] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Mouse/touchscreen at the same time is solved -> But I cannot show the cursor/mouse pointer when moving by mouse!
From: "Wein, Peter (ext)" ####@####.#### Date: 20 Nov 2007 16:54:20 +0000 Message-Id: <0C9BD57BDE7F5947B6E8AF9C655EBD99012433D5@khes0e1a.ww001.siemens.net> Hello Greg, hello everybody, it seems, that my mouse/touch-twin works, at least with the famous ntetris. But one problem remains unsolved: I could not switch between visible cursor and invisible cursor. Neither with function GrInjectPointerEvent(GR_COORD x, GR_COORD y, int button, int visible) nor directly with GrShowCursor/&scrdev);/GrHideCursor(&scrdev);. I have implemented it in my two function GsCheckMouseEvent and GsCheckTouchEvent. Once the cursor disappears, and it even disappears when using first the mouse instead of the touch, it stays disappeared (on startup you can see the mouse pointer). If I let the functions without calling the above mentioned functions, there is no problem at all and I can work both the touchscreen and the mouse with the mousepointer beeing the whole time showing. My code is /* * Update mouse status and issue events on it if necessary. * This function doesn't block, but is normally only called when * there is known to be some data waiting to be read from the mouse. */ GR_BOOL GsCheckMouseEvent(void) { GR_COORD rootx; /* latest mouse x position */ GR_COORD rooty; /* latest mouse y position */ int newbuttons; /* latest buttons */ int mousestatus; /* latest mouse status */ /* Read the latest mouse status: */ mousestatus = GdReadMouse(&rootx, &rooty, &newbuttons); if(mousestatus < 0) { GsError(GR_ERROR_MOUSE_ERROR, 0); return FALSE; } else if(mousestatus) { /* Deliver events as appropriate: */ GdHideCursor(&scrdev); GdShowCursor(&scrdev); GsHandleMouseStatus(rootx, rooty, newbuttons); /* possibly reset portrait mode based on mouse position*/ if (autoportrait) GsSetPortraitModeFromXY(rootx, rooty); return TRUE; } return FALSE; } /* * Update touch status and issue events on it if necessary. * This function doesn't block, but is normally only called when * there is known to be some data waiting to be read from the touch. */ GR_BOOL GsCheckTouchEvent(void) { GR_COORD rootx; /* latest touch x position */ GR_COORD rooty; /* latest touch y position */ int newbuttons; /* latest buttons */ int touchstatus; /* latest touch status */ /* Read the latest touch status: */ touchstatus = GdReadTouch(&rootx, &rooty, &newbuttons); if(touchstatus < 0) { GsError(GR_ERROR_MOUSE_ERROR, 0); return FALSE; } else if(touchstatus) { /* Deliver events as appropriate: */ GdHideCursor(&scrdev); GsHandleMouseStatus(rootx, rooty, newbuttons); /* possibly reset portrait mode based on touch position*/ if (autoportrait) GsSetPortraitModeFromXY(rootx, rooty); return TRUE; } return FALSE; } and it does also not works if I implement it in devmouse.c in functions GdReadMouse and GdReadTouch.Why is that? Any idea? Mit freundlichen Grüßen/Best Regards Peter Wein SIEMENS AG Electronic Design and Manufacturing Services I&S EDM E STG Dipl.-Ing. (FH) Peter Wein Entwicklung Software Postfach 10 60 26 Weissacher Str. 11 D-70499 Stuttgart Tel.: +49 (0) 711 /-137-6757 Fax: +49 (0) 711 /-137-6071 ####@####.#### Siemens Aktiengesellschaft: Vorsitzender des Aufsichtsrats: Gerhard Cromme; Vorstand: Klaus Kleinfeld, Vorsitzender; Johannes Feldmayer, Joe Kaeser, Rudi Lamprecht, Eduardo Montes, Jürgen Radomski, Erich R. Reinhardt, Hermann Requardt, Uriel J. Sharef, Klaus Wucherer; Sitz der Gesellschaft: Berlin und München; Registergericht: Berlin Charlottenburg, HRB 12300, München, HRB 6684; WEEE-Reg.-Nr. DE 23691322 Wichtiger Hinweis: Diese E-Mail und etwaige Anlagen enthält firmenvertrauliche Informationen. Sollten Sie diese E-Mail irrtümlich erhalten haben, benachrichtigen Sie uns bitte durch Antwort-Mail und löschen Sie diese E-Mail nebst Anlagen von Ihrem System. Vielen Dank. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: [nanogui] Mouse/touchscreen at the same time is solved -> But I cannot show the cursor/mouse pointer when moving by mouse!
From: "Greg Haerr" ####@####.#### Date: 21 Nov 2007 21:17:22 +0000 Message-Id: <0cff01c82c83$cab92b90$0300a8c0@RDP> > I could not switch between visible cursor and invisible cursor. Once the > cursor disappears, and it even disappears when using first the mouse > instead of the touch, it stays disappeared (on startup you can see the > mouse pointer). Peter - I don't have the time to completely debug your code, as well I don't have a touchscreen/mouse combo to test it with. That said, I suggest you put a printf() in the GdHideCursor and GdShowCursor routines. Both use a global counter which is used to determine when the cursor should actually get redisplayed. That is, if you call hide twice and show once, the cursor won't be displayed. I suspect that's where your problem is, non-matched pairs of hide/show. The printfs or other debugging will show you where the problem lies. Hope this helps, Greg | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[<<] [<] Page 1 of 1 [>] [>>] |