winemac: Don't return characters for Ctrl-(non-letter symbol) keypresses from ToUnicodeEx() as X11 driver already does (try 2)

Ken Thomases ken at codeweavers.com
Mon Sep 9 21:05:57 CDT 2013


Hi,

On Sep 9, 2013, at 7:38 PM, Phil Krylov wrote:

> Sorry, my first try had wrong patch attached
> 
> -- Ph.
> <0001-winemac-Don-t-return-characters-for-Ctrl-non-letter-try2.patch.txt>

Is there a specific problem that you're trying to fix?

The Mac driver's ToUnicodeEx() implementation started out very similar to the X11 driver's.  It was basically a copy that I hacked on.  It originally had this same restriction.  However, some testing revealed that this is not an absolute restriction on Windows.  For example, in the Khmer keyboard layout, Control-<digit> produces characters for some digits.  Given that some Windows keyboard layouts produce characters for Control-<digit>, I figured it was best left up to the Mac keyboard layout.

Similarly for Control-<punctuation>.  For example, the Windows Chinese keyboard layouts produce characters for some of those keystrokes.  So does the Czech layout.


It might still be possible to re-introduce this restriction if it can be justified based on broad breakage of apps.  Although even then, I'd want to make it possible to override the restriction with a registry setting or something.  You never know if the ability to enter characters using these key combinations might be crucial for certain Mac users because of the nature of their native keyboard layout.


If a modification like this were justified, it should go earlier in macdrv_ToUnicodeEx().  There's a section at the top where I moved the checks for combinations that don't produce characters.

Also, the check should test that Alt is _not_ pressed, since Control-Alt-<digit or punct> and Control-Alt-Shfit-<digit or punct> very commonly produce characters.  Control-Alt is a synonym for the AltGr key on some keyboards (e.g. Swiss).

Finally, if we're going to pursue this, there are some minor style issues I'd prefer be changed.  So, check with me before resubmitting.

Thanks and cheers,
Ken




More information about the wine-devel mailing list