I am writing a simple C# program in which when I press "ctrl+g" I want my program to automatically delete the character directly left of the cursor in any program (ex: chrome browser, word document, powerpoint document, etc...).
I have installed a global hook for "ctrl+g" and it works fine. I am using a keyboard simulator that I found from codeproject: http://www.codeproject.com/Articles/28064/Global-Mouse-and-Keyboard-Library
My issue is that when I simulate a backspace like so:
the entire word is deleted instead of just the character to the left of the cursor. For example, if I am in a Microsoft Word document with the following line of text:
"Happy new year"
if my cursor is at the end of "year" and I press ctrl+g, my program deletes "year" and puts the cursor just to the right of "new" instead of just deleting the letter "r" of "year".
I have tried other simulators as well with the same result. Does anyone have a solution or know what I am doing incorrectly?
Apparently, Ctrl+Backspace commonly means delete the entire word in Windows. When you press Ctrl+g, and your hook simulates the back space key, the program sees Ctrl+Backspace because the Ctrl is down.