~mterry/ubuntu-calculator-app/confined

« back to all changes in this revision

Viewing changes to app/ubuntu-calculator-app.qml

  • Committer: Niklas Wenzel
  • Date: 2015-06-11 15:40:14 UTC
  • mto: This revision was merged to the branch mainline in revision 183.
  • Revision ID: nikwen.developer@gmail.com-20150611154014-v5heoaxjcf7crxn8
Fix typing special characters on hardware keyboards

Show diffs side-by-side

added added

removed removed

Lines of Context:
287
287
                id: calculationHistory
288
288
            }
289
289
 
290
 
            Keys.onPressed: {
 
290
            Keys.onPressed: { //Some special keys like backspace captured in TextField below as they are for some reason not sent to the application but to the text input
291
291
                keyboardLoader.item.pressedKey = event.key;
292
292
                keyboardLoader.item.pressedKeyText = event.text;
293
293
            }
630
630
                            rightMargin: units.gu(1)
631
631
                        }
632
632
 
 
633
                        Keys.onPressed: { //Need to capture special keys like backspace here as they are for some reason not sent to the application but to the text input
 
634
                            keyboardLoader.item.pressedKey = event.key;
 
635
                            keyboardLoader.item.pressedKeyText = event.text;
 
636
                        }
 
637
 
 
638
                        Keys.onReleased: {
 
639
                            keyboardLoader.item.pressedKey = -1;
 
640
                            keyboardLoader.item.pressedKeyText = "";
 
641
                        }
 
642
 
633
643
                        readOnly: true
634
644
                        selectByMouse: true
635
645
                        cursorVisible: true