HyperPixel 4 - Touch screen dimensions are swapped

For anything directly accessing the touch screen, I rescaled the axes eg:

                if event.code == ABS_MT_POSITION_X:
                    value = int((event.value/480.0)*800)
                    self._current_touch.x = value
            
                if event.code == ABS_MT_POSITION_Y:
                    value = int((event.value/800.0)*480)
                    self._current_touch.y = value

From https://github.com/pimoroni/python-multitouch/blob/2b8678773224d49e94c1da174aa269fd3b433564/library/hp4ts.py#L203-L209

This is, effectively, what X does internally although I’ve no idea how it manages to accomplish this seemlessly- in fact X glossing over these swapped dimensions is what led me to approve the Goodix touch IC in the first place, which is frustrating since we wanted sane upstream drivers and… got this :(

If I recall correctly, the alternate driver fixes this, but I’ve been busy with a million-and-one other projects so I’ve not had the opportunity to look into it again. There seem to be a number of reports of various issues with HP4 and achieving various rotation settings, though, so it’s something I’ll look into.