Tiny Core Extensions > TCE News
AutoCursor extension submitted
Rich:
Hi jazzbiker
--- Quote from: jazzbiker on January 31, 2021, 10:44:05 AM --- ... Voila! all birds are trapped in our cages.
--- End quote ---
Here's an explanation of how the settings work that may prove useful.
These are the events listed on one of my machines:
--- Code: ---tc@E310:~/C_Programs/AutoCursor$ sudo ./AutoCursor -e
Event# Input device name
0: "Power Button"
1: "Power Button"
2: "Logitech USB-PS/2 Optical Mouse"
3: "PC Speaker"
4: "DELL DELL USB Keyboard"
5: "HDA Intel Mic"
6: "HDA Intel Line"
7: "HDA Intel Line Out"
8: "HDA Intel Front Headphone"
tc@E310:~/C_Programs/AutoCursor$
--- End code ---
This is the settings file from that machine:
--- Code: ---tc@E310:~/C_Programs/AutoCursor$ cat cursor.conf
s:"Logitech USB-PS/2 Optical Mouse"
h:"DELL DELL USB Keyboard"
tc@E310:~/C_Programs/AutoCursor$
--- End code ---
The program does a case sensitive substring search for the settings string in the events string.
Any copy and paste section of the event string will work. In other words, this would work too:
--- Code: ---s:"Mouse"
h:"Keyboard"
--- End code ---
If all of your machines report Mouse and Keyboard , That is all you would need. If one of your machines reports
keyboard , you could do this:
--- Code: ---s:"Mouse"
h:"Keyboard"
h:"keyboard"
--- End code ---
If I did this:
--- Code: ---h:"HDA"
--- End code ---
My cursor would disappear anytime one of those 4 audio devices generated an event.
Summary:
You only need enough of the string to uniquely identify the event of interest.
You need the quotation marks.
--- Quote from: jazzbiker on January 31, 2021, 11:54:53 AM --- ... on one particular machine only devices actually present will be enqued. ...
--- End quote ---
Correct.
jazzbiker:
Hi, Rich!
Seems, that trick with substrings doesn't works.
--- Code: ---tc@box:/tmp$ sudo AutoCursor -e
Event# Input device name
0: "Lid Switch"
1: "Sleep Button"
2: "Power Button"
3: "AT Translated Set 2 keyboard"
4: "YSPRINGTECH USB OPTICAL MOUSE"
5: "PC Speaker"
6: "Video Bus"
7: "HDA Intel MID Mic"
8: "HDA Intel MID Headphone"
--- End code ---
This config works:
--- Code: ---tc@box:/tmp$ cat ~/.config/autocursor.conf
h:"AT Translated Set 2 keyboard"
s:"YSPRINGTECH USB OPTICAL MOUSE"
--- End code ---
while this don't:
--- Code: ---tc@box:/tmp$ cat ~/.config/autocursor.conf.test
h:"keyboard"
s:"MOUSE"
--- End code ---
You really use
--- Code: --- { // Only return entries starting with EVENTstr.
if(strncmp(EVENTstr, entity->d_name, EVENTstrlen) == 0)
--- End code ---
in BuildEventlist(void).
It's absolutely ok to use full names, as they are written by AutoCursor.
Rich:
Hi jazzbiker
--- Quote from: jazzbiker on January 31, 2021, 12:52:00 PM ---Seems, that trick with substrings doesn't works. ...
--- End quote ---
You are correct. I use the quote mark for locating the description but neglected to omit it as a search term. Updated
extensions posted to TC10 x86 and x86_64. It now works as described in reply #10. Please update your copy.
--- Quote --- ... You really use
--- Code: --- { // Only return entries starting with EVENTstr.
if(strncmp(EVENTstr, entity->d_name, EVENTstrlen) == 0)
--- End code ---
in BuildEventlist(void). ...
--- End quote ---
That section of code searches /dev/input/ for event*. We don't care about other entries (mice. mouse0, etc.).
The search for a match is done in LoadSettings(char *fullname, int *fdmax)
--- Quote --- ... It's absolutely ok to use full names, as they are written by AutoCursor.
--- End quote ---
Yes, it is. But I also wanted to allow for a little more flexibility if required.
jazzbiker:
Hi, Rich!
Yes, works great!
--- Code: ---tc@box:~$ cat ~/.autocursor.conf
h:"keyboard"
h:"Keyboard"
h:"KEYBOARD"
s:"mouse"
s:"Mouse"
s:"MOUSE"
--- End code ---
Thanks for update!
Rich:
Hi jazzbiker
Here's the output from an ASUS netbook with touchscreen, touchpad, and Bluetooth keyboard. In addidtion, there is a USB
mouse and keyboard plugged in:
--- Code: ---Event# Input device name
0: "Lid Switch"
1: "Sleep Button"
2: "PC Speaker"
3: "SYNA7508:00 06CB:11E5 Pen"
4: "SYNA7508:00 06CB:11E5"
5: "Asus WMI hotkeys"
6: "PixArt HP USB Optical Mouse"
7: "Chicony HP Elite USB Keyboard"
8: "Chicony HP Elite USB Keyboard System Control"
9: "Chicony HP Elite USB Keyboard Consumer Control"
10: "Video Bus"
11: "bytcr-rt5640 Headset"
12: "Intel HDMI/DP LPE Audio HDMI/DP,pcm=0"
13: "Intel HDMI/DP LPE Audio HDMI/DP,pcm=1"
14: "Broadcom Bluetooth Wireless Keyboard "
15: "Broadcom Bluetooth Wireless Keyboard "
16: "Broadcom Bluetooth Wireless Keyboard "
17: "Asus TouchPad"
18: "Broadcom Bluetooth Wireless Keyboard "
19: "Broadcom Bluetooth Wireless Keyboard "
--- End code ---
This hides for the touchscreen and 2 keyboards, and shows for the mouse and touchpad:
--- Code: ---sudo ./AutoCursor -s6 -h4 -s17 -h14 -h7
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version