misinterpretation in KeyPress::createFromDescription


#1

“ö” which is in textual description “#f6” is interpreted as function-key F6
It should be first checked if its a hex code, or just use do a whole string comparsion and not containsWholeWordIgnoreCase

[code] // see if it’s a function key…
for (int i = 1; i <= 12; ++i)
if (desc.containsWholeWordIgnoreCase (“f” + String (i))) //!!! “#f6” will interpreted as f6
key = F1Key + i - 1;

        if (key == 0)
        {
            // give up and use the hex code..
            const int hexCode = desc.fromFirstOccurrenceOf ("#", false, false)
                                    .toLowerCase()
                                    .retainCharacters ("0123456789abcdef")
                                    .getHexValue32();

[/code]


#2

ah! Yes, thanks for spotting that!


#3

i’m a little bit confused, whats the easiest way transforming a “#f6” into a UTF8 “ö” ?
Any help is appreciated?

this does not work:

[code]int hexCode =k.fromFirstOccurrenceOf ("#", false, false)
.toLowerCase()
.retainCharacters (“0123456789abcdef”)
.getHexValue32();

			k=String::createStringFromData(&hexCode,sizeof(int));[/code]

#4

Just use String::charToString()


#5

Thanks!