Tiny Core Extensions > TCE News
AutoCursor extension submitted
Rich:
Hi jazzbiker
--- Quote from: jazzbiker on February 02, 2021, 06:26:18 PM --- ... I have no touchscreen to test with TinyCore, so if anyone is able to test the script it will be interesting to know about the results, whether the "h" command will be assigned to it in the configuration file.
--- End quote ---
I ran it on the netbook I mentioned in reply#14:
--- Code: ---s: "Asus TouchPad"
h: "Chicony HP Elite USB Keyboard"
h: "Broadcom Bluetooth Wireless Keyboard "
s: "PixArt HP USB Optical Mouse"
h: "SYNA7508:00 06CB:11E5"
--- End code ---
The last entry is the touchscreen.
On another note, there are many ways to accomplish the same task under Linux. In that spirit, I'd like to offer you
an awk free version of your event loop in the attached file.
Awk can be a very powerful tool for quickly searching and manipulating text. I used it myself here:
http://forum.tinycorelinux.net/index.php/topic,24581.msg156588.html#msg156588
Since I've only dealt with awk 2 or 3 times, most of my time was spent Googling, reading, and trying to figure out why
it was doing what I told it to do, instead of what I wanted it to do.
My point is that while awk does do the job, in this case, ash is quite capable of doing it too. Using awk here sets the
bar higher than it needs to be for other people wanting to understand and/or modify your script.
jazzbiker:
Hi, Rich!
Thanks for testing, even the simpliest scripts may sometimes play the tricks, caused by unattentiveness.
And thanks for the script example, but unfortunately it may fail. You were assuming, that this ID's are present in exclusive manner, but as documentation says, ID_INPUT_TOUCHPAD and ID_INPUT_TOUCHSCREEN may be accompanied with the ID_INPUT_MOUSE, and as we don't know anything about their order, ID_INPUT_MOUSE may appear earlier than ID_INPUT_TOUCHSCREEN and will cause wrong command. That's why I used awk.
Thanks again for AutoCursor!
Rich:
Hi jazzbiker
After some searching I now see setting ID_INPUT_MOUSE was once the norm when ID_INPUT_TOUCHPAD or
ID_INPUT_TOUCHSCREEN was set:
--- Quote ---As shown above, udev itself already classifies the input devices with input_id. Existing flags are:
ID_INPUT
All input devices have this flag.
ID_INPUT_MOUSE
Touchscreens and tables have this flag as well, since by the type of events they can produce they act as a mouse.
ID_INPUT_TABLET
ID_INPUT_TOUCHSCREEN
----- Snip -----
--- End quote ---
Last edited 2010-04-13 and found here:
https://wiki.kubuntu.org/X/InputConfiguration#Device_classification
A more recent document from Feb 29 2016 states:
--- Quote ---ID_INPUT
If this property is set, the device is considered an input device. Any device with this property missing will be ignored, see Device type assignment via udev.
ID_INPUT_KEYBOARD, ID_INPUT_KEY, ID_INPUT_MOUSE, ID_INPUT_TOUCHPAD, ID_INPUT_TOUCHSCREEN, ID_INPUT_TABLET, ID_INPUT_JOYSTICK, ID_INPUT_ACCELEROMETER
If any of the above is set, libinput initializes the device as the given type, see Device type assignment via udev. Note that for historical reasons more than one of these may be set at any time, libinput will select only one of these to determine the device type. To ensure libinput selects the correct device type, only set one of them.
----- Snip -----
The usual error handling applies within libinput and a device type label does not guarantee that the device is initialized by libinput. If a device fails to meet the requirements for a device type (e.g. a keyboard labelled as touchpad) the device will not be available through libinput.
Only one device type should be set per device at a type, though libinput can handle some combinations for historical reasons.
Below is an example udev rule to remove an ID_INPUT_TOUCHPAD setting and change it into an ID_INPUT_TABLET setting. This rule would apply for a device with the vendor/model ID of 012a/034b.
--- Code: ---ACTION=="add|change", KERNEL=="event[0-9]*", ENV{ID_VENDOR_ID}=="012a", \
ENV{ID_MODEL_ID}=="034b", ENV{ID_INPUT_TOUCHPAD}="", ENV{ID_INPUT_TABLET}="1"
--- End code ---
----- Snip -----
--- End quote ---
So the rule is only one device type is supposed to be set, but certain errors will be tolerated and worked around.
jazzbiker:
Hi, Rich!
Yes, I saw both pages, and noticed, that worse case is an outdated one. Then I decided to check, what's going on right now. And on ASUS-1215B running Lubuntu 16.04 I've got:
--- Code: ---andrey@andrey-1215B:~$ uname -a
Linux andrey-1215B 4.15.0-133-generic #137~16.04.1-Ubuntu SMP Fri Jan 15 02:55:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
andrey@andrey-1215B:~$ cat /sys/class/input/event9/device/name
SynPS/2 Synaptics TouchPad
andrey@andrey-1215B:~$ udevadm info -q property -p /sys/class/input/event9
DEVLINKS=/dev/input/by-path/platform-i8042-serio-1-event-mouse
DEVNAME=/dev/input/event9
DEVPATH=/devices/platform/i8042/serio1/input/input7/event9
ID_INPUT=1
ID_INPUT_HEIGHT_MM=34
ID_INPUT_TOUCHPAD=1
ID_INPUT_TOUCHSCREEN=1
ID_INPUT_WIDTH_MM=64
ID_PATH=platform-i8042-serio-1
ID_PATH_TAG=platform-i8042-serio-1
ID_SERIAL=noserial
LIBINPUT_DEVICE_GROUP=11/2/7/1b1:isa0060/serio1
LIBINPUT_MODEL_JUMPING_SEMI_MT=1
LIBINPUT_MODEL_SYNAPTICS_SERIAL_TOUCHPAD=1
MAJOR=13
MINOR=73
SUBSYSTEM=input
USEC_INITIALIZED=5652584
--- End code ---
Not bad, yeah?
Of course, TinyCore is well known to be the best distribution in our Univrse :) and gave me on the same box:
--- Code: ---tc@box:~$ uname -a
Linux box 4.19.10-tinycore64 #1999 SMP Tue Dec 18 15:18:54 UTC 2018 x86_64 GNU/Linux
tc@box:~$ cat /sys/class/input/event8/device/name
SynPS/2 Synaptics TouchPad
tc@box:~$ udevadm info -q property -p /sys/class/input/event8
DEVLINKS=/dev/input/by-path/platform-i8042-serio-1-event-mouse
DEVNAME=/dev/input/event8
DEVPATH=/devices/platform/i8042/serio1/input/input6/event8
ID_INPUT=1
ID_INPUT_TOUCHPAD=1
ID_PATH=platform-i8042-serio-1
ID_PATH_TAG=platform-i8042-serio-1
ID_SERIAL=noserial
MAJOR=13
MINOR=72
SUBSYSTEM=input
USEC_INITIALIZED=4032823
--- End code ---
awk is already in the busybox, so I used it.
I think we can use this flags wiith care, and manual corrections surely must have higher priority over the proposed by any auto-detections for this use case.
Rich:
Hi jazzbiker
--- Quote from: jazzbiker on February 05, 2021, 03:42:55 AM --- ... Not bad, yeah? ...
--- End quote ---
Yeah, but I did notice this:
--- Quote ---
--- Code: --- ----- Snip -----
ID_INPUT_TOUCHPAD=1
ID_INPUT_TOUCHSCREEN=1
----- Snip -----
LIBINPUT_DEVICE_GROUP=11/2/7/1b1:isa0060/serio1
LIBINPUT_MODEL_JUMPING_SEMI_MT=1
LIBINPUT_MODEL_SYNAPTICS_SERIAL_TOUCHPAD=1
----- Snip -----
--- End code ---
--- End quote ---
So this breaks the rules by selecting 2 devices.
Then it appears to break them again because ID_INPUT_MOUSE isn't one of them.
Yet libinput still figures out the correct device.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version