APC Australia

Keyboard shenanigan­s

In this project we used the Keyboard Python library to emulate a keyboard using just the push buttons that controlled playing, pausing and stopping video playback.

-

The Keyboard library can be used to press any keys, so we can automate multiple key presses all from one push button. The library can also be used to write text to the screen.

But the most dangerous function of this library is that it can be used to record every key press on the target machine. These key presses can be recorded to a list, then saved to a file and then used for nefarious purposes. Of course, recording the key presses of a user, without their consent is illegal and can land you in a lot of trouble. So don’t do it! With that said, it can be used as a powerful tool when debugging how a user interacts with your code, so for software testing (under consent with the general public and in-house testers) you can see what keys they were pressing right before the code locked up and/or went thermonucl­ear!

The Keyboard library works with Linux and Windows and it’s certainly lots of fun to play with. To read a little more about this library head over to this blog post https://bigl.es/tuesday-tooling-record-replay-keystrokes-with-python and see a few examples of how it can be used in day-to-day life.

Newspapers in English

Newspapers from Australia