Fix arrows and other keys not working in sendbox

This commit is contained in:
miruka 2019-07-05 03:16:52 -04:00
parent ecba7c47ec
commit 57577ba8b8
2 changed files with 17 additions and 17 deletions

View File

@ -27,7 +27,6 @@ ScrollView {
color: HStyle.controls.textArea.background color: HStyle.controls.textArea.background
} }
Keys.forwardTo: [scrollView] //Keys.forwardTo: [scrollView]
} }
} }

View File

@ -52,7 +52,8 @@ HRectangle {
} }
} }
Keys.onReturnPressed: { Component.onCompleted: {
area.Keys.onReturnPressed.connect(function (event) {
event.accepted = true event.accepted = true
if (event.modifiers & Qt.ShiftModifier || if (event.modifiers & Qt.ShiftModifier ||
@ -67,10 +68,10 @@ HRectangle {
var args = [chatPage.roomId, textArea.text] var args = [chatPage.roomId, textArea.text]
py.callClientCoro(chatPage.userId, "send_markdown", args) py.callClientCoro(chatPage.userId, "send_markdown", args)
area.clear() area.clear()
} })
// Numpad enter area.Keys.onEnterPressed.connect(area.Keys.onReturnPressed)
Keys.onEnterPressed: Keys.onReturnPressed(event) }
} }
} }
} }