I have done extensive testing and have figured out both the actual bug and its fix.
Firstly, the sequence "`, Tab, e"
should not produce è. If I am not running any scripts, in Notepad it produces
` e, at least on Windows 10. (Interestingly, in SciTE and Notepad++, the tab and backquote are swapped around - I presume this is a bug in the Scintilla control.)
If I am running
only the test script, in Notepad I get
` è.
If I am running another script with hotstrings or I add a hotstring to the test script, in Notepad I get tab followed by è.
There are actually two bugs.
The first bug is that Tab and Escape aren't considered to complete the dead key sequence, even though they do. So after Tab is pressed, the keyboard hook considers there to still be a pending dead key. After Input processes 'e', it reinserts the pending dead key to "avoid side-effects" (this is normally necessary because converting a keycode to a character has the side-effect of removing the dead key from the system's buffer).
Code: Select all
bool dead_key_sequence_complete = sPendingDeadKeyVK && aVK != VK_TAB && aVK != VK_ESCAPE;
Chris' comments explain:
Code: Select all
// I've only discovered two keys which need special handling, and they are handled below:
// VK_TAB & VK_ESCAPE
// These keys have an ascii translation but should not trigger/complete a pending dead key,
// at least not on the Spanish and Danish layouts, which are the two I've tested so far.
I tested on Spanish and Danish on Windows 10, and on Spanish on XP. Tab and Escape both served to complete the dead key sequence, contrary to the comments above.
The second bug is that if a key is used as an Input end key and the script does not also contain active hotstrings, the end key is not considered to have completed the dead key sequence. For example, with
Input, InputChar, L1 B V I, a if you type
`aae, you may get
àaè, while Input shows 'e'.