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. Qt::Key and QKeyEvent issues (on-screen keyboard)
Forum Updated to NodeBB v4.3 + New Features

Qt::Key and QKeyEvent issues (on-screen keyboard)

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 6.4k 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.
  • C Offline
    C Offline
    coderr
    wrote on last edited by
    #1

    hi everyone!

    i'm working on an on-screen keyboard which is fully customizable using an an xml-configuration, which i just have to use.
    all i get is a) position, size, ... b) key code (Esc, A, ...) for the keys, which i can map to Qt::Key.
    then i have to send the according QKeyEvent upon a button click.

    1. now when an Qt::Key_A-button and Qt::Key_Shift is pressed, i can guess it's a capital A. but depending on the system's keyboard layout, many keys change in combination with a modifier.
      is there a way to convert a Qt::Key+Qt::KeyboardModifier to the resulting Qt::Key, depending on the OS's keyboard layout (comma+shift=semicolon with a german layout, but not with us layout for example), in case the modifier modifies a specific key code at all?

    2. is there a way to know if a given Qt::Key is generating a printable character (maybe even which one it is exactly, convert it to QChar or QString)?

    thanks alot in advance! i searched around, tried many approaches, but didn't really solve these issues yet ...

    p.s.: "is there a way ..." in this case means "is there a Qt-way which is platform independant, as is Qt" ;-)

    and sorry if my english doesn't sound that well, i tried my best.

    sincerely
    julian

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      Hi,

      1.), if you ask google, there are some virtual keyboards already implemented in Qt:
      "here":http://qt-apps.org/content/show.php/VirtualKeyboard?content=107388 , "here":http://qt-apps.org/content/show.php/Widget Virtual Keyboard?content=111054 and "here":http://ktouch.sourceforge.net/ for example. You can have a look at them, how they did it.

      2.) If you want a customizable keyboard, you have to specify the layout in your xml file. And this layout must be language (layout :-) ) dependent. I already did that once for my company, I know now other way.

      In the OS you specify, how the keyboard should be interpreted, so define the layout. That's what you also must do. Specify the keys, the behavior of shift / Ctrl / Alt / ...

      We had an xml file with in general the following content:
      @
      <keyline>
      <key size=""> <!-- n times in a key line -->
      <normalState display="" keycode=""/>
      <shiftState display="" keycode=""/>
      <altState display="" keycode=""/>
      <altGrState display="" keycode=""/>
      </key>
      <specialKey size="" keycode=""/> <!-- n times in a key line -->--
      </keyline>
      @

      And we specified each keyboard layout and how to interpret it. But I know no way around...

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

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

        I am interested in the answer to this question, the above applications are not doing it ASFAIK.
        How to determine the Qt:key of the current layout. Very simple, I need to paid a Virtual Keyboard similar to this site when I select a keyboard layout, I need the 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