This is part of my PS4 Single handed Joystick controller.

(not for confusion - the above graphic of Hori controller is not on the MRL Joystick service, its a paint mash for my reference).

These are the mappings I have traced prior to desoldering the main board (just to keep a track of directions when shoehorned into the new system).

I have a Question :-

There are 5 buttons that do not show up on the MRL mappings.

When I press the left side of the "Black left 'D' pad , digital direction NorthSouthEastWest" it brings up the "pov" mapping, pressing right/up/down does nothing and also pressing the "TP" (bottom central of unit).

My Question :- How does MRL pick up the mappings, are they configurable in code. ?

 

Gareth

5 years 1 month ago

Using Free Device Monitoring Studio , the "D" pad appears as byte 05 in the packet 

"0F" = nothing pressed and  then bits 1 2 3 4 for the North South East and West.

TP button appears as bit 3 of byte 07 of the HID packet

011957: Bulk or Interrupt Transfer (UP), 2019-10-12 15:29:58.2949908 +0.0039923. (1. Device: HORIPAD mini4) Status: 0x00000000 Pipe Handle: 0x4ca1cb0 (Endpoint Address: 0x84) Get 0x40 bytes from the device

 01 80 80 86 7B 0F 00 04 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 80 00 00 00 80 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
.€€†{...........
................
...€...€........
................

 

GroG

5 years 1 month ago

Hi Gareth,

We use a java.net jni code to "query" the components.
 

    /**
     * Returns the components on this controller, in order of assignment priority.
     * For example, the button controller on a mouse returns an array containing
     * the primary or leftmost mouse button, followed by the secondary or
     * rightmost mouse button (if present), followed by the middle mouse button
     * (if present).
     * The array returned is an empty array if this controller contains no components
     * (such as a logical grouping of child controllers).
     */
    public abstract Component[] getComponents();
 
The return of this function gives us a set of java.net Components which we create a Map of components based on identifiers.
 
If this function does not return all the buttons, there is not much we can do about it.  There maybe could be a possibility that the identifiers are identical for 2 different components, effectively hiding one.  But of what use is it ?
 
In Python you could check this :
print(joy.getComponents.size())
print(joy.getComponentMap.size())

Ahaaa... that explains the "found 21 hwComponents" on my Hori controller.

I am impressed that MRL reconstitutes the display from polling the hardware components, I was puzzled how it knew my Hori controller... rather spooooky (I had assumed it might have been pre-seeded with a PS4 controller...but no ... MRL goes in with a magnifying glass \ö/ )