Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 05 Jul 2015, 13:29
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Script to detect a Touchscreen?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [15 Posts]  
Author Message
peebee


Joined: 21 Sep 2008
Posts: 1856
Location: Worcestershire, UK

PostPosted: Fri 27 Mar 2015, 07:55    Post subject:  Script to detect a Touchscreen?  

Is there a way to detect that a touchscreen is present from a script test?
_________________
LxPup = Puppy + LXDE
Back to top
View user's profile Send private message Visit poster's website 
jamesbond

Joined: 26 Feb 2007
Posts: 2465
Location: The Blue Marble

PostPosted: Fri 27 Mar 2015, 09:48    Post subject:  

With a recent enough udev, you can do this it like this:
Code:
sed '/Sysfs=/!d; s/.*=//' /proc/bus/input/devices | xargs -I '{}' udevadm info --path='{}'  | grep TOUCHSCREEN

or even better, just grep the udev data directory (or somewhere else), just do
Code:
grep TOUCHSCREEN /run/udev/data/*
The first method allows you do detect the touchscreen device (if you re-write the xargs with while loop). This method just detects presence.

Or you can also do
Code:
xinput list | grep -i touchscreen
but this one seems to be less reliable because not all devices identify themselves as "touchscreen" (e.g this case). If this works however you get the benefit of knowing exactly the X input device that represents the touchscreen, which you can manipulate further with xinput itself.

Hope that helps.

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send private message 
rokytnji


Joined: 20 Jan 2009
Posts: 1775
Location: Pecos/ Texas

PostPosted: Fri 27 Mar 2015, 09:57    Post subject:  

Code:
dmesg | grep usb


will work also

http://www.murga-linux.com/puppy/viewtopic.php?p=826613#826613

_________________
Linux Training More More I have a Masters in Raising Hell.
Back to top
View user's profile Send private message Visit poster's website 
peebee


Joined: 21 Sep 2008
Posts: 1856
Location: Worcestershire, UK

PostPosted: Sat 28 Mar 2015, 06:49    Post subject:  

Thanks for the replies - the reason that I asked the question is that gcmartin has requested an edit to xorg.conf to make touchscreens work better on LxPup64 and I thought it would be better to make the edit conditional on there being a touchscreen present.

I don't have a touchscreen myself but I've tried the suggestions so far on my system and also GCM has told me what outputs he gets on a touchscreen laptop.

So far I can't really see how to make a touchscreen_present test....
Code:
if [ $touchscreen_present ]; then
  edit xorg.conf
fi

Googling, I've seen a suggestion that the contents of:
/sys/class/hidraw/hidraw*/device/uevent
might provide an indication - can anybody with a touchscreen look into their files (for some reason you must use leafpad to see the contents - they don't display in geany) and post the result for the touchscreen?

Many thanks
peebee

_________________
LxPup = Puppy + LXDE
Back to top
View user's profile Send private message Visit poster's website 
greengeek

Joined: 20 Jul 2010
Posts: 3156
Location: New Zealand

PostPosted: Sat 28 Mar 2015, 15:55    Post subject:  

I seem to recall not all touchscreens use hiddraw. Can't offer any info to explain this but I'll look back through my info and see if I can find some links.

EDIT :I know it's not what you asked for, but I thought I'd post the output of the code rokyntji suggested above:
(from my Toshiba M700 which has a touchscreen but which I havent tried to get working yet). Pretty sure my touchscreen is a usb connected HID device. (I don't have the HIDDRAW directory you suggested above)

Code:
# dmesg | grep usb
[    0.000000] Kernel command line: video=640x480 psubdir=b3skype_beta pmedia=usbflash pfix=fsck
[    0.120186] usbcore: registered new interface driver usbfs
[    0.120186] usbcore: registered new interface driver hub
[    0.120186] usbcore: registered new device driver usb
[    0.716716] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    0.716719] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.716722] usb usb1: Product: EHCI Host Controller
[    0.716724] usb usb1: Manufacturer: Linux 3.4.52 ehci_hcd
[    0.716726] usb usb1: SerialNumber: 0000:00:1a.7
[    0.730035] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[    0.730039] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.730041] usb usb2: Product: EHCI Host Controller
[    0.730043] usb usb2: Manufacturer: Linux 3.4.52 ehci_hcd
[    0.730045] usb usb2: SerialNumber: 0000:00:1d.7
[    0.730394] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001
[    0.730397] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.730399] usb usb3: Product: UHCI Host Controller
[    0.730402] usb usb3: Manufacturer: Linux 3.4.52 uhci_hcd
[    0.730404] usb usb3: SerialNumber: 0000:00:1a.0
[    0.730672] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001
[    0.730675] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.730677] usb usb4: Product: UHCI Host Controller
[    0.730679] usb usb4: Manufacturer: Linux 3.4.52 uhci_hcd
[    0.730681] usb usb4: SerialNumber: 0000:00:1a.1
[    0.730943] usb usb5: New USB device found, idVendor=1d6b, idProduct=0001
[    0.730945] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.730948] usb usb5: Product: UHCI Host Controller
[    0.730950] usb usb5: Manufacturer: Linux 3.4.52 uhci_hcd
[    0.730952] usb usb5: SerialNumber: 0000:00:1d.0
[    0.731217] usb usb6: New USB device found, idVendor=1d6b, idProduct=0001
[    0.731220] usb usb6: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.731222] usb usb6: Product: UHCI Host Controller
[    0.731224] usb usb6: Manufacturer: Linux 3.4.52 uhci_hcd
[    0.731227] usb usb6: SerialNumber: 0000:00:1d.1
[    0.731480] usb usb7: New USB device found, idVendor=1d6b, idProduct=0001
[    0.731483] usb usb7: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.731485] usb usb7: Product: UHCI Host Controller
[    0.731487] usb usb7: Manufacturer: Linux 3.4.52 uhci_hcd
[    0.731490] usb usb7: SerialNumber: 0000:00:1d.2
[    0.731802] usbcore: registered new interface driver usb-storage
[    0.731845] usbcore: registered new interface driver libusual
[    0.731856] usbcore: registered new interface driver ums-alauda
[    0.731868] usbcore: registered new interface driver ums-datafab
[    0.731879] usbcore: registered new interface driver ums_eneub6250
[    0.731890] usbcore: registered new interface driver ums-freecom
[    0.731901] usbcore: registered new interface driver ums-isd200
[    0.731913] usbcore: registered new interface driver ums-jumpshot
[    0.731928] usbcore: registered new interface driver ums-realtek
[    0.731939] usbcore: registered new interface driver ums-sddr09
[    0.731951] usbcore: registered new interface driver ums-sddr55
[    0.731962] usbcore: registered new interface driver ums-usbat
[    0.731980] usbcore: registered new interface driver ldusb
[    0.737779] usbcore: registered new interface driver usbhid
[    0.737780] usbhid: USB HID core driver
[    1.023354] usb 1-4: new high-speed USB device number 2 using ehci_hcd
[    1.160410] usb 1-4: New USB device found, idVendor=04f2, idProduct=b008
[    1.160413] usb 1-4: New USB device strings: Mfr=2, Product=1, SerialNumber=3
[    1.160416] usb 1-4: Product: Chicony USB 2.0 Camera
[    1.160418] usb 1-4: Manufacturer: Chicony Electronics Co., Ltd.
[    1.160420] usb 1-4: SerialNumber: SN0001
[    1.373345] usb 2-5: new high-speed USB device number 3 using ehci_hcd
[    1.498414] usb 2-5: New USB device found, idVendor=8564, idProduct=1000
[    1.498417] usb 2-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    1.498420] usb 2-5: Product: Mass Storage Device
[    1.498422] usb 2-5: Manufacturer: JetFlash
[    1.498424] usb 2-5: SerialNumber: 23BHNQDCK7CJC7RW
[    1.498733] scsi5 : usb-storage 2-5:1.0
[    1.723344] usb 6-1: new full-speed USB device number 2 using uhci_hcd
[    1.881219] usb 6-1: New USB device found, idVendor=08ff, idProduct=1600
[    1.881222] usb 6-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    1.881225] usb 6-1: Product: Fingerprint Sensor
[   35.573378] usb 6-2: new full-speed USB device number 3 using uhci_hcd
[   35.748272] usb 6-2: New USB device found, idVendor=0930, idProduct=0508
[   35.748276] usb 6-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[   35.953722] usbcore: registered new interface driver btusb
[   36.078782] input: Chicony USB 2.0 Camera as /devices/pci0000:00/0000:00:1a.7/usb1/1-4/1-4:1.0/input/input8
[   36.078849] usbcore: registered new interface driver uvcvideo
#

