How can I intercept and correct low-level keystrokes?

I keep typing "t eh" instead of "the", which of course annoys the amount of time it takes me to fix it.

The obvious answer is: "Learn to type, noob!" or at least enter more slowly and / or more correctly. This error is frighteningly consistent, so it looks like I already trained my muscle memory for this model.

But I am wondering if it is possible to write a small portable Windows-media script or an application that detects an incorrect sequence, reverse and corrects it automatically at the level where it will be applied to any keyboard input.

  • Does C # have access to this OS layer that intercepts keystrokes in the system?
  • Will I be facing UAC issues with Vista?
  • I'm reinventing the wheel (i.e. are there any open source tools that I can change or use out of the box)?

In DOS, this kind of thing was pretty easy, and you could make TSR (Terminate and Stay Resident) programs that, for example, would give you a calculator on the screen with a special key press. Not to mention many, many practical jokes based on this concept (type “M” for the monster!) ...

Of course, I would never have imagined that such a utility could be used this way for employees ...

-Adam

+3
source share
4 answers

AutoHotKey. , : http://www.autohotkey.com/docs/Tutorial.htm

, , "hotstrings". http://www.autohotkey.com/docs/Hotstrings.htm

script :

::teh::the

! , . AutoHotkey , AutoHotKey .

. ( ) ! , , , , !

EDIT: , "t eh" ( ), , - . , . autohotkey .AHK.

::t eh::the

. AHK, AutoHotKey script ( , , ). !

+2
+4

, pinvoke # os. http://www.pinvoke.net. , .

0

I suggest learning to type more slowly. I also suffer from "teh" and "ahwa" partly due to auto-correction, giving me leniency. If you forced yourself to relearn, then you would not be at a disadvantage when using any other machine.

Not to mention an unsuccessful event when you need to write “t eh” and is prevented by an overly zealous “corrector”.

0
source

Source: https://habr.com/ru/post/1703769/


All Articles