Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Keycodes for non-latin keyboards.
Forum Updated to NodeBB v4.3 + New Features

Keycodes for non-latin keyboards.

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    ImperialPenguin
    wrote on last edited by
    #1

    I'd like my software to be able to detect key presses from non-latin keyboards, for example Cyrillic. Not only are there not any key codes mentioned for any alphabet other than latin in the documentation, but when I switch my Mac's keyboard to Russian and type, no keyEvents are received at all. I tried it with Arabic and it doesn't work either. The letters appear on screen just fine, and the rest of the software has no problem interacting with them, but no key codes are given. Is there something that I need to do to tell Qt to query the current format, or is there no way to catch these events?

    1 Reply Last reply
    0
    • _ Offline
      _ Offline
      _compiler
      wrote on last edited by
      #2

      http://doc.qt.digia.com/qt/internationalization.html

      1 Reply Last reply
      0
      • I Offline
        I Offline
        ImperialPenguin
        wrote on last edited by
        #3

        I've read that. And it talks a bit about how to handle the text, or keyboard modifiers, but those aren't the problems I'm having. The problem is that I receive no keyevents at all. For example, the following code will print "Here" if my keyboard is set to latin and I type a letter, but will print nothing if it is set to Russian and I type a letter.

        @bool MyTextEdit::eventFilter(QObject *object, QEvent *event)
        {
        if (event->type() == QEvent::KeyPress) {
        qDebug("Here");
        }
        }
        @

        As far as inputting, and working with the text, everything is fine. My spellchecking code works on Russian, the characters appear, I haven't tried saving a file yet, but I expect no difficulties in that either. But the keyboard is not sending any keyEvents. Is there something in that document that I missed which explains why? I've read it a couple of times now and still haven't seen a cause. From what I've read in the QKeyEvent documentation, I should at least be getting a keycode of 0.

        Furthermore, if I use keyPressEvent instead, like so:

        @void MyTextEdit::keyPressEvent ( QKeyEvent * event ) {
        qDebug("here");
        }
        @

        When I type in English, "here" is printed, and no text appears on the screen because this function does nothing. If I type in Russian, the text appears on the screen and "here" is never printed.

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tobias.hunger
          wrote on last edited by
          #4

          Which Qt version are you using?

          Did you consider to "file a bug report":https://bugreports.qt-project.org/ ?

          1 Reply Last reply
          0
          • I Offline
            I Offline
            ImperialPenguin
            wrote on last edited by
            #5

            I'm using 4.8.2 on a Mac.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved