PDA

View Full Version : KeyEvents with non-latin keyboards



ImperialPenguin
28th November 2012, 02:48
I'm capturing keyEvents to play a sound when a key is pressed. This works fine on latin keyboards, but if I use a Russian keyboard layout, none of the Cyrillic characters generate a keyEvent. For example the code below will print "here" if I type any key with my keyboard layout set to U.S., but if I set it to Russian, Arabic, or presumably any non-latin keyboard layout I get nothing. What do I have to do to capture non-latin keyboard events?


bool NCTextEdit::eventFilter(QObject *object, QEvent *event)
{
if (event->type() == QEvent::KeyPress) {
QTextCursor cursor;
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
qDebug("here");
}
}