Last edited by greengeek on Sat 28 Mar 2015, 16:05; edited 1 time in total
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 2465
Location: The Blue Marble

PostPosted: Sat 28 Mar 2015, 15:56    Post subject:  

peebee wrote:
gcmartin has requested ...
Okay, I see clearly now Laughing
Quote:
So far I can't really see how to make a touchscreen_present test....
Code:
if [ $touchscreen_present ]; then
  edit xorg.conf
fi
All the 3 codes I suggested above is meant exactly for that, e.g.
Code:
if grep -q TOUCHSCREEN /run/udev/data/*; then
 edit xorg
fi
.

Quote:
Googling, I've seen a suggestion that the contents of:
/sys/class/hidraw/hidraw*/device/uevent
might provide an indication - can anybody with a touchscreen look into their files (for some reason you must use leafpad to see the contents - they don't display in geany) and post the result for the touchscreen.
Here is the result of "cat /sys/class/hidraw/hidraw*/device/uevent" on a touchscreen laptop. I would have thought that gcmartin already volunteered this information himself ...
Code:
DRIVER=hid-generic
HID_ID=0003:000003EB:0000880F
HID_NAME=Atmel Atmel maXTouch Digitizer
HID_PHYS=usb-0000:00:14.0-3/input1
HID_UNIQ=
MODALIAS=hid:b0003g0001v000003EBp0000880F
DRIVER=hid-generic
HID_ID=0003:0000046D:0000C52F
HID_NAME=Logitech USB Receiver
HID_PHYS=usb-0000:00:14.0-7/input0
HID_UNIQ=
MODALIAS=hid:b0003g0001v0000046Dp0000C52F
DRIVER=hid-generic
HID_ID=0003:0000046D:0000C52F
HID_NAME=Logitech USB Receiver
HID_PHYS=usb-0000:00:14.0-7/input1
HID_UNIQ=
MODALIAS=hid:b0003g0001v0000046Dp0000C52F
DRIVER=hid-multitouch
HID_ID=0003:000003EB:0000880F
HID_NAME=Atmel Atmel maXTouch Digitizer
HID_PHYS=usb-0000:00:14.0-3/input0
HID_UNIQ=
MODALIAS=hid:b0003g0004v000003EBp0000880F

As you can see, it is not helpful. That maxtouch can easily represents a touchpad, a digitizer, or a touchscreen. Since udev is already doing a better job at testing for touchscreen, just check it from udev.

cheers!

PS: If you don't mind me asking, what exactly is the xorg edit that gcmartin is asking?

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 3156
Location: New Zealand

PostPosted: Sat 28 Mar 2015, 16:09    Post subject:  

Heres my output using jamesbonds suggestions
(ok I'm probably misunderstanding how to use them...)
Code:
# sed '/Sysfs=/!d; s/.*=//' /proc/bus/input/devices | xargs -I '{}' udevadm info --path='{}'  | grep TOUCHSCREEN
missing option
missing option
missing option
missing option
missing option
missing option
missing option
missing option
missing option
missing option
missing option
missing option
missing option
# grep TOUCHSCREEN /run/udev/data/*
#
# xinput list | grep -i touchscreen
bash: xinput: command not found


EDIT : I'm using Slacko 5.6 derivative

EDIT 2 : Seems as if my touchscreen is two things in one - it has a pen that is basically a wacom digitizer and also a finger operated touch interface that I havent found much info on yet. So not your standard modern touchscreen.
(Found a comment about the touch digitizer side of things:
Quote: "BTW: The Toshiba has the digitizer on a serial interface at 0x338, I needed setserial /dev/ttyS0 port 0x338 autoconfig to get a usable port")

Last edited by greengeek on Sat 28 Mar 2015, 16:28; edited 1 time in total
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 7960
Location: qld

PostPosted: Sat 28 Mar 2015, 16:27    Post subject:  

The real solution is to have no xorg.conf at all and let Xorg discover and configure the touchscreen itself. That said, all of puppy's scipts that run at startup are very dependent on xorg.conf being present. That might have been ok in the old days but xorg has had the ability to run without xorg.conf since 1.4 (iirc - and that was before the lucid days). The method used to boot straight to desktop now is a bit of a kludge with a script xorgwizard-automatic running which relies on a pre-configured xorg.conf with minimal settings but allowing xorg to choose resolution.

So at woof level, lots of scripts need rewriting. Off the top of my head:
    /etc/rc.d/{rc.sysinit,rc.update,rc.country} (keyboard stuff needs to be moved to a file in /etc/X11/xorg.conf.d/)
    xorgwizard
    xwin
    xinitrc
    xorgwizard-automatic (dump it)

..and probably more.

This really needs to be done, especially with newer hardware coming out.

EDIT:
Of course utilities like xinput, and xsetwacom must be included too, which have traditionally been left out.

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
mavrothal


Joined: 24 Aug 2009
Posts: 2284

PostPosted: Sun 29 Mar 2015, 01:21    Post subject:  

01micko wrote:
This really needs to be done,

Any volunteers? Razz Very Happy

_________________
Kids all over the world go around with an XO laptop. They deserve one puppy (or many) too Very Happy
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 7960
Location: qld

PostPosted: Sun 29 Mar 2015, 01:43    Post subject:  

Probably need to create a temporary branch because stability could take a while. I did some prelim work some time ago. I'll dig it out soon.
_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
peebee


Joined: 21 Sep 2008
Posts: 1856
Location: Worcestershire, UK

PostPosted: Sun 29 Mar 2015, 05:52    Post subject:  

Hi Everybody

I feel like I maybe tweaked a tiger's tail Embarassed with what I thought was a simple request - many thanks to all you big guns for jumping in and making suggestions.

I'm going to retire gracefully behind a big rock until the tiger has stopped twitching I think!

@jamesbond - this is the edit which gcm pointed me too - his request was to make LxPup64 as touchscreen ready OOTB as possible (easily).

I think I will advise him that the manual edit option is the best I can suggest for now, although I may offer a small fix pet that does the edit for you.

Cheers and thanks
peebee

_________________
LxPup = Puppy + LXDE
Back to top
View user's profile Send private message Visit poster's website 
01micko


Joined: 11 Oct 2008
Posts: 7960
Location: qld

PostPosted: Sun 29 Mar 2015, 07:04    Post subject:  

peebee wrote:
I feel like I maybe tweaked a tiger's tail


'Twas a tale in requisite of a testicular tweak.

(apologies to Ladies for uncouth verbiage)

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
jamesbond

Joined: 26 Feb 2007
Posts: 2465
Location: The Blue Marble

PostPosted: Sun 29 Mar 2015, 08:32    Post subject:  

@greengeek - the error for the first command is probably busybox xargs (busybox too old and/or full xargs not installed); or udev too old. The second error is because xinput is not installed.

@peebee: thanks for the link. That link is explained by Mick the 5 posts above this one; adding "autoadddevices true" is the first step in removing xorg.conf altogether. That line basically tells xorg to depend on udev find out available input devices (and their types), so so you have to make sure that udev is running and working. It has an impact beyond touchscreens: all your existing keyboard/mouse xorg.conf settings *will be ignored* if you enable that line; instead things should be configured with an "InputClass" section. On the other hand, it gives you the benefit of "hotplugging" - which you can try yourself with a secondary USB keyboard (you can't use secondary USB mouse to test - secondary mouse will work even when hotplugging is disabled, but not secondary keynoard). No touchscreen is needed for these tests.

Anyway, the point is that you don't want to enable this for all users without the proper test.

As a note, Fatdog went "xorg.conf"-less 4 years ago (520 beta7), and we never looked back (you can set up xorg.conf in Fatdog, it does have xorgwizard, but only used for exceptional cases).

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send private message 
gcmartin


Joined: 14 Oct 2005
Posts: 5162
Location: Earth

PostPosted: Mon 30 Mar 2015, 14:37    Post subject:  

Hi, I have had no access ability over the past days to PUP via browser. In a rush on Saturday, I did send results to @PeeBee.

I am unaware of the implications of what was done by @TaZoC in his LightHouse64, but, he seemingly did something such that LightHouse64 does not have tracking issues in any way with its operation on touchscreen PCs or non-touchscreen PCs in my use over the years.

In fact, @TaZoC may have done something which extends what @JamesBond alludes to or is in concert with what @01Micko presents. I am not astute enough to know the difference between what they share and whether that is line with what @TaZoC actually did for community use. I do know of what @01Micko did to allow tracking to positively track touch movements in Slacko64 and with @PeeBee's work.

FYI only. If there is a need for any info I can collect that would be helpful here, feel free to request. I have HP BIOS Touchscreen laptop and I have a UEFI DELL Touch AIO currently available for any collection needs.

_________________
Get ACTIVE Create Circles; Do those good things which benefit people's needs!
We are all related ... Its time to show that we know this!
3 Different Puppy Search Engine or use DogPile
Back to top
View user's profile Send private message 
scsijon

Joined: 23 May 2007
Posts: 1123
Location: the australian mallee

PostPosted: Thu 30 Apr 2015, 12:46    Post subject:  

not sure if still wanted,

But with my new acer w5 (with touchscreen) and barry's april64, it just worked 'out of the box'.

I did note that in the notebooks setup, help, it did mention that i2c was needed to be on in the kernel and that is also needed for the latest set of touchpads, not just the touchscreens (mine is a ELAN).

However, even windows has a 'training' utility to get the 'finger or touchpen' to allign with the 'pointer' and that takes some time to do, i've yet to find a linux equivalent though.
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [15 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1289s ][ Queries: 11 (0.0066s) ][ GZIP on ]