I have the Official 7" Screen connected to a Pi 3B V1.2. I want to create an overlay to be displayed on the screen at all times (regardless of whether I'm in a desktop environment like X, a CLI, etc.).

This could be used in several ways; my implementation will use it as a video game controller display. I have already made some python code that runs in the background, listening to touchscreen events and translating them into keypresses depending on the region of the screen that was touched, however, it is a guessing game where I am pressing on the screen. I have looked into solutions like Pygame and Kivy, however using these requires creating a window that will cover the screen. I'm looking for a way to achieve results like below:

example of drawing directly to screen

The only way I can think of doing something like this would be in assembly, accessing display memory directly and running persistently in the background. However, I have not been able to find any tutorials/examples on how to access this memory without creating my own operating system.

I have a decent amount of experience in coding, and a small amount of experience in assembly (for x86, not ARM but I'm sure I could follow along with a well-written tutorial).

Speaking of tutorials, I did find this tutorial which explains how to make assembly programs for the Pi and even how to control the screen, alas the tutorials require creating a separate kernel image and I can't even modify the first example to run without Seg Faulting.

Is there a way to do what I'm trying to do? Or are there just too many restrictions imposed by the OS where I won't be able to work with the screen directly through low-level code?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.