I’m creating a small accessibility feature (C#) that has to help users to insert bits of text anywhere within Windows. Something similar to the AutoText feature in Word or Intellisense in Visual Studio. So, whether typing an email in Outlook, a note in OneNote or a comment on Facebook (with whatever browser).
When the user types the first 3 letters of a known word or sentence, i want to present some kind of popup that they can use to complete the word/sentence.
I’m already detecting what the users are typing and that input is also being matched with the list of words in the autocomplete list.
But now i need to know, how to insert the text that is found at the position of the cursor? (while the user is in whatever program..)
And something that would be really nice to have is that if this new piece of text could replace what has already been typed. That way i could have the users type “nhw” and it would be replaced by “need help with “.
Many thanks for you help,
Tys
You probably want to use
SendKeys(). See How to: Simulate Mouse and Keyboard Events in Code.To replace “nhw” with “need help with ” you’ll want to send
+({LEFT 3})need help withto select “nhw” (Shift+Left/Left/Left) before typing “need help with “.