View Single Post
Venemo's Avatar
Posts: 1,296 | Thanked: 1,773 times | Joined on Aug 2009 @ Budapest, Hungary
#67
Accented characters with multiple dead keys

For versions >= 1.0.7.x

In 1.0.7.x, they have fixed the AccentedCharacterKey so that it now produces a more logical, better behaviour.
You should just add each symbol after the accent. For example:

Code:
AccentedCharacterKey {
    caption: "o";
    captionShifted: "O";
    symView: "9";
    symView2: "[";
// This is the relevant part
    deadKeyAccents: "´ó¨ö˝ő"
    deadKeyAccentsShifted: "´Ó¨Ö˝Ő"
}
For versions <= 1.0.6.x

Originally Posted by Kaacz View Post
I found bug in 'AccentedCharacterKey.qml'. Or I don't know how is right way to define deadKeysAccents for more then one deadkey.
You don't have to patch the AccentedCharacterKey.qml file. Just see how it works. The key is this line:

Code:
_deadKeyAccents.substr(_deadAccentIndex*2+1, 1)
So it searches for the accent in the deadKeyAccents property, multiplies it by two and adds one. The accented letter should be at this position in the text.

Here's an example on how to make an accented key with the ability to use multiple dead keys:

Code:
AccentedCharacterKey {
    caption: "o";
    captionShifted: "O";
    symView: "9";
    symView2: "[";
    accents: "oöôòóő";
    accentsShifted: "OÖÔÒÓŐ";
// This is the relevant part
           deadKeyAccents: "´ó˝¨ ő ö";
    deadKeyAccentsShifted: "´Ó˝¨ Ő Ö"
//                 position 01234567 
}
In this example, we produce Ó, Ö, Ő from O. The first accent is ´ located at position 0 so Ó is located at position 0*2+1=1. Second accent is ˝ located at position 2 so Ő should be at location 2*2+1=5. Lastly ¨ is located at position [b]3[b] so Ö is at position 3*2+1=7.

It doesn't matter what the rest of the string is, I just filled the empty places with spaces.

If you start with a space, it might be simpler for just two deadkeys:

Code:
    deadKeyAccentsShifted: " ´¨Á Ä"
//                 position 012345
Hope this helps!

Last edited by Venemo; 2014-06-19 at 06:20.
 

The Following 7 Users Say Thank You to Venemo For This Useful Post: