Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clear Keyboard Buffer

Status
Not open for further replies.

OzDing

Programmer
May 1, 2001
7
AU
Hi,

I need to clear the keyboard buffer in VB. Here's what Im doing:

1. A magnetic stripe reader is passing a stream of characters to a textbox via the keyboard, with carraige returns as the end of track markers.
2. I look for the end of track marker and process.

I never know what number of tracks are coming in, and I only need to process the first 2, and so want to clear the incoming keyboard buffer once I have processed what I need. This may be the first part of the stream or all of it. The problem is there is no end of stream marker I can use, so I never know when the entire stream has been received by the textbox so I can begin processing. Therefore I process the first 2 tracks and any remaining characters are held in the keyboard buffer until the form receives focus again. I want to delete these from the keyboard buffer before the form gets focus and receives these unwanted characters!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top