You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I cloned the repo and tried to follow your instructions. I run "make" on the repo, run insmod on the .ko file, and saw the virtual touchscreen is there on /dev/input/event7. However, when I printf to this event, nothing happens and when I listen using hd, there is nothing being output (please see screenshot below). I also did not get anything when I do dmesg | grep virtual_touchscreen. Do you perhaps know why? Could you perhaps tell me what am I supposed to see on dmesg and hd everytime I run a command on the virtual touchscreen? I am using Ubuntu 20.04. Thank you!
You need to issue multiple commands to /dev/virtual_touchscreen for it to actually emit some events.
In particular, you'll probably see nothing without S 0 (sync) command.
Note that even if you do see events in /dev/input/eventX, Xorg or other programs may seem to ignore it unless you issue correct commands into /dev/virtual_touchscreen. Use the GUI app and/or sample commands to try it before trying to make a generator of your own events.
cat /dev/virtual_touchscreen should output a short help for possible commands.
So I followed your suggestion and created multiple events and making sure I do sync before blocks of command. However, hd still doesn't print anything. On the left console you could see that the virtual touchscreen is indeed there. What could I be doing wrong?
So I restarted my computer, ran all the required set up steps and re-did the examples with the mistakes fixed as shown below, but still I do not get any output. Is it because I am using Ubuntu 20.04, or is there a setting I forgot to unlock?
So I solved it by going into root; perhaps I could not print to evdev if I am not root. But now I am confused about another thing; as you can see I initiated a down touch on the bottom right console by moving the cursor to x 1580 annd y 830 as shown. But that console is not highlighted. Is this the problem you mentioned where the programs may ignore the touch commands? If so how could I make them recognize it?
Yes it worked for me too now; but when I try a down touch on an area (like the unhighlighted cmd console I showed in my previous post), it did not become highlighted. How can I make the OS or other programs actually recognize my touch inputs? I attach it here again for clarity
The java -cp clojure.jar clojure.main virtual_touchscreen.clj command line may be obsolete. I was doing it in Clojure 1.3 and this clojure.main is probably changed since than.
Have you tried running the pre-built jar file I linked above?
java -jar virtual_touchscreen.jar?
Do don't need root access to run it, but you'll need to also start external program to forward events from a TCP socket to /dev/virtual_touchscreen.
Activity
vi commentedon Jun 2, 2021
You need to issue multiple commands to
/dev/virtual_touchscreenfor it to actually emit some events.In particular, you'll probably see nothing without
S 0(sync) command.Note that even if you do see events in
/dev/input/eventX, Xorg or other programs may seem to ignore it unless you issue correct commands into/dev/virtual_touchscreen. Use the GUI app and/or sample commands to try it before trying to make a generator of your own events.cat /dev/virtual_touchscreenshould output a short help for possible commands.fixedforward commentedon Jun 3, 2021
Hi,
So I followed your suggestion and created multiple events and making sure I do sync before blocks of command. However, hd still doesn't print anything. On the left console you could see that the virtual touchscreen is indeed there. What could I be doing wrong?
vi commentedon Jun 3, 2021
Syncing should come after commands, not before them.
In your second attempt the sync command was typed incorrectly:
S0\ninstead ofS 0\n.fixedforward commentedon Jun 3, 2021
So I restarted my computer, ran all the required set up steps and re-did the examples with the mistakes fixed as shown below, but still I do not get any output. Is it because I am using Ubuntu 20.04, or is there a setting I forgot to unlock?
vi commentedon Jun 3, 2021
\n S 0\nseems wrong - extra space character beforeS. Likewise forycommand.Try
{ printf 'x 200\ny 300\nd 0\nS 0' && sleep 0.2 && printf 'u 0\nS 0\n' } > /dev/virtual_touchscreen.fixedforward commentedon Jun 3, 2021
So I solved it by going into root; perhaps I could not print to evdev if I am not root. But now I am confused about another thing; as you can see I initiated a down touch on the bottom right console by moving the cursor to x 1580 annd y 830 as shown. But that console is not highlighted. Is this the problem you mentioned where the programs may ignore the touch commands? If so how could I make them recognize it?

vi commentedon Jun 3, 2021
Have just built and loaded the module into
5.10.0-6-amd64and checked that it works:Each time I change coordinates, I see incoming event. If I issue the command with the same coordinates, there is no event.
Note that slot selection
s 0\nand syncS 0\nare both required.fixedforward commentedon Jun 3, 2021
Yes it worked for me too now; but when I try a down touch on an area (like the unhighlighted cmd console I showed in my previous post), it did not become highlighted. How can I make the OS or other programs actually recognize my touch inputs? I attach it here again for clarity
vi commentedon Jun 3, 2021
Have you tried using the GUI program to generate source events?
https://github.com/vi/virtual_touchscreen/releases/download/v1.0/virtual_touchscreen.jar
fixedforward commentedon Jun 3, 2021
It says it can't find main class clojure.main
vi commentedon Jun 3, 2021
The
java -cp clojure.jar clojure.main virtual_touchscreen.cljcommand line may be obsolete. I was doing it in Clojure 1.3 and thisclojure.mainis probably changed since than.Have you tried running the pre-built jar file I linked above?
java -jar virtual_touchscreen.jar?Do don't need root access to run it, but you'll need to also start external program to forward events from a TCP socket to
/dev/virtual_touchscreen.vi commentedon Jun 3, 2021
Checked that
virtual_touchscreen.cljstill starts withClojure 1.10.2.