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. QKeyEvent::text() doesn't return accent letter on Linux
Forum Updated to NodeBB v4.3 + New Features

QKeyEvent::text() doesn't return accent letter on Linux

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 427 Views 3 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.
  • dporobicD Offline
    dporobicD Offline
    dporobic
    wrote on last edited by
    #1

    Does anyone know why QKeyEvent::text() for typing ` + a returns one empty string and one letter a instead of one empty string and the letter à on Linux? Under Windows this seems to be working fine (same application running under Windows and Linux).

    I'm handling the pressed keys via this class.

    https://github.com/ksnip/ksnip

    raven-worxR 1 Reply Last reply
    0
    • dporobicD dporobic

      Does anyone know why QKeyEvent::text() for typing ` + a returns one empty string and one letter a instead of one empty string and the letter à on Linux? Under Windows this seems to be working fine (same application running under Windows and Linux).

      I'm handling the pressed keys via this class.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @dporobic
      you might see the internals described here:
      https://www.kdab.com/a-little-hidden-gem-qstringiterator/

      How did you check the contents of the string exactly? Did you inspect the actual bytecode?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      dporobicD 1 Reply Last reply
      2
      • raven-worxR raven-worx

        @dporobic
        you might see the internals described here:
        https://www.kdab.com/a-little-hidden-gem-qstringiterator/

        How did you check the contents of the string exactly? Did you inspect the actual bytecode?

        dporobicD Offline
        dporobicD Offline
        dporobic
        wrote on last edited by
        #3

        @raven-worx I wrote it to console. The solution seems to be using inputMethod for those composed letters as suggested here on SO https://stackoverflow.com/questions/60020662/qkeyeventtext-doesnt-return-accent-letter-on-linux

        https://github.com/ksnip/ksnip

        1 Reply Last reply
        0
        • Kent-DorfmanK Offline
          Kent-DorfmanK Offline
          Kent-Dorfman
          wrote on last edited by
          #4

          Keep in mind that how multi-national characters are decoded in linux is dependent upon the settings of the terminal program you are viewing them in. Are the locale environment variables set correctly? Have you installed an appropriate font into linux?

          1 Reply Last reply
          2
          • dporobicD Offline
            dporobicD Offline
            dporobic
            wrote on last edited by
            #5

            As said, in my case I was missing the "inputMethod". I was not aware that is exists and that it returns composed characters, like accents or Chinese letters.

            https://github.com/ksnip/ksnip

            1 Reply Last reply
            1

            • Login

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