Python Device Hacking (Keyboard)

After spending a bit of time hacking at the gamepad I decided to take a deeper look in to how /dev devices worked in Python, the easiest device I could get my hands on of course was a keyboard. First things first I needed to discover which device name represented my keyboard, to do this I used the virtual /proc filesystem at /proc/bus/input/devices : I: Bus=0011 Vendor=0001 Product=0001 Version=ab41 N: Name="AT Translated Set 2 keyboard" P: Phys=isa0060/serio0/input0 S: Sysfs=/devices/platform/i8042/serio0/input/input3 U: Uniq= H: Handlers=sysrq kbd event2 B: PROP=0 B: EV=120013 B: KEY=4 2000000 3803078 f800d001 feffffdf ffefffff ffffffff fffffffe B: MSC=10 B: LED=7 From the above output I can see my device is event2 within Handlers, which I know is the block device /dev/input/event2 .

Python Device Hacking (Gamepad)

So today I was reading an article on Hack A Day about a user who wrote a Python script to interrupt his USB Gamepad, I watched the video and realized I had a very similar gamepad laying around. One thing led to another and I found my self attempting the same sort of project. The Gamepad I am using is a Logitec Dual Action : Using some of the code posted on Hackaday I quickly realized my Gamepad returned quite different result and thus needed different code.