![]() * Barcode never fired keydown event more than 1 time before the same key fired keyup event * and keydown event is not fired again before the keyup event fired for the same key * check if keydown and keyup is not different If (UseKeyboard & e.KeyData != Keys.Enter) ![]() Private void BarcodeReader_KeyUp(object sender, KeyEventArgs e) This.KeyUp += new KeyEventHandler(BarcodeReader_KeyUp) This.KeyDown += new KeyEventHandler(BarcodeReader_KeyDown) Private void BarcodeReader_Load(object sender, EventArgs e) Please have a look below: public partial class BarcodeReader : Form So by this way you can detect whether input made by regular keyboard or barcode scanner. For example it will take more than specified time for someone to Press and Release same key, however he can hit punch to keyboard that will push multiple keys all together and trigger their KeyDown and KeyUp events, but all no keys will have KeyUp and KeyDown events fired synchronously. No one can trigger KeyDown and KeyUp event of same key within 17 milliseconds. ![]() If KeyUp and KeyDown events are fired of same keys and within specified time (say 17milliseconds), as this can be only done using Barcode scanner. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |