I can't translate this to Delphi (since I don't know it) but I'll tell you what it does.
Private Sub Form_KeyDown(KeyCode As Integer , Shift As Integer)
This is a subroutine (hence the 'Private Sub' and not 'Private Function') that is called when the form has focus and a key is pressed
If KeyCode = vbKeyF Then End
KeyCode is passed as an argument. This statement is seeing if the 'F' key is pressed. The reason for the 'vbKeyF' is you will notice in the function that the 'KeyCode' is passed as an integer; actually the ASCII decimal code. So instead of trying to remember all the ASCII codes VB
has the programmed in for the most part. This code really does do anything in the sense that if the 'F' key is pressed then it just ends, or if any key is pressed. It would probably make more sense if it was:
If KeyCode = vbKeyF then DoFunction1() else DoFunction2() EndIf
The last part is just the standard ending for subroutine: