No SDL2 keyboard events on the Raspberry Pi? - sdl

I'm trying to use SDL2 2.0.3 on the Raspberry Pi running the latest Raspbian, but my program does not receive any events from the keyboard. (The joystick and haptics work, and graphics work). Adding my user to the tty and input groups, or running the program as root, does not help. Are there additional configuration steps or packages that need to be installed on the Pi for SDL2 keyboard input to work?
(Once the program exits, the Raspberry Pi has to be reset for keyboard input to work at all on the device, although this could be because of my own failure to call SDL_Quit()?)

Installing libudev-dev and rebuilding SDL2 made mouse and keyboard input work for me:
sudo apt-get install libudev-dev
Run ./configure in the SDL2 directory and search for the line
Using libudev : YES
Can't help you with failed keyboard input after program exit, sorry.

Related

OpenCV trying to use windows to show image throws exception

I´m trying to create named windows and show an image from them using OpenCV in c++. When I try it, I will get an error saying:
The function is not implemented. Rebuild the library with Windows,
GTK+2.x or Cocoa support. If you are on Ubuntu or Debian, install
libgtk2.0-dev and pkg-config, then re-run cmake or configure script in
function 'cvNamedWindow'.
I´m on a raspberry pi using Ubuntu MATE and I didnt have this problem when I was testing on my laptop using Ubuntu. I have checked that all neccessary libraries are installed. So I run cmake again to recompile it, but it still doesn t work.
Is there something different I need to do for Ubuntu MATE? Or is there something else I should try?

How Qt's example built during cross compiling qt compared to run qmake after compiling?

FIRST, it's not the issue that Qt CANNOT found target .so, qt can found it, but it failed to load it and produce not logs... on both terminal and gdb. It seems that qmake/make is using wrong library but I have only one qt installed in my cross compile environment that generated by make install.
I'm struggling for cross compiling qt5.10 for raspberry pi on Windows. I'm using msys2, gnutoolchains's raspberry chains.
The problem here is the examples built by the compiling process runs almost no problem, I only needs to add a qt.conf to fix the prefix override by msys2 and it can run and display something on my pi.
But when it comes to qt creator, or qmake out of cross compiling, it starts to show me:
This application failed to start because it could not find or load the Qt platform plugin "xcb"
Here are two problems, first, the platform plugin should not be xcb since I'm running without x, cross compiled version will use eglfs by default.
And, second, even I specific platform plugin to eglfs, it still tells me it cannot load eglfs.
I'm putting two version of programs in the same place.
qt5pi/examples/opengl/2dpainting $ ls
2dpainting glwidget.cpp helper.h widget.cpp window.h
2dpainting.pro glwidget.h main.cpp widget.h
2dpaint_my helper.cpp qt.conf window.cpp
2dpaint_my is compiled by qmake && make and 2dpainting is by qt's cross compiling process uses the same source.
I'm suspecting qt is adding something during it's cross compiling, but I'm not sure how it happened. Qt'wiki about raspberry pi contains nothing about this issue.
update
It looks even wired to me. I copied a running example from its folder to another and it also crash, things look like this..
pi#raspberrypi:/usr/local/qt5pi/examples/qt_test $ cp ../opengl/2dpainting/2dpainting .
pi#raspberrypi:/usr/local/qt5pi/examples/qt_test $ ./2dpainting
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen,vnc, webgl, xcb.
Reinstalling the application may fix this problem.
Aborted
pi#raspberrypi:/usr/local/qt5pi/examples/qt_test $ ../opengl/2dpainting/2dpainting
qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_brcm","eglfs_emu")
qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_brcm", "eglfs_emu")
qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_brcm"
qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_brcm"
qt.qpa.input: Initializing tslib plugin "TsLib" ""
qt.qpa.input: tslib device is "/dev/input/event0"
I'm not sure, but it seems that the this step on qt'wiki introduced some qt5.7 files into lib folder.
sudo apt-get update
sudo apt-get build-dep qt4-x11
sudo apt-get build-dep libqt5gui5
sudo apt-get install libudev-dev libinput-dev libts-dev libxcb-xinerama0-dev libxcb-xinerama0
The problem is, qt's examples, when it on their own folders, can magically find (maybe qmake install did something?) and use the correct *.so, and so it works without problem.
But, when compiling with qmake, the program won't find the correct libraries so, newer libq*.so with older libQtXXXXX.so lead to this probleam. And that's how it uses a different qt version with compile.
And, that indicates the optional 00- in step 13 from the wiki:
[on RPi] Update the device to let the linker find the Qt libs:
echo /usr/local/qt5pi/lib | sudo tee /etc/ld.so.conf.d/qt5pi.conf
sudo ldconfig
If you're facing issues with running the example, try to use 00-qt5pi.conf instead of qt5pi.conf, to introduce proper order.
should be taken even the examples run without problem.

