Finger on the Screen

Is possible to detect when the person put the finger on any part of screen device?

Thanks [import]uid: 26056 topic_id: 23032 reply_id: 323032[/import]

What I do is create a rectangle (display.newRect) the takes up the whole screen, set it’s alpha to 0.01 so it is invisible but still subject to touch events, then create a touch function and listener for it.
[import]uid: 64596 topic_id: 23032 reply_id: 92069[/import]

Code:

box = display.newRect(0,0,display.contentWidth,display.contentHeight)  
 box.alpha = 0.01  
  
 function box:touch(e)  
 --code to run when touched here--  
 end  
  
 box:addEventListener("touch",box)  
  

that’s it. [import]uid: 64596 topic_id: 23032 reply_id: 92070[/import]

Yeh it is right and very helpful for me, thanks shane.lipscomb :slight_smile: [import]uid: 26056 topic_id: 23032 reply_id: 92073[/import]

Glad to help.

There may be few more tricks to getting it working perfectly. Like for example the code as written will fire when the finger touches and leaves the screen, as well as if the finger moves. If you need more help with this, just post with specifics. [import]uid: 64596 topic_id: 23032 reply_id: 92078[/import]