Add numpad Enter handlers (Keys.onEnterPressed) (#516)

This commit is contained in:
Maximiliano Bertacchini 2021-02-27 23:01:22 +00:00 committed by GitHub
parent 87a7d2e45c
commit fff9f2b17d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 42 additions and 0 deletions

View file

@ -245,6 +245,17 @@ CenteredGridView {
}
}
Keys.onEnterPressed: {
// Open the app context menu if activated via the gamepad or keyboard
// for running games. If the game isn't running, the above onClicked
// method will handle the launch.
if (model.running) {
// This will be keyboard/gamepad driven so use
// open() instead of popup()
appContextMenu.open()
}
}
Keys.onMenuPressed: {
// This will be keyboard/gamepad driven so use open() instead of popup()
appContextMenu.open()

View file

@ -21,4 +21,7 @@ ItemDelegate {
Keys.onReturnPressed: {
clicked()
}
Keys.onEnterPressed: {
clicked()
}
}

View file

@ -22,6 +22,10 @@ MenuItem {
triggered()
}
Keys.onEnterPressed: {
triggered()
}
Keys.onEscapePressed: {
parentMenu.close()
}

View file

@ -56,6 +56,10 @@ NavigableDialog {
accept()
}
Keys.onEnterPressed: {
accept()
}
Keys.onEscapePressed: {
reject()
}

View file

@ -27,6 +27,10 @@ ToolButton {
clicked()
}
Keys.onEnterPressed: {
clicked()
}
Keys.onRightPressed: {
nextItemInFocusChain(true).forceActiveFocus(Qt.TabFocus)
}

View file

@ -379,6 +379,10 @@ CenteredGridView {
Keys.onReturnPressed: {
renamePcDialog.accept()
}
Keys.onEnterPressed: {
renamePcDialog.accept()
}
}
}
}

View file

@ -358,6 +358,10 @@ Flickable {
Keys.onReturnPressed: {
customResolutionDialog.accept()
}
Keys.onEnterPressed: {
customResolutionDialog.accept()
}
}
Label {
@ -382,6 +386,10 @@ Flickable {
Keys.onReturnPressed: {
customResolutionDialog.accept()
}
Keys.onEnterPressed: {
customResolutionDialog.accept()
}
}
}
}

View file

@ -495,6 +495,10 @@ ApplicationWindow {
Keys.onReturnPressed: {
addPcDialog.accept()
}
Keys.onEnterPressed: {
addPcDialog.accept()
}
}
}
}