Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

227
Visualizações
How do I add a floater button with shortcut to a function key F7?

We had old PDA machines with keypad and function keys and we have a web application that works on them made in classic ASP, jquery, and javascript. After the web application is opened, the user needs to press the F7 function to add a record for scanning a barcode.

Now the old PDA machines are dead and we are in process of purchasing android PDAs. The new machines don't have any keypad, it's just the touch screen. We tried adding a keyboard but there's not much space left on the screen to view the contents of the page and it is a bit tedious for the users.

Is there any way by which we can add a floater button on the page and by pressing it, it simulates function F7 press?

Thanks in advance.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The following script creates a button element which when clicked, initiates the clickF7 function which simulates F7 key press.

function clickF7() {
  document.dispatchEvent(new KeyboardEvent('keydown', { 'key': 'f7' }))
}

const button = document.createElement('button')
button.innerHTML = 'click f7'
document.body.appendChild(button)

button.onclick = clickF7

document.addEventListener('keydown', function (e) {
  if(e.key === 'f7') {
    console.log('clicked f7')
  }
})

EDIT: added listener to test keydown event EDIT: tested on chrome

enter image description here

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda