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. Map character to another language
Qt 6.11 is out! See what's new in the release blog

Map character to another language

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.1k 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.
  • T Offline
    T Offline
    Talei
    wrote on last edited by
    #1

    Hello,
    I try to implement soft keyboard with multiple language support in Qt (widgets) and I have a problem with leter "translation" to different languages.
    Basically what I have is bunch of buttons on form with key code like Qt::Key_A etc. Now I want to i.e. switch language to German so key Y is now Z and Z if now Y.
    How would I go about doing such conversion?

    And I'm looking for Qt solution == OS independent solution.
    Note that I don't want to change OS keyboard layout or / and input language.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      I would do it as a real "keyboard":http://en.wikipedia.org/wiki/Scancode does it.
      Assign a code for each button and provide a translation table from a code to a character.
      For example let say left lower button has a code 0x7A. When widget draws the button it will ask a translator what character to draw on a button with code 0x7A.
      When the button is pressed widget will emit a signal with this code and whoever listen for the signal will get code and translate it to 'Z' in one case or to 'Y' in another.

      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