Below is the section I'm having trouble with at the moment:
Expand|Select|Wrap|Line Numbers
- Friend Sub glbHooks_KeyPress(ByVal sender As Object, ByVal e As KeyPressEventArgs) Handles glbHooks.KeyPress
- newStr = newStr & LCase(e.KeyChar)
- n = 0
- If e.KeyChar = vbBack Then
- tmpStr = ""
- For i = 1 To newStr.Length
- If i < newStr.Length - 1 Then tmpStr = tmpStr & newStr.Substring(i - 1, 1)
- Next
- newStr = tmpStr
- End If
- If newStr.Length = 4 Then
- If newStr(3) = "-" Then
- If InStr(rkSet, newStr) Then
- n = 1
- My.Computer.Keyboard.SendKeys(Chr(8) & Chr(8) & Chr(8) & dicRepStr(newStr))
- newStr = ""
- End If
- End If
- tmpStr = ""
- For i = 1 To newStr.Length
- If i <> 1 Then tmpStr = tmpStr & newStr.Substring(i - 1, 1)
- Next
- newStr = tmpStr
- End If
- If n = 1 Then
- Sleep(100)
- My.Computer.Keyboard.SendKeys(Chr(8) & " ")
- End If
- End Sub
I added the last "If" statement to try and remove it then add a space but it does no good. It just puts the dash AFTER the space.
Also, if I put "If n = 1 Then My.Computer.Keyboard.SendKeys(Chr(8))" at the beginning of this Sub then it will remove the dash after typing the next character. BTW the "Chr(8)" I tried when the "vbBack" wasn't taking out the dash, that's the only reason it's there now. Also, I originally had 4 "vbBack" {Chr(8)} in the replacing portion but have changed it around to try to get rid of that final character.
How do I get it so it won't send the dash {or whatever is chosen as the trigger symbol}?
Also, if I put a msgbox in that section then it doesn't put in the trigger character.
--> MsgBox("")
So is there a way to spoof a message box or something similar? I don't want to have to click "Okay" on the message box every time I use the hotkeys. I've tried sleep {for 100 & 500} but it didn't work.
Any help in this would be appreciated!
Peace to you and yours,
Matthew "Dra'Gon" Stohler