WebControl.KeyPressed

From Xojo Documentation

Event


WebControl.KeyPressed(Details As Realbasic.KeyEvent)

New in 2011r2

Supported for all project types and targets.

A key was pressed and released in the control (this could be repeatedly if the user held down the key). The key that was released is in the passed Details parameter. It should be compared with the KeyEvent constants to determine which key was released.

Notes

This event handler is only called for the web page itself and text-based controls such as WebTextField, WebTextArea and WebSearchField.

Example

The following code determines which Arrow key was pressed in a control.

Select Case details.KeyCode
Case details.KeyArrowDown
MsgBox("Down arrow")
Case details.KeyArrowLeft
MsgBox("Left arrow")
Case details.KeyArrowRight
MsgBox("Right arrow")
Case details.KeyArrowUp
MsgBox("Up arrow")
End Select

See Also

Realbasic.Keyevent constants.