Add Steam Input support for Big Picture Mode
Introduces a Steam Input bridge using steamworks.js, enabling native controller support in Big Picture Mode and on Steam Deck. Adds a new steam-input-manager.js module, integrates IPC handlers in main.js, exposes a steamInputAPI in preload.js, and updates bigpicture.js to use Steam Input when available with fallback to legacy Gamepad API. Updates dependencies and scripts in package.json for Steam Deck and Big Picture profiles.
This commit is contained in:
@@ -9,12 +9,14 @@ const PerformanceMonitor = require('./performance-monitor');
|
||||
const GPUFallback = require('./gpu-fallback');
|
||||
const GPUConfig = require('./gpu-config');
|
||||
const PluginManager = require('./plugin-manager');
|
||||
const SteamInputManager = require('./steam-input-manager');
|
||||
|
||||
// Initialize performance monitoring and GPU management
|
||||
const perfMonitor = new PerformanceMonitor();
|
||||
const gpuFallback = new GPUFallback();
|
||||
const gpuConfig = new GPUConfig();
|
||||
const pluginManager = new PluginManager();
|
||||
const steamInputManager = new SteamInputManager();
|
||||
|
||||
// Try to enable WebAuthn/platform authenticator features early.
|
||||
// This helps Chromium expose platform authenticators (Touch ID / built-in) where supported.
|
||||
@@ -263,6 +265,19 @@ ipcMain.on('exit-bigpicture', () => {
|
||||
exitBigPictureMode();
|
||||
});
|
||||
|
||||
// Steam Input bridge
|
||||
ipcMain.handle('steam-input-start', (event) => {
|
||||
return steamInputManager.subscribe(event.sender);
|
||||
});
|
||||
|
||||
ipcMain.on('steam-input-stop', (event) => {
|
||||
steamInputManager.unsubscribe(event.sender);
|
||||
});
|
||||
|
||||
ipcMain.handle('steam-input-status', () => {
|
||||
return steamInputManager.getStatus();
|
||||
});
|
||||
|
||||
// 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 {
|
||||
@@ -676,6 +691,14 @@ app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') app.quit();
|
||||
});
|
||||
|
||||
app.on('before-quit', () => {
|
||||
try {
|
||||
steamInputManager?.dispose?.();
|
||||
} catch (err) {
|
||||
console.warn('[SteamInput] dispose failed:', err);
|
||||
}
|
||||
});
|
||||
|
||||
// ipcMain handlers
|
||||
|
||||
// --- Auto-Update IPC handlers ---
|
||||
|
||||
Reference in New Issue
Block a user