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. Intermediate: how to get keyboard layout keys
Forum Updated to NodeBB v4.3 + New Features

Intermediate: how to get keyboard layout keys

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

    hi guys

    I am making a virtual keyboard and want to show the keys of the currently used layout. Any idea how to find

    1- currently used layout
    2- Character of each key in this layout

    thanks

    1 Reply Last reply
    0
    • L Offline
      L Offline
      leon.anavi
      wrote on last edited by
      #2

      What is your approach for making a virtual keyboard?

      I haven't done such task but my first idea if I were you would be to use a QGridLayout with QPushButtons, class (or data structure such as QMap) to store for values of each key depending the keyboard layout and a enum variable to indicate which layout is active.

      http://anavi.org/

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SherifOmran
        wrote on last edited by
        #3

        I am still thinking for an appropriate approach, however QMap binds value to a key. I need to read for example

        English Layout : Key number 6 first line is Y
        German Layout: Key number 6 first line is Z

        1 Reply Last reply
        0
        • L Offline
          L Offline
          leon.anavi
          wrote on last edited by
          #4

          Use QVector to describe values of keys based on their index.

          http://anavi.org/

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SherifOmran
            wrote on last edited by
            #5

            Please give me an example

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SherifOmran
              wrote on last edited by
              #6

              I am not asking about how to build array but asking about how to determine which character is on the key

              1 Reply Last reply
              0
              • L Offline
                L Offline
                leon.anavi
                wrote on last edited by
                #7

                [quote author="SherifOmran" date="1347122963"]Please give me an example [/quote]

                Sorry but I don't have time to write examples for custom virtual keyboards just to post them in a forum. Try to do it yourself and you can rely on me and the other people at Qt Dev Net for advises.

                http://anavi.org/

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  leon.anavi
                  wrote on last edited by
                  #8

                  Please read Qt documentation about QPushButton, signals and slots to learn how to detect which button is pressed and which character is selected.

                  http://anavi.org/

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SherifOmran
                    wrote on last edited by
                    #9

                    I have a many buttons that form a virtual keyboard, but I want to set their label with the currently selected layout, how can I get the characters of each keyboard keys?

                    Any Idea?

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SherifOmran
                      wrote on last edited by
                      #10

                      How to determine the Qt:key of the current layout. Very simple, I need to paint a Virtual Keyboard similar to this site when I select a keyboard layout, I need my application to do it
                      http://msdn.microsoft.com/en-us/goglobal/bb964651.aspx

                      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