fix: touch event handling for inactive screens #61

This commit is contained in:
leukipp
2025-09-08 16:23:04 +02:00
parent d35cf27de9
commit 0b927a3ef6
4 changed files with 65 additions and 62 deletions
+5 -6
View File
@@ -3,13 +3,11 @@ const fs = require("fs");
const path = require("path");
const fsp = require("fs/promises");
const cpr = require("child_process");
const Events = require("events");
global.HARDWARE = global.HARDWARE || {
initialized: false,
events: new Events(),
session: {},
support: {},
session: {},
battery: {
level: {
path: null,
@@ -106,12 +104,13 @@ const init = async () => {
return;
}
HARDWARE.keyboard.visibility = property.Visible === "true";
HARDWARE.events.emit("updateKeyboard");
EVENTS.emit("updateKeyboard");
});
});
// Check for display changes
interval(update, 1000);
setDisplayStatus("ON");
return true;
};
@@ -130,7 +129,7 @@ const update = async () => {
if (status !== HARDWARE.display.status.value) {
console.log("Update Display Status:", getDisplayStatus());
HARDWARE.display.status.value = status;
HARDWARE.events.emit("updateDisplay");
EVENTS.emit("updateDisplay");
}
}
@@ -140,7 +139,7 @@ const update = async () => {
if (brightness !== HARDWARE.display.brightness.value) {
console.log("Update Display Brightness:", getDisplayBrightness());
HARDWARE.display.brightness.value = brightness;
HARDWARE.events.emit("updateDisplay");
EVENTS.emit("updateDisplay");
}
}
};