0

I'm using Python to create a simple program to trick my brother.

The idea of my program is to read any key input that he writes and output another one. For example, I press 's' letter and it outputs 'o'.

I do have the character converter working, however I now need to catch the key pressed and instantaneously return the new key to the screen.

How can I achieve this? Thank you very much for your time

user3050910
  • 3,107
  • 3
  • 13
  • 11
  • possible duplicate of [Python read a single character from the user](http://stackoverflow.com/questions/510357/python-read-a-single-character-from-the-user) – Emilia Bopp Mar 28 '14 at 14:08

1 Answers1

1

Python probably isn't the best language for this. In fact I'm pretty sure it's not possible under most circumstances. You'd need the script running all the time, I assume, which is a problem in and of itself. But a further problem is that AFAIK python can't arbitrarily modify keyboard input across the whole computer.

So you'll probably need something that can work on a lower level, such as C or C++.

ubadub
  • 3,571
  • 21
  • 32