Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?
like image 757
eikuh Avatar asked Jul 08 '26 15:07

eikuh


1 Answers

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.

like image 96
Zomby Avatar answered Jul 10 '26 05:07

Zomby



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!