Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

MXIII XBOX Wireless Controller dpad left triggers power

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    MXIII XBOX Wireless Controller dpad left triggers power

    I connected a wireless XBOX 360 Controller (with the Microsoft receiver) to my MXIII M82 2GB (110k4 stock firmware). Everything is working, except that the DPAD_LEFT triggers also the power button (suspend, shutdown pops up).

    I tried to investigate further, checking the keycodes and scancodes with an app called "KeyEvent Display". I tried everything with and without a Vendor_045e_Product_0719.kl Keylayout file for the Controller.

    Pressing the power-button on the Remotecontrol returns this:
    KeyDown action=0 code=0 repeat=0 meta=0 scancode=704 mFlags=8 label='' chars='null'
    KeyUp action=1 code=0 repeat=0 meta=0 scancode=704 mFlags=552 label='' chars='null'

    Pressing the DPAD_LEFT on the controller returns:
    KeyDown action=0 code=21 repeat=0 meta=0 scancode=704 mFlags=8 label='' chars='null'
    KeyUp action=1 code=21 repeat=0 meta=0 scancode=704 mFlags=40 label='' chars='null'

    So the scancode for DPAD_LEFT on the xbox 360 controller is 704, which unfortunately is the same as the power (button).

    I tried changing the Layouts Vendor_045e_Product_0719.kl (Controller) and Vendor_0001_Product_0001.kl (Remote), but this of course changes only what happens when pressing the power button on the remote, or pressing the left button on the controller (but the additional power command is issued nonetheless).

    I tried removing "0x51 704" from remote.conf, this causes the power button on the remote to do nothing (makes sense), and also adding "key 407 1" to Vendor_0001_Product_0001.kl trying to override scancode 407 to just output "1", but DPAD_LEFT keeps calling the power/suspend.

    I assume changing the scancode sent from the controller is not possible. Is there a configuration somewhere where you can change the reaction to a scancode for the system? Or disabling the suspend/shutdown popup (reaction) totally?

    Any help or hint is greatly appreciated!

    #2
    Hiya jscode,

    A few days ago, my MXIII arrived in the mail, and I quickly found I was in the same situation as yourself - I noticed your recent posts around the place while researching, and thought you might still be interested in the answer.

    My box is a match for yours, right down to the installed firmware release. The **** seller I purchased it from had apparently pre-rooted the device (a nice bonus), and a root is of course required to deal with this, though it sounds like you've already got that done.

    First off, I found that the d-pad wasn't functioning at all, with the exception of the left side triggering the power menu. I was able to mostly fix that by getting the Vendor_045e_Product_0291.kl.zip from this thread, renaming the kl file inside to "Vendor_045e_Product_0719.kl", adding the lines from this post, then finally placing the result into /system/user/keylayout with Root Explorer. It sounds like you either already had a suitable copy of this file in there (I was entirely lacking it), or figured out these steps for yourself - in any case, although the dpad became fully functional after that, pressing left still brought up the power menu (in addition to now also moving the cursor left). I suggest you undo any changes you made to remote.conf and Vendor_0001_Product_0001.kl before going further, as my solution didn't involve editing them.

    After figuring out that the keymap files weren't the problem (the default remote kl doesn't even mention the power button), and there wasn't a background app listening for code 704 (I went through and temporarily deleted a bunch of packages), I figured there must be some part of the Android ROM itself acting on the key press.

    Enter Xposed Additions, an add-on for the Xposed framework. Among other things,Additions allows you to remap buttons in a way that would usually require ROM customisation / recompiling / whatever.

    1) Install the Xposed framework. I went with the stable v32 / 2.6.1 build. Once you install the APK, selecting the "Xposed Installer" from your app list will give you a menu. The top option, "Framework", does the "actual" installation - it'll warn you that it may brick your device, so proceed at your own risk, etc. (Though obviously, it worked for me!)

    Once that's installed, you may be asked to reboot - do it if you're prompted to.

    2) Install Xposed Additions. I went with v64 / 3.5.2, which is the most recent at the time of writing. Once it's installed, go back to the Xposed Installer, this time selecting "Modules" from its main menu. Tick the box to the right of Xposed Additions (don't tap the name - look for the checkbox and tap that), then reboot again when prompted.

    3) Configure the remap. Go back to the Modules menu and tap Xposed Additions (the name this time, not the checkbox) to go to its configuration screen. Select Buttons, then Allow External Devices, and tick everything. Drag the Long Press Delay slider to the far left. (Edit: Actually, you probably want to leave that slider on the right, but I found PPSSPP messed up otherwise. I'll have to experiment some more.)

    In the Keys section lower down, select Add new Key, then press left on your controller's dpad. Once you press Ok, DPad Left should show up with "no conditions". Tap it, and add a condition set to "screen on". Then tap that and set the action to click "dpad left".

    And... that's it! The dpad should now be fully functional. This shouldn't affect the use of the power button on the actual remote, either - that should also be working fine. Let me know if this works for you, too!

    While on the subject, another Xposed add-on I found useful is this wifi connection faker, which can make apps view the MXIII's Ethernet connection as a wifi connection. Some (eg Asphalt 8, which works quite well with a 360 controller by the way) will assume that anything that isn't wifi must be 3G data, and will refuse to download larger files until they get the type of network they want.
    Last edited by Bomb Bloke; 03-29-2015, 06:25.

    Comment


      #3
      Hi there hoping someone can help me out here.
      So I have 360 pad connected via wireless receiver to my MXIII 2GB (Finless 2.1 atm)

      Followed the instructions above (not the xposed part though!?) but in GTA the camera just spins none stop
      Google then lead me here http://forum.xda-developers.com/show...1407804&page=2
      Which said to dmesg to find idvendor and idproduct, my dmesg didnt have that though

      Can anyone shed light on this problem for me?

      It happens on GTA and MC5.
      Rayman, zen pinball and Riptide GP2 all seem to be ok (most controls work t least)

      You may only view thumbnails in this gallery. This gallery has 1 photos.
      Last edited by djjinx1; 05-11-2015, 21:18.

      Comment


        #4
        Originally posted by djjinx1 View Post
        Followed the instructions above (not the xposed part though!?) but in GTA the camera just spins none stop
        Google then lead me here http://forum.xda-developers.com/show...1407804&page=2
        Which said to dmesg to find idvendor and idproduct, my dmesg didnt have that though
        busybox command lsusb will show the connect usb devices and their vendoridroductid which you can then used to alter or build your keymap file.

        Comment


          #5

          I followed your procedures and everything went fine, there is only one problem my r2 and l2 does not work, I use the wireless receiver and the original control, do you know what it can be and how to solve it? sorry for english I'm using translator

          Comment


            #6
            Originally posted by ricrock13br View Post
            I followed your procedures and everything went fine, there is only one problem my r2 and l2 does not work, I use the wireless receiver and the original control, do you know what it can be and how to solve it? sorry for english I'm using translator penalty kick online
            Add Xposed Framework. I used the current, most up-to-date version, which is v64 / 3.5.2.

            Comment

            Working...
            X