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

248
Vistas
How to trigger keyboard function key programatically, detectable by background running exe file?

I have an exe file which can detect F6 key whenever i press in browser. But i want to do this task programatically in javascript. I have tried different methods from stackoverflow but none of them is detectable by exe file. But when i press F6 key manually then exe file detects.

These are the methods i have tried but none of them worked for me:

Javascript - trigger specific keyboard keys

Is it possible to simulate key press events programmatically?

etc.

After this automatic trigger, exe file return F7 key and i have to detect it in browser using javascript.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This is done with nodejs by using https://www.npmjs.com/package/node-key-sender

node-key-sender is good to trigger keyboard keys automatically, see the code below

const http = require('http');
var ks = require('node-key-sender');
const requestListener = function (req, res) {
  res.writeHead(200);
  res.end('Server is running under 9999 port');

  ks.sendKey('F6');
}
const server = http.createServer(requestListener);
server.listen(9999);

In response, i can detect any key trigger by https://www.npmjs.com/package/iohook

Finally my code is:

const http = require('http');
var ks = require('node-key-sender');
const ioHook = require('iohook');

const requestListener = function (req, res) {
  res.writeHead(200);
  res.end('Server is running under 9999 port');

  ioHook.on("keydown", event => {
      console.log(event);
      // {keychar: 'f', keycode: 19, rawcode: 15, type: 'keypress'}
    });
    ioHook.start();

  ks.sendKey('F6');
}

const server = http.createServer(requestListener);
server.listen(9999);
about 4 years ago · Juan Pablo Isaza Denunciar
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