×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    72

    Way to get Touch position

    Hi everyone,

    I have encountered a problem when getting touch position in 5800, I found a touch example called finger paint, but when I install into 5800, it doesn't work, is that any get touch position example that can provide?

    Thanks for advance.

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Way to get Touch position

    Finger paint http://doc.qt.nokia.com/4.6/multitouch-fingerpaint.html is using touch events, which are not available on Symbian.

  3. #3
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    72

    Re: Way to get Touch position

    @daniil

    so, any get touch position example can work on 5800?

  4. #4
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Way to get Touch position

    Last edited by divanov; 2010-07-09 at 11:50. Reason: fixing a typo

  5. #5
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: Way to get Touch position

    This is from a QMainWidget, and is currently sold on Ovi. Take out what you dont need:
    Code:
    void QtBallZ::mouseReleaseEvent ( QMouseEvent * event )
    {
    	myMovingMouse=false;
    
    	if(((event->globalX()-4) / 11 + 1)>40 || ((event->globalY()-4) / 11 + 1)>32)
    	{//This is a status bar tap for exit
    		if(event->globalY()<50)
    		{
    			clearDS();
    			ApplicationPrefs::savePrefs();
    			exit(0);
    			return;
    		}
    	}
    	
    	if(enginestate==STATE_GAME && !paused)
    				{
    					if(((event->globalX()-4) / 11 + 1)>40 || ((event->globalY()-4) / 11 + 1)>32)
    					{//This is a status bar tap
    						if(event->globalY()>280)
    							hor=!hor;
    						return;
    					}
    					if(wallparams.horizontala || wallparams.horizontalb || wallparams.verticala || wallparams.verticalb)
    					{
    						return;
    					}
    					wallparams.x=(event->globalX()-4) / 11 + 1;
    					wallparams.y=(event->globalY()-4) / 11 + 1;
    					if(walls[wallparams.x][wallparams.y]==0 && !paused)
    					{//Reduce overhead if user taps stupidly on an already 255 area
    						if(hor)
    						{
    							wallparams.horizontala=wallparams.horizontalb=true;
    							wallparams.active=true;
    						}
    						else
    						{
    							wallparams.verticala=wallparams.verticalb=true;
    							wallparams.active=true;
    						}
    						walls[wallparams.x][wallparams.y]=1;
    					}
    				}
    
    				else
    				{//Command handling
    					int i;
    					handleCommand:
    					//Protect button
    					{
    						/*if((pEvent->screenX <30) && (pEvent->screenY>130))
    						{
    							handled=false;
    							break;
    						}*/
    					}
    					for(i=0;i<10;i++)
    					{//Praise the QT for the weird factors
    						if(textparams[i].active && textparams[i].position.contains(event->globalX(),event->globalY()))
    						{
    							doMenu(textparams[i].tapid);
    						}
    					}
    					
    				}
    }
    
    void QtBallZ::mouseMoveEvent ( QMouseEvent * event )
    {
    	myMouseX=event->globalX();
    	myMouseY=event->globalY();
    }
    
    void QtBallZ::mousePressEvent ( QMouseEvent * event )
    {
    	myMovingMouse=true;
    	myMouseX=event->globalX();
    	myMouseY=event->globalY();
    }
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

Similar Threads

  1. [Annouce] Toolbar on canvas for touch and non touch S60 devices
    By marcelobarrosalmeida in forum Symbian
    Replies: 4
    Last Post: 2009-06-11, 03:32
  2. Replies: 1
    Last Post: 2009-04-02, 07:50
  3. alternative to multi touch - zoom and rotate control on single touch
    By shpe11 in forum [Archived] Flash Lite on Nokia Devices
    Replies: 11
    Last Post: 2009-03-28, 19:14
  4. multi-touch alternative for single-touch mobile devices - RELEASE (alpha))
    By shpe11 in forum [Archived] Flash Lite on Nokia Devices
    Replies: 1
    Last Post: 2009-03-28, 19:14
  5. Replies: 2
    Last Post: 2009-03-28, 18:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×