EVDEV KeyCode 330

Hi
I’m reporting this, pursuant to this message:

INFO: The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL forums/mailing list https://discourse.libsdl.org/ EVDEV KeyCode 330

I’m getting the above message when touching on an eGalax TouchScreen with libsdl controlling the screen, on a Raspberry Pi B, running:

$ uname -a
Linux nas-pi 4.14.79+ #1159 Sun Nov 4 17:28:08 GMT 2018 armv6l GNU/Linux

This is the output of evtest, for the same touchscreen event:

$ evtest
No device specified, trying to scan all of /dev/input/event*
Not running as root, no devices may be available.
Available devices:
/dev/input/event0: Microsoft Microsoft Nano Transceiver 1.1
/dev/input/event1: Microsoft Microsoft Nano Transceiver 1.1
/dev/input/event2: eGalax Inc. USB TouchController
/dev/input/event3: Microsoft Microsoft Nano Transceiver 1.1
/dev/input/event4: USB USB Keykoard
/dev/input/event5: USB USB Keykoard
Select the device event number [0-5]: 2
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0xeef product 0x1 version 0x100
Input device name: “eGalax Inc. USB TouchController”
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 330 (BTN_TOUCH)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 1071
Min 0
Max 2047
Event code 1 (ABS_Y)
Value 771
Min 0
Max 2047
Properties:
Testing … (interrupt to exit)
Event: time 1548236197.537625, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1548236197.537625, type 3 (EV_ABS), code 0 (ABS_X), value 1204
Event: time 1548236197.537625, type 3 (EV_ABS), code 1 (ABS_Y), value 459
Event: time 1548236197.537625, -------------- SYN_REPORT ------------
Event: time 1548236197.573607, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1548236197.573607, -------------- SYN_REPORT ------------

Also, while the pointer works fine with X and the touchscreen, as shown above with the EV_ABS events, it doesn’t appear at all on screen (and therefore cannot be seen moving) when using the touchscreen with libsdl.

libsdl is employed through undroidwish, a TCL “Batteries Included” environment that runs on many platforms, including Android and Raspbery Pi. The Android version of undroidwish, called AndroWish, is also based on libsdl and works fine.

I hope the above help debug this problem.

This was fixed in revision control recently (but is not included in the SDL 2.0.9 release). It’ll be in 2.0.10. Sorry!

Arghhhh.
I just discovered this problem and we are working on an implementation for a customer which uses this device.
We have to finish it for an exhibit on March, so we cannot wait.
Is it possible to have a patch ??

Many thanks icculus

Sure:
http://www.libsdl.org/tmp/SDL-2.0.zip

Many many thanks !!!

Good to know.
Thanks!

Hi - I have the same error as the OP. I am running Raspbian Buster on rPi 0W. Can you tell me how I should update to stop the spam? Thanks

Download SDL source code from here:
https://www.libsdl.org/download-2.0.php

Extract the archive, go to the directory, then do:

sudo apt build-dep libsdl2

./configure

make

sudo make install

This will build and install SDL in /usr/local/lib

Thank you very much, this worked perfectly!

Sorry but there seems to be some side-effects to installing this, since doing so I cannot control the backlight as I could before. This is the code that I’m using in python. Is there anything I need to setup in the back end to get this working again? Also the colours are now a bit off on the desktop. Thanks

import RPi.GPIO as GPIO

try:
    GPIO.setmode(GPIO.BOARD)
except Exception as e:
    print("The mode is probably already set and you can ignore this error", e)

GPIO.setup(19, GPIO.OUT)
pwm = GPIO.PWM(19, 60)

def brightness(brightness):
    pwm.start(brightness) # brightness 0-100
    print ('backlight adjusted')

Edit: it also has not fixed the spam error

Hi - I deleted the post above shortly after posting but it is still visible. I know my backlight issue was nothing to do with SDL.

However, I am still having the original issue only now it is more than just spam, my touch screen is also poorly responsive.

Can anyone help please?

I have posted more about the issue here: https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=290881