Enhance Big Picture Mode OSK and webview input support

Adds native input event injection for webviews via IPC, improves the on-screen keyboard (OSK) UI with a blinking cursor and label, and enables seamless text entry into webview input fields. Also refines virtual cursor click handling for better compatibility with complex sites and video players.
This commit is contained in:
2025-12-28 10:35:59 +13:00
parent 3d538a09f9
commit 8a2b7ee5e9
5 changed files with 513 additions and 57 deletions
+16
View File
@@ -204,6 +204,22 @@ ipcMain.on('exit-bigpicture', () => {
exitBigPictureMode();
});
// IPC handler for sending mouse input events to webviews (used by Big Picture Mode)
ipcMain.handle('webview-send-input-event', async (event, { webContentsId, inputEvent }) => {
try {
const { webContents: webContentsModule } = require('electron');
const targetWebContents = webContentsModule.fromId(webContentsId);
if (targetWebContents && !targetWebContents.isDestroyed()) {
targetWebContents.sendInputEvent(inputEvent);
return { success: true };
}
return { success: false, error: 'WebContents not found' };
} catch (err) {
console.error('[Main] webview-send-input-event error:', err);
return { success: false, error: err.message };
}
});
// =============================================================================