Merge lp:~gang65/ubuntu-calculator-app/ubuntu-calculator-app-keyboard-shortcut-fix into lp:ubuntu-calculator-app

Proposed by Bartosz Kosiorek
Status: Merged
Approved by: Riccardo Padovani
Approved revision: 196
Merged at revision: 196
Proposed branch: lp:~gang65/ubuntu-calculator-app/ubuntu-calculator-app-keyboard-shortcut-fix
Merge into: lp:ubuntu-calculator-app
Diff against target: 34 lines (+13/-4)
1 file modified
app/ubuntu-calculator-app.qml (+13/-4)
To merge this branch: bzr merge lp:~gang65/ubuntu-calculator-app/ubuntu-calculator-app-keyboard-shortcut-fix
Reviewer Review Type Date Requested Status
Riccardo Padovani Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+262517@code.launchpad.net

Commit message

Fix keyboard shortcuts (eg. Ctrl+C)

Description of the change

Fix keyboard shortcuts

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Good catch, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'app/ubuntu-calculator-app.qml'
--- app/ubuntu-calculator-app.qml 2015-06-17 20:11:29 +0000
+++ app/ubuntu-calculator-app.qml 2015-06-20 10:58:10 +0000
@@ -290,7 +290,9 @@
290 id: calculationHistory290 id: calculationHistory
291 }291 }
292292
293 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 input293 // Some special keys like backspace captured in TextField,
294 // are for some reason not sent to the application but to the text input
295 Keys.onPressed: {
294 keyboardLoader.item.pressedKey = event.key;296 keyboardLoader.item.pressedKey = event.key;
295 keyboardLoader.item.pressedKeyText = event.text;297 keyboardLoader.item.pressedKeyText = event.text;
296 }298 }
@@ -633,9 +635,16 @@
633 rightMargin: units.gu(1)635 rightMargin: units.gu(1)
634 }636 }
635637
636 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 input638 // Need to capture special keys like backspace here,
637 keyboardLoader.item.pressedKey = event.key;639 // as they are for some reason not sent to the application but to the text input
638 keyboardLoader.item.pressedKeyText = event.text;640 Keys.onPressed: {
641 // Don't press calculator's visual keys, when modifiers are pressed
642 // to allow work keyboard shortcuts (eg. Ctrl+C)
643 if (event.modifiers & Qt.NoModifier) {
644
645 keyboardLoader.item.pressedKey = event.key;
646 keyboardLoader.item.pressedKeyText = event.text;
647 }
639 }648 }
640649
641 Keys.onReleased: {650 Keys.onReleased: {

Subscribers

People subscribed via source and target branches