# HyperPixel4 & EVDEV question

**URL:** <https://forums.pimoroni.com/t/hyperpixel4-evdev-question/9778>\
**Category:** Support\
**Created:** [January 27, 2019, 5:01pm UTC](https://forums.pimoroni.com/t/hyperpixel4-evdev-question/9778 "2019-01-27T17:01:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BroMarduk](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/bromarduk/32/4663_2.png) [@BroMarduk](https://forums.pimoroni.com/u/BroMarduk)\
**Post date:** [January 27, 2019, 5:01pm UTC](https://forums.pimoroni.com/t/hyperpixel4-evdev-question/9778/1 "2019-01-27T17:01:44Z")

</div>

I was attempting to run a HyperPixel4 with touch on a Pi 3 using latest Raspian Lite 2018-11-13. Ran the HyperPixel4 installer and display is working fine. Running in the default orientation. My problem is with touch. For some reason when I run EVTEST the X and Y maximum values are inverted. So on the longer X axis I get EVDEV events from 0-479 and on the shorter Y axis I get EVDEV events from 0-799. I would expect this to be reversed so the longer X axis was 0-799 and the shorter Y axis was 0-479

 ![HyperPixel4%20EVDEV](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/9/924419463e867c0d356781474413c1bcedd86798.png)

EVTest Output:

```auto
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x416 product 0x38f version 0x1060
Input device name: "Goodix Capacitive TouchScreen"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 125 (KEY_LEFTMETA)
    Event code 330 (BTN_TOUCH)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value 17
      Min 0
      Max 480
    Event code 1 (ABS_Y)
      Value 771
      Min 0
      Max 800
    Event code 47 (ABS_MT_SLOT)
      Value 0
      Min 0
      Max 4
    Event code 48 (ABS_MT_TOUCH_MAJOR)
      Value 0
      Min 0
      Max 255
    Event code 50 (ABS_MT_WIDTH_MAJOR)
      Value 0
      Min 0
      Max 255
    Event code 53 (ABS_MT_POSITION_X)
      Value 0
      Min 0
      Max 480
    Event code 54 (ABS_MT_POSITION_Y)
      Value 0
      Min 0
      Max 800
    Event code 57 (ABS_MT_TRACKING_ID)
      Value 0
      Min 0
      Max 65535

```

I tried the alternate drivers, with many combinations/switches when building, but still can’t get the expected results from EVDEV. Am I wrong in how I am expecting the EVDEV events to be reported? If not, is there some way to correct this?

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [February 5, 2019, 11:36am UTC](https://forums.pimoroni.com/t/hyperpixel4-evdev-question/9778/2 "2019-02-05T11:36:16Z")

</div>

See my reply here- [HyperPixel 4 - Touch screen dimensions are swapped](https://forums.pimoroni.com/t/hyperpixel-4-touch-screen-dimensions-are-swapped/8198/37?u=gadgetoid)

Long story short- I ran into this problem too, I can’t remember if it was fixed with the alternate driver, but I’ll look into it.

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [February 5, 2019, 11:43am UTC](https://forums.pimoroni.com/t/hyperpixel4-evdev-question/9778/3 "2019-02-05T11:43:10Z")

</div>

I’ve got a suspicion that people trying the alternative drivers have been installing them but, due to a lack of clarity in the instructions, haven’t actually used them at all.

Could you try:

```auto
sudo cp /boot/overlay/hyperpixel4.dtbo /boot/overlay/hyperpixel4-upstream.dtbo
git clone https://github.com/pimoroni/HyperPixel4TouchScreen
cd HyperPixel4TouchScreen/driver
make build
sudo make install

```

This should replace your `hyperpixel4.dtbo` with the one that loads and configures the alternate driver.

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [February 5, 2019, 12:16pm UTC](https://forums.pimoroni.com/t/hyperpixel4-evdev-question/9778/4 "2019-02-05T12:16:38Z")

</div>

Just followed these steps and ran EVTest- I’m seeing the same thing.

You’re never going to touch the screen with pixel-perfect accuracy so I’d suggest just doing `x=(x/480)*800` and `y=(y/800)*480` to correct the touch positions and saving yourself the hassle of dealing with drivers.

Using EVDEV you should be able to read the X and Y axis ranges and scale accordingly anyway, since I don’t believe there’s any guarantee that touch axis/screen pixels will always be a 1:1 relationship. In this case it’s particularly weird because they just so happen to be the X and Y ranges swapped.
