Python Forum
Thoughts on interfacing with a QR code reader that outputs keystrokes?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thoughts on interfacing with a QR code reader that outputs keystrokes?
#1
I have a hardware QR code reader that seems to act as a regular HID device (keyboard), and when it detects a QR code it outputs a long string. For example if I have a text editor open when I scan a QR code it will output to the text editor something like:

BCD0011SCTBPOTBEB1Red CrossBE72000000001616EUR1CHARUrgency fundSample EPC QR Code

I'd like to monitor it with Python from Windows to collect the data from the QR code. I'm wondering if anyone has any tips?

I was considering using the PyHook module and logging every keystroke and watching for the termination character ("\n"). But maybe there's some other clever way that I haven't considered yet?

Thanks for any tips.
Reply
#2
Can you just have the program loop over input() to read each line as it is "typed"?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Media Pipe Python Interfacing with MATLAB cmcreecc 1 145 May-30-2024, 07:23 AM
Last Post: TrentErnser
  format json outputs ! evilcode1 3 1,826 Oct-29-2023, 01:30 PM
Last Post: omemoe277
  Formatting outputs created with .join command klairel 2 710 Aug-23-2023, 08:52 AM
Last Post: perfringo
  Interfacing from Python to GUI HMartins 7 1,748 Apr-23-2023, 06:06 PM
Last Post: HMartins
  xml simple reader kucingkembar 2 1,126 Aug-19-2022, 08:51 PM
Last Post: kucingkembar
  I have written a program that outputs data based on GPS signal kalle 1 1,263 Jul-22-2022, 12:10 AM
Last Post: mcmxl22
  Having strange results from an RFID HID card reader - I'm stuck orbisnz 1 1,570 Mar-28-2022, 08:20 AM
Last Post: Larz60+
  Why does absence of print command outputs quotes in function? Mark17 2 1,468 Jan-04-2022, 07:08 PM
Last Post: ndc85430
  Newbie have thoughts about logic sdd 32 9,506 Sep-17-2021, 10:13 AM
Last Post: Serafim
  NFC reader code help johnroberts2k 1 2,691 Jul-02-2021, 08:43 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020