Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Windows.bi"
- #define MAPVK_VK_TO_VSC 0
- Declare Sub ShiftDown
- Declare Sub ShiftUp
- Dim shared KeyOut as INPUT_
- Dim as String sSourcefile = Command '"C:\DOSFiles\BC7\BIN\FLAPPY\ASM\BuffPrint.ASM"
- Dim as String sSrcBuff = ""
- Dim as Integer iFileSz = 0
- If Open (sSourceFile for binary access read as #1) Then
- Print "Error opening source file!"
- Sleep: System
- End If
- iFileSz = LOF(1)
- sSrcBuff = Space(iFileSz)
- Get #1,, sSrcBuff
- close #1
- Open Command for Input as #1
- KeyOut.type = INPUT_KEYBOARD
- Do
- Sleep 1,1
- Loop Until (GetAsyncKeyState(VK_ESCAPE) AND &H8000)
- For X as Integer = 0 to iFileSz-1
- Select Case sSrcBuff[X]
- Case asc("A") to asc("Z") 'put down shift key
- ShiftDown
- Case 10
- Continue For
- Case asc("!"), asc("@"), asc("#"), asc("$"), asc("%"), asc("^"), asc("&"), asc("*"), asc("("), asc(")"), asc("_"), asc("+"), asc("|"), asc("}"), asc("{"), asc("~"), asc("<"), asc(">"), asc("?"), asc(":"), asc("""")
- ShiftDown
- end select
- var key = VkKeyScanEx(sSrcBuff[X], 0)
- KeyOut.ki.wScan = MapVirtualKey(key, MAPVK_VK_TO_VSC)
- KeyOut.ki.wVk = key
- KeyOut.ki.dwFlags = 0
- SendInput(1, @KeyOut, SizeOf(KeyOut))
- Sleep 10,1
- KeyOut.ki.dwFlags = KEYEVENTF_KEYUP
- SendInput(1, @KeyOut, SizeOf(KeyOut))
- ShiftUp
- 'Sleep 100,1
- Next X
- Sub ShiftDown
- KeyOut.type = INPUT_KEYBOARD
- KeyOut.ki.wScan = MapVirtualKey(VK_SHIFT, MAPVK_VK_TO_VSC)
- KeyOut.ki.wVk = VK_SHIFT
- KeyOut.ki.dwFlags = 0
- SendInput(1, @KeyOut, SizeOf(KeyOut))
- End Sub
- Sub ShiftUp
- KeyOut.ki.wScan = MapVirtualKey(VK_SHIFT, MAPVK_VK_TO_VSC)
- KeyOut.ki.wVk = VK_SHIFT
- KeyOut.ki.dwFlags = KEYEVENTF_KEYUP
- SendInput(1, @KeyOut, SizeOf(KeyOut))
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement