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:
@@ -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 };
|
||||
}
|
||||
});
|
||||
|
||||
// =============================================================================
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user