Mouse support

NeoTechni

Well-Known Member
Licensed User
Longtime User
I plugged a mouse into my Nexus 7 and it works great!

How do I detect right clicking and the scroll wheel though?
 

eps

Expert
Licensed User
Longtime User
there doesn't seem to be any way to find ACTION_SCROLL

According to that link there is, but only API 12+

For Api Level 12+:

  • OnGenericMotionListener has been added. I use this one to detect mouse moves withACTION_HOVER_MOVE and wheel changes with ACTION_SCROLL.
 
Upvote 0

almontgreen

Active Member
Licensed User
Longtime User
Yes, but I don't seem to be able to get it to work. I see ACTION_HOVER_MOVE but no ACTION_SCROLL in the log when I move the mouse scroll wheel. I must be missing something.
 
Upvote 0

almontgreen

Active Member
Licensed User
Longtime User
I'm running Android 4.2.2 and I don't know exactly how to specify the API (in the manifest I put 12 and then 14 but no difference)
 
Upvote 0

almontgreen

Active Member
Licensed User
Longtime User
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/> 'tried 12, 13 and 14
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
 
Upvote 0
Top