Need to use (Q)Shortcuts instead of Keys.onPressed for shortcuts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical System Image |
Fix Released
|
High
|
Bill Filler | ||
qtdeclarative-opensource-src (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
webbrowser-app (Ubuntu) |
Fix Released
|
High
|
Olivier Tilloy | ||
webbrowser-app (Ubuntu RTM) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
On a phone with a bluetooth keyboard connected, with the following standalone example, if I press Ctrl+T I expect the message "Ctrl+T pressed" to be printed on the console, but instead the Ctrl key is ignored and "t" is inserted in the text field.
import QtQuick 2.4
Item {
TextInput {
anchors.
width: parent.width - 20
height: 100
Component.
}
Keys.onPressed: {
console.
if (event.key == Qt.Key_T && event.modifiers == Qt.ControlModifier) {
console.
event.
}
}
}
=======
See the discussion on https:/
QShortcut [1], or QML's Shortcut [2] from qt-5.5 should be used for this instead.
[1] http://
[2] http://
Related branches
- system-apps-ci-bot: Needs Fixing (continuous-integration)
- PS Jenkins bot: Needs Fixing (continuous-integration)
-
Diff: 1198 lines (+666/-337)12 files modifiedsrc/app/CMakeLists.txt (+3/-1)
src/app/FilteredKeyboardModel.qml (+33/-0)
src/app/browserapplication.cpp (+2/-0)
src/app/qquickshortcut.cpp (+283/-0)
src/app/qquickshortcut_p.h (+109/-0)
src/app/webbrowser/Browser.qml (+200/-258)
src/app/webbrowser/KeyboardShortcut.qml (+0/-25)
src/app/webbrowser/KeyboardShortcuts.qml (+0/-41)
src/app/webbrowser/ListViewHighlight.qml (+2/-3)
src/app/webbrowser/NavigationBar.qml (+10/-7)
tests/autopilot/webbrowser_app/tests/test_keyboard.py (+22/-1)
tests/autopilot/webbrowser_app/tests/test_private.py (+2/-1)
affects: | qtubuntu → canonical-devices-system-image |
Changed in canonical-devices-system-image: | |
status: | New → Triaged |
importance: | Undecided → High |
assignee: | nobody → Michał Sawicz (saviq) |
milestone: | none → ww04-2016 |
tags: | added: patch |
Changed in canonical-devices-system-image: | |
status: | Triaged → In Progress |
tags: | added: keyboard |
Changed in canonical-devices-system-image: | |
milestone: | none → ww08-2016 |
status: | New → Confirmed |
Changed in canonical-devices-system-image: | |
status: | Confirmed → In Progress |
Changed in canonical-devices-system-image: | |
milestone: | ww08-2016 → 11 |
status: | In Progress → Confirmed |
Changed in webbrowser-app (Ubuntu): | |
status: | Confirmed → In Progress |
Changed in canonical-devices-system-image: | |
status: | Confirmed → Fix Committed |
Changed in canonical-devices-system-image: | |
status: | Fix Committed → Fix Released |
And as a real-life example that is affected by this issue, the browser app, when the address bar has active focus, won’t open a new tab when the user presses Ctrl+T, instead it will input "t" in the address bar.