hi all,
anyone coded an external for fetching xinput device?
xinput --list xinput test 12 (tablet) motion a[0]=12619 a[1]=12856 a[2]=0 a[3]=-4 a[4]=-7 a[5]=-900 motion a[0]=12568 a[1]=12756 a[2]=0 a[3]=-4 a[4]=-7 a[5]=-900 motion a[0]=12531 a[1]=12618 a[2]=0 a[3]=-4 a[4]=-7 a[5]=-900 button release 2
hi,
i am using a modified version of xinput (adding ";", leading 0 and
unbuffered) with pdsend (udp). i can now get my tablet
x,y,pressure,tilt in pd. a demo patch is included (showing a way to
parse xinput test data).
https://github.com/patricksebastien/xinputpdsend
the only problem is that i am using [shell] to execute the xinput |
pdsend and when quitting pd it hangs until killall xinput.
not very elegant, but working for me.
Le 19/12/2013 07:53, puredata@11h11.com a écrit :
hi,
i am using a modified version of xinput (adding ";", leading 0 and unbuffered) with pdsend (udp). i can now get my tablet x,y,pressure,tilt in pd. a demo patch is included (showing a way to parse xinput test data).
https://github.com/patricksebastien/xinputpdsend
the only problem is that i am using [shell] to execute the xinput | pdsend and when quitting pd it hangs until killall xinput.
not very elegant, but working for me.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hello,
It should be possible to make a bash script where you would start xinput and pd in background and get their PID. Then use a loop to check if pd is still alive (with its PID), if not, you kill xinput. ++
Jack
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
On 2013-12-19 07:53, puredata@11h11.com wrote:
hi,
i am using a modified version of xinput (adding ";", leading 0 and unbuffered) with pdsend (udp). i can now get my tablet x,y,pressure,tilt in pd. a demo patch is included (showing a way to parse xinput test data).
https://github.com/patricksebastien/xinputpdsend
the only problem is that i am using [shell] to execute the xinput | pdsend and when quitting pd it hangs until killall xinput.
you might consider using UDP instead of TCP for sending data back to Pd. UDP seems to be much more stable (esp. when it comes to broken connections), and if you are only using localhost, the network reliability should be a non-issue.
as for adding ";" and leading "0"; you might want to use sed
.
fgamsdr IOhannes
On 2013-12-19 11:32, IOhannes m zmoelnig wrote:
as for adding ";" and leading "0"; you might want to use
sed
.
or use a script like the attached one (on Debian, 'unbuffer' can be found in the 'expect-dev' package)
usage: ./xinput.sh <id> <udp-port>
as for the problem of terminating a process in [shell], i usually start external senders outside of Pd:
<script> #!/bin/sh ./xinput.sh 12 9998 & XINPUT_PID=$1 pd -open mypatch.pd kill -QUIT ${XINPUT_PID} <script> gfmadsr IOhannes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Le 19/12/2013 12:04, IOhannes m zmölnig a écrit :
On 2013-12-19 11:32, IOhannes m zmoelnig wrote:
as for adding ";" and leading "0"; you might want to use
sed
.or use a script like the attached one (on Debian, 'unbuffer' can be found in the 'expect-dev' package)
usage: ./xinput.sh <id> <udp-port>
as for the problem of terminating a process in [shell], i usually start external senders outside of Pd:
<script> #!/bin/sh ./xinput.sh 12 9998 & XINPUT_PID=$1 pd -open mypatch.pd kill -QUIT ${XINPUT_PID} <script> gfmadsr IOhannes _______________________________________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
Ya, better and simpler than to check if pd is still alive : keep pd in foregroud ;) ++
Jack