'Right mouse button in Android

Since API 14, right mouse clicks should have been easy to detect via getButtonState().

However, when I right-click, then it acts as the Back button. The middle button acts like the Home button. (Android 4.4, Galaxy Note 3, mouse via USB adapter)

My question:

  • Does the (smartphone/tablet) device manufactor decide what to do with right button?
  • Or do different Android versions act differently?
  • What Android versions / devices support right/middle mouse button?


Solution 1:[1]

The default behavior for the middle and right button are as you described for most devices, as is defined by the OS.

Starting at API level 14, there is a way to handle the second and third button from the MotionEvent of a GenericMotionListener.

I suggest you have a look at the answers to this similar question for more details.

Solution 2:[2]

The answer is yes, the manufacturer controls how the secondary/tertiary buttons react, because it is compiled with the kernel. Generically the right click acts as a back button, however, on a couple of my non-mainstream tablets it uses one of the mouse's side buttons to go back. Usually the wheel button goes home, all tested on my collection of devices. If you want to know how to override the default behavior, whether it be for an app or as a mod, check out my answer here: Change Mouse Right-click behavior

Hope this clears up everything

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Community
Solution 2 Community