오토마우스 오른쪽 클릭이 작동하지 않아요

오른쪽·왼쪽 오토마우스를 만들었는데 왼쪽 클릭은 되고 오른쪽 클릭은 작동하지 않아요.
잘못된 부분이나 빠진 코드가 있는지 봐주실 수 있을까요?

```vb
Private Declare Function GetAsyncKeyState Lib user32 (ByVal vKey As Long) As Integer
Private Declare Sub mouse_event Lib user32 (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Const mouseeventf_leftdown = &H2
Private Const mouseeventf_leftup = &H4
Private Sub HScroll1_Change()
Label1.Caption = HScroll1.Value
End Sub
Private Sub HScroll2_Change()
Label4.Caption = HScroll2.Value
End Sub
Private Sub mnuExit_Click()
Unload Me
End Sub
Private Sub RichTextBox1_Change()
End Sub
Private Sub Timer1_Timer()
If GetAsyncKeyState(189) Then
If Timer2.Enabled Then
Timer2.Enabled = False
MsgBox 마우스가 현재 실행중 입니다., vbInformation, 알림
MsgBox 다시 실행해 주십시오, vbInformation, 알림
Else
Timer2.Interval = HScroll1.Value
Timer2.Enabled = True
End If
ElseIf GetAsyncKeyState(187) Then
If Timer2.Enabled Then
Timer2.Enabled = False
Else
MsgBox 현재 실행중이 아닙니다., vbInformation, 알림
End If
End If
End Sub
Private Sub Timer2_Timer()
mouse_event mouseeventf_leftdown, 0, 0, 0, 0
mouse_event mouseeventf_leftup, 0, 0, 0, 0
End Sub
Private Sub 설정_Click()
End Sub
Private Sub Timer3_Timer()
If GetAsyncKeyState(45) Then
If Timer4.Enabled Then
Timer4.Enabled = False
MsgBox 마우스가 현재 실행중 입니다., vbInformation, 알림
MsgBox 다시 실행해 주십시오, vbInformation, 알림
Else
Timer4.Interval = HScroll1.Value
Timer4.Enabled = True
End If
ElseIf GetAsyncKeyState(6) Then
If Timer4.Enabled Then
Timer4.Enabled = False
Else
MsgBox 현재 실행중이 아닙니다., vbInformation, 알림
End If
End If
End Sub
Private Sub Timer4_Timer()
mouse_event mouseeventf_rightdown, 0, 0, 0, 0
mouse_event mouseeventf_rightup, 0, 0, 0, 0
End Sub
```

댓글 1

  • 해님꽃 2025.03.24

    저도 찾던 내용인데요. 글 번호가 재미있네요 ㅎㅎ