I have an embedded application which is using x11 with opengl for windowing and rendering of graphics. The device has a touch screen, which is used for application interaction. Currently, the touch screen driver is implemented in our application space and we handle the events accordingly.
However, I want that the touch events should go to the application via X11 interface.
Can anyone help me understand how this can be achieved ?
Probably the easiest way is the uinput module. This allows you to create a "virtual device" in userspace that can generate events. Those can be caught with the evdev driver by the xserver and sent to your application (o any other window).
See linux uinput: simple example?
Related
Lets say i have a Linux (Ubuntu), well NVIDIA packaged one that comes with Jetson boards, and i have HDMI output and DP.
The goal is to: Display Desktop part via HDMI, and display GUI that i made with OpenGL via DP, but without DP ever showing Desktop, if process with GUI exits, the display connected via DP does not show anything until process is restarted.
So far i have researched X server, but most of the materials just talk about X11 protocol, and how to create a window. If i just open a window in full-screen mode, it could work, but until GUI is launched i would see part of Ubuntu desktop there.
The GUI is basically a Monitor with CT Overlay that sends touch input via I2C.
I'm trying to make some kind of video generator in order to test monitors. For this I'm trying to avoid any X and window manager so I'm stuck with a non GUI Linux.
I was able to write directly into the framebuffer device under Linux but I wasn't able to change the resolution at all. Fbset didn't have any effect.
With the help of a tutorial, I was able to change the resolution with DRM but only modes that my screen is telling that it is supporting.
Is there any way to disable the EDID readout at all or inject custom timings?
you can stuff whatever values you want into the drmModeModeInfo structure before initializing drm. so any custom video mode is possible.
Moving from the world of Embedded Micro controllers and C, to C++ with wxWidgets.
I've created a simple GUI program, using codeblocks and wxWidgets to interface with a USB Hid device I've made using the HIDAPI from signal11.
Using simple buttons, I can connect, disconnect and check firmware software versions on the device.
What I want to be able to do is have the GUI automatically detect if a device is present or not, so If I unplug my device the GUI responds (Greys everything out) or re enables everything when plugged in.
Is this something that needs a never ending thread to achieve, or is there a better way? I would usually do something like this in an interrupt routine on a micro controller, but am unsure of its equivalent on the desktop platform?
USB devices connections/disconnections are not handled by wxWidgets, so you will have to use platform-specific APIs for this and they vary depending on your platform. Under Windows, you actually don't need a background thread because you get these notifications in the form of Windows WM_DEVICECHANGE message, so you can simply override MSWHandleMessage() in the window for which you had previously asked Windows to send these messages to using RegisterDeviceNotification() and handle them there.
I am designing a USB keyboard with special capabilities. What information can such a HID device receive from the host?
Can I via USB:
Read data from a form on the screen?
Find out what OS the user is on?
Find out if there's been an error message?
Even 'know' what's going on visually on the screen, i.e. what program is selected or whether the program is windowed or fullscreen?
Thank you!
The device can't get any of this information from a standard driver that the operating system supplies because that would be a security issue. It can receive any information that your own driver or application sends it. There are many ways to communicate with it - your device could present multiple interfaces (which will appear as separate devices), multiple endpoints, or use the control channel. You will definitely need to study the spec, and I also found this tutorial helpful.
I have done something similar and used the control channel to exchange feature data with a Windows application (over the standard Windows driver). On Windows, the API calls are HidD_SetFeature() and HidD_GetFeature().
On the device side, my hardware ran embedded Linux and I used the GadgetFS library to create a user-mode driver - much easier to debug than a kernel driver.
As others have said, you'll run into issues if you try this with a normal HID. However, there is a project called the USB Rubber Ducky. From their description:
The USB Rubber Ducky isn't your ordinary HID (Human Interface Device).
Coupled with a powerful 60 MHz 32-bit processor and a simple scripting language
The USB Rubber Ducky looks like a usb-device and is recognized as a HID, but is programmable. You can make a small script that will be typed onto the screen which will allow you to performs the queries you seek.
With the USB Rubber Ducky you can:
Read data from a form on the screen? Yes
Find out what OS the user is on? Yes
Find out if there's been an error message? Yes
Even 'know' what's going on visually on the screen, i.e. what program is selected or whether the program is windowed or fullscreen? Yes
If you aren't hoping to buy this device, at least their firmware is on github so it can provide you a starting point
I have an embedded Linux 3.10.17 system running a Qt Quick 5.2.1 application. It has a graphical UI that can be controlled by plugging in a USB keyboard. What I would like to do is to control the application remotely via a remote desktop connection to a Windows PC sitting next to the embedded system. Currently any STDIO is not sent in as keyboard events to the Qt application. Three ideas came to mind
Modify Qt application to take in STDIO data so it acts on those events. I thought this would be a common thing to do, but so far my searches has not yielded any good solutions.
Create a Linux kernel driver that sends any keycodes received through a char device write (pipe) through the input subsystem. Something like this should be available I'd think...
Buy some form device that plugs into the embedded system via USB and connects to the PC via USB, RS232 or Ethernet.
I'm not sure which path offers the least resistance. Any expert advice on this would be appreciated
Thanks,
Otto