Qt5.7 installed on Raspberry Pi3 and working...how to get QtCreator?

I've finally mangaged to get Qt5.7 on a Raspberry Pi3, and have built an example which runs on the Pi, this was done by carefully following:
Step by Step instructions on how to install Qt5.6 on Raspberry Pi3
To get 5.7 on the Pi simply replace:
git clone git://code.qt.io/qt/qtbase.git -b 5.6
With:
git clone git://code.qt.io/qt/qtbase.git -b 5.7
This sets-up the tool chain on a Linux host in my case Ubuntu 16.04, however it doesn't install QtCreator, I then tried installing QtCreator and messed up the build, so I had to start over.
How do I get the latest QtCreator installed on either the Ubuntu 16.04 or preferably on the Pi3 ?
I just started following these instructions: https://www.ics.com/blog/configuring-qt-creator-raspberry-pi
It starts with installing QtCreator on the Desktop, as you are cross compiling, why would you want it on the Pi itself?
Still waiting for the build to complete, wonder if it will all work right away :)

How to install cocos-2d templates in Xcode 5?

When i am trying to execute following command from Terminal in Maverick os(Xcode 5) to install templates of cocos2d 3.0 rc-1, I am getting following message.
-bash: install.sh: command not found
What could be the reason ?
Please help by giving some meaningful comments/hint...
Download Latest Cocos2d.
Open the terminal (Don't type anything).
Drag the install file (install-templates.sh/install.sh) into the terminal.
Finally press enter only.
Now,you check the Xcode->New Project there you get cocos2d.
To install cocos2d to Xcode on Mavericks, in terminal type in the following commands. Also you should move the cocos2d folder to your desktop just for simplicity.
cd ~\Desktop\[Cocos2d Folder];
sudo install.sh //I think you are missing the 'sudo'
Then enter in your password when you are prompted. Text will not show up even if you are typing. After terminal finishes you can open up you xcode and you should see a cocos2d template option on the left navigation bar.
Tutorial: http://iphonedevsdk.com/forum/ad-hoc-beta-testing/75910-how-to-install-cocos2d-in-xcode.html
Cocos2d: http://www.cocos2d-iphone.org/download/
Simply use Cocos2d installer that they provide on there website
http://www.cocos2d-iphone.org/blog/wp-content/uploads/2014/01/Cocos2D-3.0.dmg
The link will start the download and them install the dmg, the program takes care of the rest :D
If you'd like to read up on it go to http://www.cocos2d-iphone.org/download/ and look at the section marked 1)

Qt on beagle bone black (full install not cross-compile)

I want to use qt on beagle bone black same as we use on desktop without "cross compiling" and "tool chain" stuff. I already done this for raspberry pi running raspbian wheezy using
apt-get install qtcreator
command. I searched on google and found something called qt embedded for BBB. I followed
opkg update
opkg install qt4-embedded --force-depends
opkg install libqtcoree-dev libqtguie-dev
instructions and installed qt embedded on BBB running Armstrong on it.
Now i have a project developed on my desktop in qt creator and i want to build it on BBB. I am searching for this from last two days with no success, all i found eveywhere is "cross compile" and "tool chain". Does anyone knows how to build qt project on BBB natively (whether it is possible or not?)?
I copied my folder containing qt project on Armstrong desktop.
Then i go in directory
cd Desktop/DisplayPara
and tried
qmake DisplayPara.pro
it only shows somthing like this
sh: -d:command not found
sh: -d:command not found
I tried
qmake -project DisplayPara.pro
which also end up with same error. I don't know what's going wrong ? any help, suggestions will appreciated. Thanx...
I didn't have any luck with those instructions either.
I removed all Qt packages and did:
opkg install qt4-embedded
opkg install qt4-embedded-dev
Then in the directory with my application I did:
source /usr/share/qtopia/environment-setup
qmake -project
qmake
make
Exit gnome (or other desktop). I just use Ctrl-Alt-F1 to get to a console window.
Then run:
./myapp -qws
The -qws flag makes the application run under its own Qtopia server.
I would like to be able to run under the Gnome desktop environment, but this is the only way I could get something that works.
Hints welcome.