Hi,
Two approaches are available.
1. In Code Behind, please declare the VB.Net Function as the Public function.
At JavaScript, you can use <%=VBFunction();%> to call the function which is in Code Behind.
2. Do post back by using JavaScript function to call VB.Net function.
On this way, please check this thread: http://forums.asp.net/t/1227950.aspx
In your scenario, you need to call __doPostBack function in GetKeyPress() function. In Page_Load, it will call VBFunction after checking the parameters of post back.
Hope it helps.