mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-24 19:56:44 +00:00
Hide active tty cursor on POSIX fbdev
This commit is contained in:
parent
6bfe89cac0
commit
de0aeab435
@ -29,6 +29,7 @@
|
|||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
#if USE_BSD_EVDEV
|
#if USE_BSD_EVDEV
|
||||||
#include <dev/evdev/input.h>
|
#include <dev/evdev/input.h>
|
||||||
@ -82,6 +83,23 @@ static void* gui_entrypoint(void* arg)
|
|||||||
|
|
||||||
void TftFbdevDrv::init(int32_t w, int h)
|
void TftFbdevDrv::init(int32_t w, int h)
|
||||||
{
|
{
|
||||||
|
// check active tty
|
||||||
|
std::ifstream f;
|
||||||
|
f.open("/sys/class/tty/tty0/active");
|
||||||
|
std::string tty;
|
||||||
|
f >> tty;
|
||||||
|
tty = "/dev/" + tty;
|
||||||
|
f.close();
|
||||||
|
|
||||||
|
// try to hide the cursor
|
||||||
|
int tty_fd = open(tty.c_str(), O_WRONLY);
|
||||||
|
if(tty_fd == -1) {
|
||||||
|
perror("Couldn't open tty");
|
||||||
|
} else {
|
||||||
|
write(tty_fd, "\033[?25l", 6);
|
||||||
|
}
|
||||||
|
close(tty_fd);
|
||||||
|
|
||||||
/* Add a display
|
/* Add a display
|
||||||
* Use the 'fbdev' driver which uses POSIX framebuffer device as a display
|
* Use the 'fbdev' driver which uses POSIX framebuffer device as a display
|
||||||
* The following input devices are handled: mouse, keyboard, mousewheel */
|
* The following input devices are handled: mouse, keyboard, mousewheel */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user