1
\$\begingroup\$

I'm working on an Android app (Java, level 19+) that uses a controller to e.g. walk and it's working (almost) fine with both the Steelseries Stratus XL and the Moga Pro Power. The only problem is that the Stratus XL has a button in the middle (the one with the circle: click) that closes the app.

I now want to disable that but I have no idea what the keycode for the button is and it also doesn't say anything about it on the official Steelseries homepage.

Has anyone here worked with the Stratus XL before and knows what keycode to use?

\$\endgroup\$
  • \$\begingroup\$ If that's meant to be a "home" button, don't mess with it. The user is going to expect certain behavior from that button and you (succeeding) at disabling it will only serve to annoy the user. \$\endgroup\$ – Draco18s Jan 9 '18 at 19:13
  • \$\begingroup\$ Ah, I see, that makes stuff a lot more complicated. It's an app for Gear VR, so you shouldn't be able to even press the home button anyway (at least on the phone) but since the app is going to be used by people who don't know much about smartphones and/or have never held a controller in their life, I want to get rid of as much frustration (aka "why did the app just close, I only touched the controller?!") as possible. I guess it's not possible to just disable the button on the controller via "KEYCODE_HOME" but leave the actual one on the phone working, is it? :/ \$\endgroup\$ – Neph Jan 9 '18 at 19:25
  • 1
    \$\begingroup\$ Ahh, I see. That could be a problem, yes. My only guess is to try and read out the key-pressed-key-code value for every key/joystick button pressed and see if you can get a read on that button. My guess is that it sends the same signal as the device's own Home button, which the system intercepts and handles before the app has a change to even see it. \$\endgroup\$ – Draco18s Jan 9 '18 at 19:28
  • \$\begingroup\$ Sorry for the late reply. Thanks for the tip, going to try that then. \$\endgroup\$ – Neph Feb 6 '18 at 15:15
  • 1
    \$\begingroup\$ Just a small update: Pikalek ist right: Android doesn't let you read the keycode for the middle button, it simply doesn't output anything for it if you try and log every keycode that's used. \$\endgroup\$ – Neph Sep 5 '18 at 9:58
3
\$\begingroup\$

According to the FCC instruction filing for Stratus XL, the center round key is intended to be a home key.

If that's correct, there might not be much you can do, as the developer reference for the home key states:

KEYCODE_HOME added in API level 1 int KEYCODE_HOME Key code constant: Home key. This key is handled by the framework and is never delivered to applications.

Constant Value: 3 (0x00000003)

I searched the developer reference on supporting game controllers, but didn't see anything specific to redirecting home key requests.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.