Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- #Created By Kris Occhipinti
- #July 21st 2018
- #License GPLv3
- #https://www.gnu.org/licenses/gpl-3.0.txt
- #takes raw HID input and outputs chars
- #example with USB RFID reader by Sycreader
- import string
- from evdev import InputDevice
- from select import select
- keys = " ^1234567890....qwertzuiop....asdfghjkl....yxcvbnm......................."
- dev = InputDevice('/dev/input/by-id/usb-Sycreader_RFID_Technology_Co.__Ltd_SYC_ID_IC_USB_Reader_08FF20140315-event-kbd')
- code = ""
- while True:
- r,w,x = select([dev], [], [])
- for event in dev.read():
- if event.type==1 and event.value==1:
- if event.code == 28:
- print code
- code = ""
- else:
- code += keys[ event.code ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement