vb6 programming question

Talk about your favorite PC games, Steam and building awesome custom rigs!

Moderator: Moderators

Post Reply
dcwhat
Posts: 10
Joined: Tue Jan 04, 2011 2:22 pm
PSN Username: DcWHaT07

vb6 programming question

Post by dcwhat » Tue Nov 19, 2013 11:13 pm

Hey ALL!! I built a Mame machine and i made a home made beatmania iidx controller, i am having trouble writing the code for this. I have a optic mouse under the turntable and when it moves i have my code see that the number changes so it will push the desired keys, but in VB6 it sends the key not emulates pushing it. Can anyone help me??:? here is the code

Code: Select all

Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
    

Private Type POINTAPI
    x As Long
    y As Long
    v1 As Long
    z As Long
    
End Type
Private Function GetCursorPosEx() As POINTAPI
GetCursorPos GetCursorPosEx
End Function


Private Sub Timer1_Timer()
With GetCursorPosEx
   ' Dim v1 As Integer
    x = .x
    'y = "Current Y = " & .y
    'z = "currect X = " & v1
    End With
    End Sub

Private Sub Timer2_Timer()
AppActivate "MAME"
With GetCursorPosEx
    z = .x
    Dim sy As Integer
    Dim sz As Integer
    'If z = .x Then
    Text1.Text = x
    If z = Text1.Text Then
    y = "Scratch Me!"
    ElseIf z > Text1.Text Then
    y = "Greater"

' and then you can use this:
SendKeys "{k}"
    ElseIf z < Text1.Text Then
    y = "smaller"
    SendKeys "{l}"
    Else
   End If
End With
End Sub


dcwhat
Posts: 10
Joined: Tue Jan 04, 2011 2:22 pm
PSN Username: DcWHaT07

Re: vb6 programming question

Post by dcwhat » Wed Nov 20, 2013 2:17 pm

ok so i figured it out, the code that sends over k and l worked all along i needed to turn on mouse support on my program. thanks for everyone else.

Post Reply