PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → Enter key
Enter key
Débuté par Jeanne Sheahan, 23 aoû. 2007 11:11 - 9 réponses
Posté le 23 août 2007 - 11:11
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
Posté le 17 décembre 2008 - 12:07
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
Posté le 18 décembre 2008 - 16:06
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
Posté le 30 décembre 2008 - 10:32
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
Posté le 30 décembre 2008 - 12:12
You can find more info about the JSInfoEvent in HTML DOM Event Object
see

Happy Newyear and enjoy the WinDev / WebDev coding

Jan Kanters
Membre enregistré
94 messages
Posté le 10 septembre 2019 - 16:18
This exactly what I needed - <enter> on an edit control
Thanks (years passed, but good info)
Posté le 17 octobre 2019 - 21:09
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
Membre enregistré
6 messages
Posté le 28 juin 2021 - 12:09
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
Membre enregistré
6 messages
Posté le 28 juin 2021 - 12:10
If I set the focus on another edit control outside of the looper it works fine
Membre enregistré
6 messages
Posté le 28 juin 2021 - 15:03
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