PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WEBDEV 2024 → Enter key
Enter key
Iniciado por Jeanne Sheahan, ago., 23 2007 11:11 AM - 9 respostas
Publicado em agosto, 23 2007 - 11:11 AM
WB10:I am developing a data entry screen, does anyone know how to enable the entry and/or arrow keys. Using controls you must tab to get to the next field and this is very awkward.

Thanks,
Jeanne
Publicado em dezembro, 17 2008 - 12:07 PM
Dear Jeanne,

I am very sorry for disturbing you.
Would be so kind and inform me if you had any reply related to this topic?
I am developing in WebDev nowadays and I found similar problem unfortunately.
I would like to use arrow keys for navigation and enter key for selection on a table.

Many thanks in advance.

BR,
Aurel


Jeanne Sheahan wrote in news message <46cc82e0$1@news.pcsoft.fr>:



WB10:I am developing a data entry screen, does anyone know how to enable the entry and/or arrow keys. Using controls you must tab to get to the next field and this is very awkward.

Thanks,
Jeanne
Publicado em dezembro, 18 2008 - 4:06 PM
you have to use the event Onkeypress
where you can use the following code

nKey is int = JSInfoEvent("keyCode")

IF nKey = 13 THEN
... (you code here
END

Feedback is appreciated

Greetings

Jan Kanters
Publicado em dezembro, 30 2008 - 10:32 AM
Dear Jan,

Thanx a lot for your quick reply and sorry for my delay; I was not on board.
It seems to be fine and usable from my point of view.

Would you reveal where I can find these kinds of properties to use like "keyCode"?

Lucky New Year!

BR,
Aurel
Publicado em dezembro, 30 2008 - 12:12 PM
You can find more info about the JSInfoEvent in HTML DOM Event Object
see

Happy Newyear and enjoy the WinDev / WebDev coding

Jan Kanters
Membro registado
94 mensagems
Publicado em setembro, 10 2019 - 4:18 PM
This exactly what I needed - <enter> on an edit control
Thanks (years passed, but good info)
Publicado em outubro, 17 2019 - 9:09 PM
KeyCode is not working for me.

this an a looper sample with chrome and firefox

// IN WL CODE (onkeydown) /// USE LOOPER in BROWSE MODE, not in AJAX MODE for this

nKey is int = JSInfoEvent("which")
ndx is int = 0

IF nKey = 13 THEN // enter key
ndx = LOOPER_pptoVertical
SetFocus(ATT_field[ndx+1])
END

IF nKey = 40 THEN // up arrow
ndx = LOOPER_pptoVertical
SetFocus(ATT_field[ndx+1])
END
IF nKey = 38 THEN // down arrow
ndx = LOOPER_pptoVertical
SetFocus(ATT_field[ndx-1])
END

saludos
Membro registado
6 mensagems
Publicado em junho, 28 2021 - 12:09 PM
I am using the following code on a classic looper , ths works on webdev 21 but i cannot get it to work on webdev 26
I want to acces the same edit on the next line in the looper when pressing enter
The focus remains on the same line.
nKey is int = JSInfoEvent("keyCode")
i is int
i = LOOP_NoName1

IF nKey = 13 THEN
LOOP_NoName1 = i + 1
SetFocus(LOOP_NoName1.ATT_NoName5)

END
Membro registado
6 mensagems
Publicado em junho, 28 2021 - 12:10 PM
If I set the focus on another edit control outside of the looper it works fine
Membro registado
6 mensagems
Publicado em junho, 28 2021 - 3:03 PM
i found out that if you have created an attribute for this control in the looper , it does not work .
When there are no attributes , ik works fine