Web listbox cursor keys

Is it normal that a web listbox does not respond to cursor keys running in debug mode? I tested on OSX Mavericks en Windows 7… no response. Xojo demo apps and my own try outs behave the same. Chrome and Safari…

There is a feature request for that.
You can put it in your favorites in Feedback.

#15654
fyi.

Setfocus does not seem to work, as KeyPressed never gets fired.

The best workaround seems to be to use the WebPage KeyPressed event to monitor the keyboard arrows and move up and down the select in the WebListBox.

Sub KeyPressed(Details As REALbasic.KeyEvent) Select Case details.KeyCode Case details.KeyArrowDown if ListBox1.ListIndex < 0 Then ListBox1.listIndex = 0 ListBox1.Selected(0) = True return end if if ListBox1.Listindex < ListBox1.RowCount-1 then ListBox1.ListIndex = ListBox1.listindex+1 ListBox1.Selected(ListBox1.ListIndex) = True end if Case details.KeyArrowUp if ListBox1.ListIndex < 0 Then ListBox1.listIndex = 0 ListBox1.Selected(0) = True return end if if ListBox1.Listindex >0 then ListBox1.ListIndex = ListBox1.listindex-1 ListBox1.Selected(ListBox1.ListIndex) = True end if End Select End Sub

Hey Michel,
Did you know there is a case: 21741 - Weblistbox Keypressed event does not fire
It is currently ranked #47. The more people who vote for it in Feedback, the quicker it will become a priority to be fixed.

[quote=159340:@Jim Frankland]Hey Michel,
Did you know there is a case: 21741 - Weblistbox Keypressed event does not fire
It is currently ranked #47. The more people who vote for it in Feedback, the quicker it will become a priority to be fixed.[/quote]

To make it even better, arrow keys are not detected correctly in IE because it does not react to keypressed. So the IE bug creates a problem in Xojo…

Hello!
trying to use the arrow keys, chrome, firefox, does not trigger with keypressed, neither the webpage, nor the weblistbox.
is there any way?
regards

As I explained on the post just before yours, you would have to get the keys in JavaScript with the onKeydown event since arrow keys don’t register in KeyPressed. Note it is a browser bug, not a Xojo bug :
https://www.w3schools.com/jsref/event_onkeydown.asp