Key event in any language and shift+ctrl
-
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
- some users(like me) might use second language and by this code, event keys just work for english...
- in this code Qt.shiftModifire make no difference and in fact by pressing ctrl+z console print "lose", how can i fix it...
-
- 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