Jul 18, 2002 #1 SykoStokkrTim Programmer Joined Jul 19, 2002 Messages 20 Location US I'm working on a keylogger, and I figured VB6 would do the job. Is there any way to get the last key pressed into a variable?
I'm working on a keylogger, and I figured VB6 would do the job. Is there any way to get the last key pressed into a variable?
Jul 18, 2002 #2 lovell811 Programmer Joined Jun 4, 2002 Messages 169 Location US yeah if you don't want a textbox just use the forms keydown or keypress event and you can capture the keys they press ---------------- Joe Upvote 0 Downvote
yeah if you don't want a textbox just use the forms keydown or keypress event and you can capture the keys they press ---------------- Joe
Jul 18, 2002 Thread starter #3 SykoStokkrTim Programmer Joined Jul 19, 2002 Messages 20 Location US I know that, but what is the variable from the keypress event? Upvote 0 Downvote
Jul 18, 2002 #4 vb5prgrmr Programmer Joined Jul 5, 2002 Messages 3,624 Location US Option Explicit dim Char as string Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Char=chr(KeyCode) End Sub Private Sub Form_KeyPress(KeyAscii As Integer) Char=chr(KeyAscii) End Sub Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) Char=chr(KeyCode) End Sub Upvote 0 Downvote
Option Explicit dim Char as string Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Char=chr(KeyCode) End Sub Private Sub Form_KeyPress(KeyAscii As Integer) Char=chr(KeyAscii) End Sub Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) Char=chr(KeyCode) End Sub
Jul 18, 2002 #5 JohnYingling Programmer Joined Mar 24, 2001 Messages 3,742 Location US Don't forget that KeyPreview in the form must be True. http://www.VBResizer.com Generate Forms/Controls Resizing/Tabbing Class http://www.VBCompare.com Compare Code (Text) http://www.VBSortGen.com Generate Sort Class in VB or VBScript Upvote 0 Downvote
Don't forget that KeyPreview in the form must be True. http://www.VBResizer.com Generate Forms/Controls Resizing/Tabbing Class http://www.VBCompare.com Compare Code (Text) http://www.VBSortGen.com Generate Sort Class in VB or VBScript