Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

303
Vistas
Electron - Add click listener when setIgnoreMouseEvents is set to true?

Does anyone know if it's possible to capture click events with Electron when setIgnoreMouseEvents is true? I'm using Electron as a transparent overlay, forwarding clicks to a background application. When the background application receives a click, I'd like to update the Electron app, but the click listener isn't firing. Here's the code:

index.js

const electron = require('electron');
const fetch = require('electron-fetch').default

const { app, BrowserWindow, session } = require('electron')

function createWindow () {
  const win = new BrowserWindow({
    width: 3840,
    height: 2160,
    x: 0,
    y: 0,
    transparent: true,
    frame: false,
    alwaysOnTop: true,
    focusable: false,
    webPreferences: {
      nodeIntegration: true,
      enableRemoteModule: true,
      contextIsolation: false,
    }
  })
  win.setFocusable(false);
  win.setIgnoreMouseEvents(true, { forward: true }), // forward clicks to background application
  win.webContents.openDevTools();
  win.loadFile('index.html')
}

app.on('ready', () => {
  console.log('app is now ready');
  createWindow();
});

index.js

  const electron = require('electron');
  const remote = require("electron").remote;

  let win = remote.getCurrentWindow();
  window.addEventListener("mousemove", event => {
    console.log("mouse movements are detected")
  });

  window.addEventListener("click", event => {
    console.log("how can I get this log statement to print in the console?") // never fires
  });
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda