How do I execute an event when return is entered in a text field (instead of the user needs to click a button named "Login")

In VB it's something like using KeyPress, I remember...

Private Sub Text1_KeyPress(ByVal KeyAscii As Integer)
If KeyAscii = 13 Then
Response.Write("test")
End If
End Sub

But how do I validate what key is pressed?