[Qt-interest] Meaning of Qt::Key_<>, etc for non-latin keyboards ?

Constantin Makshin cmakshin at gmail.com
Thu Jun 24 19:45:05 CEST 2010


When a non-latin keyboard layout is used, QKeyEvent::key() returns code of the upper-case version of the character, i.e. QChar(keyEvent->key()) is the upper-case character the user has pressed. For example, if I press 'Ф' (Cyrillic letter usually placed on the same key as latin 'A'), QKeyEvent::key() returns 1060 (0x424) — code of the 'Ф' letter in Unicode character set.

At least it works this way on my Debian system. :)
I guess on other systems this function has the same behavior, at least because there are too many layouts to make it possible to implement simple and platform-independent "non-latin <--> latin" key code conversion/mapping.

On Wednesday 23 June 2010 20:04:44 Stephen Collyer wrote:
> If one is working with, say, a Russian, Greek, Arabic, etc physical
> keyboard, under what circumstances are the Qt_Key_<whatever>
> key codes returned in a QKeyEvent ?
> 
> Are the non-latin keys mapped onto these in some well defined way ?
> If not, what does one get in QKeyEvent::key() in the case of non-latin
> keyboards ?



More information about the Qt-interest-old mailing list