|
-
Dec 19th, 2000, 08:23 AM
#1
Thread Starter
Junior Member
Hello,
I'm doing a little project in which I have to monitor behaviour of users, when they are browsing through a nuber of (offline) webpages. I thought I could use the MS webbrowser control, for its ease of use. But it seems that this control is not able to catch mouseclicks or keypresses.
Has anyone a solution on how to monitor this?
Thanks,
Leon
-
Dec 19th, 2000, 11:49 AM
#2
Use the GetAsyncKeyState API function.
Code:
Declare Function GetAsyncKeyState Lib "user32.dll" _
(ByVal vKey As Long) As Integer
Private Sub Timer1_Timer()
'Keypresses:
If GetAsyncKeyState(vbKeyA) Then Msgbox "A"
If GetAsyncKeyState(vbKeyB) Then Msgbox "B"
If GetAsyncKeyState(vbKeyC) Then Msgbox "C"
'.....
'Or catch any:
'Dim iKey As Integer
'For iKey = 3 to 255
'Print iKey
'Next iKey
'And for the mouse clicks:
If GetAsyncKeyState(vbLeftButton) Then Msgbox "Left"
If GetAsyncKeyState(vbMiddleButton) Then Msgbox "Middle"
If GetAsyncKeyState(vbRightButton) Then Msgbox "Right"
End Sub
-
Dec 19th, 2000, 04:36 PM
#3
Thread Starter
Junior Member
Thanks,
Altough it shall not win a price for beauty (I dislike the use of timers). But apart from that it looks easy and straightforward.
Leon
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|