On Tue, Oct 9, 2018 at 2:54 PM Huw Davies huw@codeweavers.com wrote:
On Fri, Sep 28, 2018 at 03:11:37PM +0300, Gabriel Ivăncescu wrote:
On Fri, Sep 28, 2018 at 3:00 PM Nikolay Sivov nsivov@codeweavers.com wrote:
On 09/28/2018 02:44 PM, Gabriel Ivăncescu wrote:
case WM_CHAR: case WM_UNICHAR:
if (wParam == This->no_fwd_char) return 0;
This->no_fwd_char = '\0';
I don't know how important it is in practice, but shouldn't it go through MapVirtualKey, storing VK_ code instead of a char?
Isn't that the opposite effect of what's needed here? Or are you saying I should use it when setting no_fwd_char itself? In that case, I don't think it will work for the return key, since it's different depending on whether CTRL is pressed or not (like in quickComplete).
I'm wondering whether a simple flag 'ignore_next_char' would be cleaner.
Huw.
I don't think that's necessarily correct in all situations, depending on the application, since there's no guarantee it will call TranslateMessage all the time. And also, WM_CHAR can be sent artificially without any WM_KEYDOWN, for example with AutoHotkey it's quite common. In this case it will end up ignoring an unrelated character if we use the flag method.