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. Key event in any language and shift+ctrl

Key event in any language and shift+ctrl

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

    i use this code for undo and redo functions in my program
    @
    if(event.modifiers && Qt.ControlModifier){
    if(event.key=== Qt.Key_Z){
    Undovar.unDo()
    console.log(event.key)
    }
    if(event.key=== Qt.Key_Y){
    Undovar.reDo()
    }

                    if(event.modifiers && Qt.ShiftModifier){
                        if(event.key=== Qt.Key_Z){
                            console.log("lose")
                        }
                    }
                }@
    

    a have 2 questions

    1. some users(like me) might use second language and by this code, event keys just work for english...
    2. in this code Qt.shiftModifire make no difference and in fact by pressing ctrl+z console print "lose", how can i fix it...
    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2
      1. Take a look on "Writing Source Code for Translation":http://doc.qt.io/qt-5/i18n-source-translation.html and "Internationalization with Qt":http://doc.qt.io/qt-5/internationalization.html
      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