Although brinuz's will work with the form focussed, I find that global hotkeys are much better.
Add this declaration
[php]
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Int32) As Int16
[/php]
And then simply change your code to this:
[php]
if GetAsyncKeyState(keys.f1) then
'<action>'
end if
[/php]
And that's all there is to it.
Make sure you put that in a timer and enable it ^.-
@J-Deezy
Those that hotkey work even itf the form is not focused?
Just pointing it out so he doesn't put it into the keydown event ^_^
Keydown = only affects if the control is focused
Getasynckeystate = global