It is likely that dirt in your keyboard is causing this. Get some compressed air and blow the dirt, dust, and detritis out of the keyboard (also holding it upside down and shaking sometimes will dislodge stuff stuck inside). Then try again.

You have done keyboard hook with SetWindowsHookEx() API call, right?
When your keyboard delegate gets keycode for S-key, it replaces it with D-key's keycode (for some reason I do not understand), right?
You do know that Ctrl+S sends two separate keycodes, one for Ctrl-key and one for S-key, right?
Now if you press Ctrl+S, your keyboard delegate handles Ctrl-key and then replaces S-key's code with D-key's code, right?
Now if you press Ctrl+S in the Notepad it gets Ctrl+D and Ctrl+D does not save the document, right?

You solve this problem by not replacing S-key with D-key in your keyboard delegate. Right?