Only ONE WCHAR per dead key

Sorting it all Out
Michael Kaplan's random stuff of dubious value
Be sure to read the disclaimer here first!

Only ONE WCHAR per dead key

  • Comments 6

Regular reader Ivan Petrov asked the following in the Suggestion Box:

Hi Michael

I've the following problem:

In MSKLC in the 'Control state' of the keyboard (when the Control key is pressed) I'm trying to make VK_OEM_3 a Dead Key. So, I assign to it  'U+0060 (') GRAVE ACCENT' and then I set it as Dead key. To this point everythig goes ok! Then I go into the Dead key dialog box. And here is the BIG problem. What I mean:
I want to do the following:
When I press "Ctrl" + "`"  followed by one of this vowels in the Bulgarian alphabet:
"а", "е", "и", "о", "у", "ъ", "ю" and "я",
the keyboard layout to produce one of this results:

а̀  (0430 + 0300)
ѐ  0450 or (0435 + 0300)
ѝ  045d or (0438 + 0300)
о̀  (043e + 0300)
у̀  (0443 + 0300)
ъ̀  (044a + 0300)
ю̀  (044e + 0300)
я̀   (044f  + 0300)

And finally the problem:

Let's take for example the first vowel "а":
In the Ded Key dialog box in the Base (code point) field I type "а". Then in the Composite (code point) field I type "U+0430 U+0300" and then MSKLC says that "The value must be either a single character or code point." So, this is the problem!

Can you help, how to deal with this.

I've no problem with the two precomposed letters "ѐ" and "ѝ", but the rest ... ;-(

Thank you in advance.
Regards,
Ivan Petrov.

Hmmm.... maybe Ivan was not reading often enough. :-(

The problem that he is reporting on has no solution. As I pointed out back in December of 2004 when I mentioned that Dead keys are not intuitive, and then a few times since then -- the end result of a dead key transaction must be s single UTF-16 code unit.

This is also explained in the MSKLC help file, as is the explanation that the dead key architecture is one that is around for legacy purposes only, and not generally for the creation of new keyboards.

Even if this ever were changed in a future release of Windows, it could not be used on existing versions due to the backcompat break that this would cause -- and the future version of MSKLC would have to support different keyboard layout DLLs for different versions of Windows. Which as I am sure people can imagine is not a terribly popular plan....

For solutions, there are two obvious ones:

  • You can add each sequence to its own key on the keyboard, or
  • You can add the combining character and then type letter plus combining character on the keyboard

Either of these plans will allow the characters to be supported....

 

This post brought to you by "у" (U+0443, a.k.a. CYRILLIC SMALL LETTER U)

Comment on the blather
Leave a Comment
  • Please add 3 and 7 and type the answer here:
  • Post
Blog - Comment List
  • Thank you Michael for the quick response! :-)

    Please, correct 'comining' to 'combining' in the second solution ;-)

    Best regards,
    Ivan.
  • Hi Michael.

    How do you think, is the above question a good reason to be proposed for encoding in Unicode in the Precomposed form the following grave stressed vowels in the Bulgarian language?:

    а, о, у, ъ, ю, я
    А, О, У, Ъ, Ю, Я


    As you know from my previous posts, they're needed for the Bulgarian written language, see:

    1.(see the comments)
    How does Microsoft assign new collation weights?
    http://blogs.msdn.com/michkap/archive/2005/09/12/463483.aspx

    2.(see the whole post)
    Can I get my characters into Unicode?
    http://blogs.msdn.com/michkap/archive/2005/02/06/367985.aspx

    Regards,
    Ivan.
  • Given the fact that dead keys are a legacy technology, I think it would be a uphill battle....
  • Ok, thanks again Michael.

    One more question:

    In the second sollution:

       * You can add the combining character and then type letter plus combining character on the keyboard,

    I see something wich bothers me! What I mean? I mean that after the user is typing a letter, than he can stroke as many times as he wish the key on wich is assigned the combining character (in our case the grave accent). Visually we will have a letter and grave accent, but in practice there will be a letter plus many grave accents! And also one more fact: as we've a key on which is assigned a combining character (in our case the grave accent), then the user can type every letter wich supports the keyboard layot plus the combining character! This is undesired in our case, because we want to type only the grave accented Bulgaraian vowels.

    So can you suggest how to deal with this issue if I choose to use the second sollution you've proposed?

    Thank you in advance.
    Best regards,
    Ivan.
  • Well, I have talked about stacked diacritics in the past.

    But I do not believe it is common that people will type a letter, a diacritic, and then keep typing diacritics -- once they get what they want they move on to the next character.

    People are much more likely to hit a dead key, see nothing, and so type the dead key again -- which will cause them to see the wrong thing. I have seen people do it, and think it would be a much more common problem from a usability standpoint.
  • Rimas Kudelis asked over in the Suggestion Box: Hi Michael, I was wondering if you know if there are

Page 1 of 1 (6 items)