Handling MotionEvents from an AccessibilityService RRS feed

  • Question

  • User398681 posted

    Greetings all,

    I am working on an AccessibilityService that takes input from game controllers (PS5 controller, Xbox Controller, etc.), I am using OnKeyEvent() for handling button presses and releases ,however I am having a lot of trouble figuring out how to receive input from the Joysticks.

    Generally I would use OnGenericMotionEvent() to handle MotionEvents from the joysticks, but since this is an AccessibilityService and not an Activity, it doesn't seem to have that method.

    Does anyone here know how I could handle MotionEvents from an AccessibilityService?

    Regards, 0xB01b

    Friday, January 29, 2021 2:20 PM

All replies

  • User371688 posted

    For this, you can first check the official document :https://developer.android.com/guide/topics/ui/accessibility/service#java

    Besides, could you please post more details about which type of motion events you want?

    Xamarin forums are migrating to a new home on Microsoft Q&A! We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A! For more information, please refer to this sticky post.

    Saturday, January 30, 2021 8:52 AM
  • User398681 posted


    I've checked the official docs/codelabs a lot in the past month, but I still dont know how to handle MotionEvents with an AccessibilityService. The MotionEvents I want to handle are as follows: AXISX, AXISY, AXISY, AXISRZ, AXISRY, AXISRX, AXISHATX, AXISHATY, AXISLTRIGGER, AXISRTRIGGER, AXISBRAKE,AXISGAS.

    These are for the different axes on Game Controllers.

    Saturday, January 30, 2021 9:45 AM