0

As it's said in android developers blog:

By itself, the touch mode is something very easy to understand as it simply indicates whether the last user interaction was performed with the touch screen. For example, if you are using a G1 phone, selecting a widget with the trackball will take you out of touch mode; however, if you touch a button on the screen with your finger, you will enter touch mode. When the user is not in touch mode, we talk about the trackball mode, navigation mode or keyboard navigation...

But android is booting by default in touch mode. How can I switch device into keyboard navigation mode, or make it a default one?

I'm developing app for a specific device, so it's rooted and I can also modify firmware.

Kirill Bubochkin
  • 5,868
  • 2
  • 31
  • 50
  • You want to disable touch functionality at all programatically? Btw, seems that your quote was wrote something like 7 years ago, and probably outdated. – Divers Mar 22 '15 at 09:00
  • Well, I don't need touch functionality, because device will not have touch screen, but it's not main goal. Yes, the link is outdated, but I don't think the principles have changed very much. – Kirill Bubochkin Mar 22 '15 at 09:02
  • In general, if you will connect keyboard and mouse to any android device - it would be work well without any efforts from your side. So still don't understand what are you looking for. Furthermore, your quote says that if use will not touch screen - it automatically will go to not touch mode. On device without touch screen - user can't touch screen. – Divers Mar 22 '15 at 09:05

1 Answers1

1

You can force an Android device in or out of touch mode using Instrumentation.setInTouchMode(boolean).

new Instrumentation().setInTouchMode(false);

Running this as part of a boot receiver would probably achieve what you are looking for.

Community
  • 1
  • 1
alanv
  • 23,966
  • 4
  • 93
  • 80