Trying to SendKeys when someone presses "F" with VB08

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Apolakkiatis
    New Member
    • Jan 2008
    • 30

    Trying to SendKeys when someone presses "F" with VB08

    I was experimenting around and tried to make it so that if someone presses the F key on their keyboard it also sends the rest of the letters to complete F*** anytime someone presses that letter... I know it's cruel but I just want to mess around with my friend and send it to him, hahaha... I know that the 32 to 128 is wrong, but I dont know what the # for F is.... It's probably more messed up than just that so someone please help me!


    [CODE=vbnet]Public Class Form1
    Private Declare Function GetKeyState Lib "user32" (ByVal vKey As Integer) As Integer
    Dim Result As Integer
    Dim i As Double
    Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As System.EventArg s) Handles MyBase.Load
    For i = 32 To 128
    Result = GetKeyState(i)
    If Result = -32767 Then
    SendKeys.Send(" UCK")
    End If
    Next i
    End Sub
    End Class[/CODE]
    Last edited by Killer42; Feb 1 '08, 01:24 AM. Reason: Added CODE=vbnet tag
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    If you want to know the code for "F", you can either look it up in the doco, or ask VB. Do a KeyDown or KeyPress event procedure, and tell it to display the value. Then run the form, and see what is displayed.

    I don't know which value you'd need, because I don't know whether that API call requires an ASCII code or keycode.

    Comment

    Working...