Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Capture Keycode combination  RSS feed

 
Mark Reyes
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Good Day..
I have this scenario. I am receiving a keypress event from a barcode scanner. It is configured to send a carriage return + line feed
after scanning the barcode.
My problem is, how can I catch the combination of two key codes. (Carriage Return + Line Feed)
Can you send me link or resource where I could read or any advise.

Thanks
 
Moojid Hamid
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mark reyes wrote:how can I catch the combination of two key codes. (Carriage Return + Line Feed)


Aren't those two different keypress events instead of a combination (e.g. Shift + 'a') keypress event? When you read a Line Feed you can check to see if the previous one was Carriage Return and take an appropriate action. Lot of those scanners are also configurable and allow you to choose what end of line character you want them to send if any.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!