mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
simulate numeric pad button pressed when pressing numeric key on keyboard in new call form #LINQT-2313
This commit is contained in:
parent
2e7c250d8d
commit
16703ec2d5
6 changed files with 73 additions and 59 deletions
|
|
@ -5792,13 +5792,13 @@ Um sie in einem kommerziellen Projekt zu aktivieren, kontaktieren Sie uns bitte.
|
|||
<context>
|
||||
<name>SearchBar</name>
|
||||
<message>
|
||||
<location filename="../../view/Control/Input/SearchBar.qml" line="124"/>
|
||||
<location filename="../../view/Control/Input/SearchBar.qml" line="131"/>
|
||||
<source>open_dialer_acccessibility_label</source>
|
||||
<extracomment>"Open dialer"</extracomment>
|
||||
<translation>Wähltastatur öffnen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Control/Input/SearchBar.qml" line="144"/>
|
||||
<location filename="../../view/Control/Input/SearchBar.qml" line="151"/>
|
||||
<source>clear_text_input_acccessibility_label</source>
|
||||
<extracomment>"Clear text input"</extracomment>
|
||||
<translation>Texteingabe löschen</translation>
|
||||
|
|
|
|||
|
|
@ -5669,13 +5669,13 @@ To enable them in a commercial project, please contact us.</translation>
|
|||
<context>
|
||||
<name>SearchBar</name>
|
||||
<message>
|
||||
<location filename="../../view/Control/Input/SearchBar.qml" line="124"/>
|
||||
<location filename="../../view/Control/Input/SearchBar.qml" line="131"/>
|
||||
<source>open_dialer_acccessibility_label</source>
|
||||
<extracomment>"Open dialer"</extracomment>
|
||||
<translation>Open dialer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Control/Input/SearchBar.qml" line="144"/>
|
||||
<location filename="../../view/Control/Input/SearchBar.qml" line="151"/>
|
||||
<source>clear_text_input_acccessibility_label</source>
|
||||
<extracomment>"Clear text input"</extracomment>
|
||||
<translation>Clear text input</translation>
|
||||
|
|
|
|||
|
|
@ -5640,13 +5640,13 @@ Pour les activer dans un projet commercial, merci de nous contacter.</translatio
|
|||
<context>
|
||||
<name>SearchBar</name>
|
||||
<message>
|
||||
<location filename="../../view/Control/Input/SearchBar.qml" line="124"/>
|
||||
<location filename="../../view/Control/Input/SearchBar.qml" line="131"/>
|
||||
<source>open_dialer_acccessibility_label</source>
|
||||
<extracomment>"Open dialer"</extracomment>
|
||||
<translation>Ouvrir le numéroteur</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Control/Input/SearchBar.qml" line="144"/>
|
||||
<location filename="../../view/Control/Input/SearchBar.qml" line="151"/>
|
||||
<source>clear_text_input_acccessibility_label</source>
|
||||
<extracomment>"Clear text input"</extracomment>
|
||||
<translation>Supprimer le texte saisi</translation>
|
||||
|
|
|
|||
|
|
@ -41,61 +41,65 @@ FocusScope {
|
|||
}
|
||||
}
|
||||
|
||||
function handleKeyPadEvent(event) {
|
||||
if (event.key === Qt.Key_0) {
|
||||
keypadKeyPressedAtIndex(10)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_1) {
|
||||
keypadKeyPressedAtIndex(0)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_2) {
|
||||
keypadKeyPressedAtIndex(1)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_3) {
|
||||
keypadKeyPressedAtIndex(2)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_4) {
|
||||
keypadKeyPressedAtIndex(3)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_5) {
|
||||
keypadKeyPressedAtIndex(4)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_6) {
|
||||
keypadKeyPressedAtIndex(5)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_7) {
|
||||
keypadKeyPressedAtIndex(6)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_8) {
|
||||
keypadKeyPressedAtIndex(7)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_9) {
|
||||
keypadKeyPressedAtIndex(8)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_Asterisk) {
|
||||
keypadKeyPressedAtIndex(9)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_Plus) {
|
||||
mainItem.buttonPressed("+")
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_Enter) {
|
||||
mainItem.launchCall()
|
||||
event.accepted = true
|
||||
}
|
||||
}
|
||||
|
||||
Keys.onPressed: (event) => {
|
||||
event.accepted = false
|
||||
if (event.modifiers & Qt.KeypadModifier) {
|
||||
if (event.key === Qt.Key_0) {
|
||||
keypadKeyPressedAtIndex(10)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_1) {
|
||||
keypadKeyPressedAtIndex(0)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_2) {
|
||||
keypadKeyPressedAtIndex(1)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_3) {
|
||||
keypadKeyPressedAtIndex(2)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_4) {
|
||||
keypadKeyPressedAtIndex(3)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_5) {
|
||||
keypadKeyPressedAtIndex(4)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_6) {
|
||||
keypadKeyPressedAtIndex(5)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_7) {
|
||||
keypadKeyPressedAtIndex(6)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_8) {
|
||||
keypadKeyPressedAtIndex(7)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_9) {
|
||||
keypadKeyPressedAtIndex(8)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_Asterisk) {
|
||||
keypadKeyPressedAtIndex(9)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_Plus) {
|
||||
mainItem.buttonPressed("+")
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_Enter) {
|
||||
mainItem.launchCall()
|
||||
event.accepted = true
|
||||
}
|
||||
handleKeyPadEvent(event)
|
||||
}
|
||||
if (event.key === Qt.Key_Backspace) {
|
||||
mainItem.wipe()
|
||||
|
|
|
|||
|
|
@ -104,6 +104,13 @@ FocusScope {
|
|||
repeat: false
|
||||
onTriggered: textField.searchText = textField.text
|
||||
}
|
||||
Keys.onPressed: (event) => {
|
||||
event.accepted = false
|
||||
if (mainItem.numericPadPopup && mainItem.numericPadPopup.opened && (event.modifiers & Qt.KeypadModifier)) {
|
||||
mainItem.numericPadPopup.keyPadKeyPressed(event)
|
||||
event.accepted = true
|
||||
}
|
||||
}
|
||||
}
|
||||
Button {
|
||||
id: dialerButton
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@ Control.Popup {
|
|||
property var currentCall
|
||||
onOpened: numPad.forceActiveFocus()
|
||||
signal buttonPressed(string text)
|
||||
signal keyPadKeyPressed(KeyEvent event)
|
||||
onKeyPadKeyPressed: (event) => {
|
||||
numPad.handleKeyPadEvent(event)
|
||||
}
|
||||
signal launchCall()
|
||||
signal wipe()
|
||||
|
||||
|
|
@ -72,7 +76,6 @@ Control.Popup {
|
|||
lastRowVisible: mainItem.lastRowVisible
|
||||
currentCall: mainItem.currentCall
|
||||
onButtonPressed: (text) => {
|
||||
console.log("BUTTON PRESSED NUMPAD")
|
||||
mainItem.buttonPressed(text)
|
||||
}
|
||||
onLaunchCall: mainItem.launchCall()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue