Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6080419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:03:33+00:00 2026-05-23T11:03:33+00:00

I am writing an app that reads the input from a barcode scanner, the

  • 0

I am writing an app that reads the input from a barcode scanner, the way I want it to work like is: it works as a keylogger and when the input is fast enough I know I’m getting input from the barcode scanner.

Now my problem is I don’t know when I get the last character from the barcode scanner so I know I have a final and valid barcode.

My method only gets called when a character is received, so this is when I have to check if my character is the final one received.

The way I wanted to do this is, I create a new thread at the end of my method that sleeps for MAXIMUM_TIME_BETWEEN_CHARACTERS_FROM_BARCODE_SCANNER + 1 milliseoconds, after it wakes up it verifies if I received any new characters, if I did it the thread dies, if no new characters are received it means the full barcode is received and I can use it.

But by doing this I started getting all sorts of weird bugs, like execution dying prematurely.

Can anyone suggest a different solution?

I am writing this in C# if it’s relevant.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:03:34+00:00Added an answer on May 23, 2026 at 11:03 am

    I restructured this solution:

    The way I wanted to do this is, I create a new thread at the end of my method that sleeps for MAXIMUM_TIME_BETWEEN_CHARACTERS_FROM_BARCODE_SCANNER + 1 milliseoconds, after it wakes up it verifies if I received any new characters, if I did it the thread dies, if no new characters are received it means the full barcode is received and I can use it.

    and it eventually worked. I still do not know what caused my previous errors but after restructuring the code I have had no problems with this approach at all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an Android app that reads and parses NMEA sentences from GPS receiver
I'm writing a small app that reads some input and do something based on
I'm writing an app that supposed to copy a bunch of files from one
I'm writing an app that will basically be like Fraps, but it will push
I'm writing an app that allows you to script the buttons from a wiimote
I am writing an app that reads out strings one after the other. My
I'm writing a web-app for the iPad that will be loading data from a
I am currently writing up an app that reads in a file and puts
I am writing a screen scraping app that reads out various pages and extracts
I'm writing an app that can be sent a photo URI from the Share

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.