I’m targeting Android with Titanium. How can I tell if a device has a touch screen or not?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is the solution I came up with. It’s really stupid, but it works. Wherever you create your application window, add this code:
Replace
selfwith the name of your window. Now, the first time a touch event is detected, an application property will be set.Later on, check that touch is present with this:
If you are testing this on an emulator, the property might persist even when you change “devices”. So add this line before anything else: