This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OpenCPN multi touch, right click emulation, on screen keyboard
#1
Hello,

One of the issues that kept bugging me was the lack of multi touch support
on a touchscreen in OpenCPN and Raspbian UI in general. Well there is a fix!
The solution requires the program called 'twofing'.

It is easy to install. I’ve combined the script for my Argonaut M7 waterproof display.
See: https://github.com/bareboat-necessities/...install.sh

Now zooming works with two fingers, there is a right click emulation with two fingers touch as well.
With few modifications it can work for other screens. You will need to find out vendorID, productID
and name for your touch screen display.

Another issue is entering the text on a touchscreen. I’ve added virtual on screen keyboard.
I’ve compared several and the one I liked the most is svkbd.

I’ve made another script to install it.
See: https://github.com/bareboat-necessities/...install.sh

With 'twofing' fix and an on-screen svkbd keyboard OpenCPN is much more usable on my touch screen display.

I hope you will enjoy it.

Thanks,
--MG
Download BBN Marine OS for raspberry pi 

https://bareboat-necessities.github.io/m...at-os.html

Video of actual installation:

https://www.youtube.com/watch?v=3zMjUs2X3qU


Reply
#2
(2020-01-17, 01:49 AM)mgrouch Wrote: Another issue is entering the text on a touchscreen. I’ve added virtual on screen keyboard.
I’ve compared several and the one I liked the most is svkbd.

I’ve made another script to install it.
See: https://github.com/bareboat-necessities/my-tbareboat/blob/master/svkbd/rpi_svkbd_install.sh

Thank you for the script. I tried your script and endet up with errors. In the latest Openplotter noobs image you have to install "libxtst-dev" and "libx11-dev" first to get it working. Perhaps you can write the depencies in the script so others know what to install first.

Will try the keyboard if I'm back home.
Greetings Marco
Reply
#3
(2020-01-21, 09:31 AM)urmel86 Wrote:
(2020-01-17, 01:49 AM)mgrouch Wrote: Another issue is entering the text on a touchscreen. I’ve added virtual on screen keyboard.
I’ve compared several and the one I liked the most is svkbd.

I’ve made another script to install it.
See: https://github.com/bareboat-necessities/my-tbareboat/blob/master/svkbd/rpi_svkbd_install.sh

Thank you for the script. I tried your script and endet up with errors. In the latest Openplotter noobs image you have to install "libxtst-dev" and "libx11-dev" first to get it working. Perhaps you can write the depencies in the script so others know what to install first.

Will try the keyboard if I'm back home.
Greetings Marco

Thanks. I’ve committed fixes.
Download BBN Marine OS for raspberry pi 

https://bareboat-necessities.github.io/m...at-os.html

Video of actual installation:

https://www.youtube.com/watch?v=3zMjUs2X3qU


Reply
#4
MGrouch, thanks for sharing your latest right click solution (on Cruiser's Forum here).
https://www.cruisersforum.com/forums/f13...39147.html
(I thought it would be better to have this discussion in the OpenPlotter forum rather than in the OpenCPN forum)

However, I'm having a little problem getting this installed properly.  Please forgive my newby-ness.  I am a pretty experienced Windows (ex-) programmer, but am just getting into Linux/Raspbian.

I have installed the OpenPlotter 2 NOOBS version and it's running OK.  I've gotten Signal K running and CanUtils installed somehow, and have been able to send simulated N2K messages into to Signal K Dashboard from an Arduino (that was exciting to get working).  I hold my breath every time I try something I've found on the internet, scared I'm going to screw up my system and have to start from scratch again.  (I am periodically backing up my SD card, tho).

So I downloaded your right-click-emu.sh file to my Pi desktop.  When I double-clicked it, it opened in the editor (not what I expected, but OK).  Then I had to figure out how to run it.

Code:
sudo bash right-click-emu.sh

didn't work... said "No such file or directory"

So I moved it into my Documents folder and got pretty much the same thing.

So I tried this:


Code:
sudo bash /home/pi/Documents/right-click-emu.sh


That worked partway.  The library install worked OK, and the git clone worked ok.  But then I got an error.

Code:
cp: cannot stat 'out/evdev-rce': No such file or directory
chmod: cannot access '/usr/local/bin/evdev-rce': No such file or directory
uinput
/home/pi/Documents/right-click-emu.sh: line 27: /root/.config/autostart/evdev-rce.desktop: No such file or directory

So I tried it manually step by step, and the problem is on the make step

Code:
pi@openplotter:~ $ cd 'evdev-right-click-emulation'
pi@openplotter:~/evdev-right-click-emulation $ make all
mkdir: cannot create directory ‘out’: Permission denied
make: *** [Makefile:15: out/uinput.o] Error 1

After a little research, I think this is a permissions issue, but not sure how to properly resolve it.  

Then I tried

Code:
sudo make all

and that seemed to work.  I had a similar permissions error with the next line (chmod), and resolved it again with sudo chmod.

So I continued manually line by line and got all the way through without any more errors.  

But a 1-finger long press on my touchscreen doesn't do anything.  (And I did try a reboot). So, a few questions.

1.  Should I have started this process with your .sh file in a different directory?  If so, where?
2.  Should this work for all touchscreen devices, or is it device specific?  I have a Waveshare 7" HDMI Capacitive LCD Touchscreen.
3.  Is this only for OpenCPN use, or should it work anywhere (ie on the desktop)?

Any suggestions?  I haven't tried twofinger.  I actually don't use the screen much right now--it's more convenient to VNC from my computer with full keyboard and laptop for now, but eventually I will want to use it in touchscreen mode.

Thanks in advance for a little guidance (from anyone).

I have attached the full log from the Terminal window if you want to see every detail (and all the mistakes I made).
Reply
#5
I’ve made few fixes to the script. Try

Code:
wget https://raw.githubusercontent.com/bareboat-necessities/my-bareboat/master/right-click-emu/right-click-emu.sh
chmod +x right-click-emu.sh
./right-click-emu.sh
reboot


long touch (2 sec) works for me. 

Thanks
Download BBN Marine OS for raspberry pi 

https://bareboat-necessities.github.io/m...at-os.html

Video of actual installation:

https://www.youtube.com/watch?v=3zMjUs2X3qU


Reply
#6
Thanks, didn't work as planned.

Because of a previous attempt, the evdev-right-click-emulation directory was already there and not over-writable, nor deletable, but I eventually got it deleted and ran the script again.

Then it failed again on the make all, but "sudo make all" worked.

Then it failed on the copy sudo cp 'out/evdev-rce' '/usr/local/bin/'
With this error:
cp: cannot create regular file '/usr/local/bin/evdev-rce': Text file busy

I haven't figured a way around this.  Does OpenPlotter impose restrictions on things (permissions/directories?) to keep noobs from messing things up?

I will keep pushing on this, but did want to feed back on how your script worked for me using Raspbian/OpenPlotter 2 version.
Reply
#7
(2020-09-04, 07:07 AM)SoggyGeek Wrote: Thanks, didn't work as planned.

Because of a previous attempt, the evdev-right-click-emulation directory was already there and not over-writable, nor deletable, but I eventually got it deleted and ran the script again.

Then it failed again on the make all, but "sudo make all" worked.

Then it failed on the copy sudo cp 'out/evdev-rce' '/usr/local/bin/'
With this error:
cp: cannot create regular file '/usr/local/bin/evdev-rce': Text file busy

I haven't figured a way around this.  Does OpenPlotter impose restrictions on things (permissions/directories?) to keep noobs from messing things up?

I will keep pushing on this, but did want to feed back on how your script worked for me using Raspbian/OpenPlotter 2 version.


Try this being user 'pi':

Find PID of the process running evdev-rce


Code:
ps -efa | grep evdev-rce

then kill that process


Code:
sudo kill -9 <pid>



And after that

Code:
mkdir ~/myTmp && cd ~/myTmp
wget https://raw.githubusercontent.com/bareboat-necessities/my-bareboat/master/right-click-emu/right-click-emu.sh
chmod +x right-click-emu.sh
./right-click-emu.sh
reboot
Download BBN Marine OS for raspberry pi 

https://bareboat-necessities.github.io/m...at-os.html

Video of actual installation:

https://www.youtube.com/watch?v=3zMjUs2X3qU


Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)