PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → question on webdev ( 21)
question on webdev ( 21)
Iniciado por guest, 08,may. 2016 01:30 - 3 respuestas
Publicado el 08,mayo 2016 - 01:30
Does anyone know if it is possible to catch what key a user has pressed. Say F6 or something

I have a situation where someone wants to use key s to do something like in a windows app but then in a webapp.

Regards
Allard
Publicado el 08,mayo 2016 - 19:56
Hi Allard,

you could use jquery for that: https://api.jquery.com/keypress/

Best regards
Andy
Publicado el 12,mayo 2016 - 17:53
You can use a javascript function, I use the following code to capture the key pressed on the keyboard, and then you compare it to its ASCII equivalent to know which key was pressed, in my case I capture the enter when positioned in a text box, the enter ASCII code is 13, so this is my code:

// Browser procedure with JS activated
function enterPressed()
{
return event.keyCode;
}

//Code in my OnKeyPressed() of my EDT_ control
IF enterPressed() = 13 THEN
ExecuteProcess(BTN_Ingresar,trtClick)
END
Publicado el 12,mayo 2016 - 23:08
Thanks Luis,

So simpl:spos:e thanks