R rsbuysell Guest Jul 3, 2007 #1 All I want to know how to do is make something so that when I press "1" it will press "f1", when I press 2 it will press "f5". Or if someone could make for me that'd be great.
All I want to know how to do is make something so that when I press "1" it will press "f1", when I press 2 it will press "f5". Or if someone could make for me that'd be great.
jdsfighter Forum Addict Joined Jan 21, 2007 Sythe Gold 0 Messages 603 Age 33 Location USA Jul 3, 2007 #2 Pretty simple really. All you need is a timer with an interval of 200 and the following code. Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer Private Sub Timer1_Timer() If GetAsyncKeyState(vbKey1) Then SendKeys vbKeyF1 End If If GetAsyncKeyState(vbKey2) Then SendKeys vbKeyF5 End If End Sub Click to expand...
Pretty simple really. All you need is a timer with an interval of 200 and the following code. Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer Private Sub Timer1_Timer() If GetAsyncKeyState(vbKey1) Then SendKeys vbKeyF1 End If If GetAsyncKeyState(vbKey2) Then SendKeys vbKeyF5 End If End Sub Click to expand...
BEEF TOILET Joined Nov 23, 2006 Sythe Gold 1,609 Messages 7,145 Age 33 Location Canada Jul 6, 2007 #3 jds hit the nail on the head, all you need rsbuysell.