My o key fell off on my laptop; so I wrote a program that replaces two 0 keystrokes within 200 MS of each other as an o, two 0 keystrokes within 700 MS of each other as a 0 and ignore the rest; so I could use my laptop before I get around to replacing the keyboard.
Wow; I didn't know this would be so popular :p
As for how - Microsoft exposes a nice little API feature called Hooks.
Using that hook; I was able to write a "filter" that did what I needed it to do (hint: if you return 1 with your callback windows will not process the keystroke).
The reason I know about this actually is not because I was writing a keylogger - but because I wrote a program smiler to Synergy a while ago.
And yes. I did write another program that swapped alpha-numeric keys with a random alpha-numeric key and yes; it was really funny :D
scripting - What is the most useful script you've written for everyday life? - Stack Overflow
What Python program have you created to make your life easier?
Created a script to solve oblique triangles using either Law of Sines or Law of Cosines (I teach HS math), and I hate doing the calculations for the answer key.
I show it to my students to influence them to take up programming, at least to help them make their life easier.
More on reddit.comWhat are some of the best things you have automated using Python?
Easy Python scripts to impress the business
Videos
My o key fell off on my laptop; so I wrote a program that replaces two 0 keystrokes within 200 MS of each other as an o, two 0 keystrokes within 700 MS of each other as a 0 and ignore the rest; so I could use my laptop before I get around to replacing the keyboard.
Wow; I didn't know this would be so popular :p
As for how - Microsoft exposes a nice little API feature called Hooks.
Using that hook; I was able to write a "filter" that did what I needed it to do (hint: if you return 1 with your callback windows will not process the keystroke).
The reason I know about this actually is not because I was writing a keylogger - but because I wrote a program smiler to Synergy a while ago.
And yes. I did write another program that swapped alpha-numeric keys with a random alpha-numeric key and yes; it was really funny :D
I don't have the code any more, but possibly the most useful script I wrote was, believe it or not, in VBA. I had an annoying colleague who had such a short fuse that I referred to him as Cherry Bomb. He would often get mad when customers would call and then stand up and start ranting at me over the cubicle wall, killing my productivity and morale.
I always had Microsoft Excel open. When he would do this, I would alt-tab to Excel and there, on the toolbar, was a new icon with an image of a cherry bomb. I would discreetly click that ... and nothing would happen.
However, shortly after that I would get a phone call and would say something like "yeah, yeah, that sounds bad. I had better take a look." And then I would get up, apologize to the Cherry Bomb and walk away.
What happened is that we used NetWare and it had a primitive messaging system built in. When I clicked the button, a small VBA script would send out a NetWare message to my friends, telling them that the Cherry Bomb was at it again and would they please call me. He never figured it out :)