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>
|
<context>
|
||||||
<name>SearchBar</name>
|
<name>SearchBar</name>
|
||||||
<message>
|
<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>
|
<source>open_dialer_acccessibility_label</source>
|
||||||
<extracomment>"Open dialer"</extracomment>
|
<extracomment>"Open dialer"</extracomment>
|
||||||
<translation>Wähltastatur öffnen</translation>
|
<translation>Wähltastatur öffnen</translation>
|
||||||
</message>
|
</message>
|
||||||
<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>
|
<source>clear_text_input_acccessibility_label</source>
|
||||||
<extracomment>"Clear text input"</extracomment>
|
<extracomment>"Clear text input"</extracomment>
|
||||||
<translation>Texteingabe löschen</translation>
|
<translation>Texteingabe löschen</translation>
|
||||||
|
|
|
||||||
|
|
@ -5669,13 +5669,13 @@ To enable them in a commercial project, please contact us.</translation>
|
||||||
<context>
|
<context>
|
||||||
<name>SearchBar</name>
|
<name>SearchBar</name>
|
||||||
<message>
|
<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>
|
<source>open_dialer_acccessibility_label</source>
|
||||||
<extracomment>"Open dialer"</extracomment>
|
<extracomment>"Open dialer"</extracomment>
|
||||||
<translation>Open dialer</translation>
|
<translation>Open dialer</translation>
|
||||||
</message>
|
</message>
|
||||||
<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>
|
<source>clear_text_input_acccessibility_label</source>
|
||||||
<extracomment>"Clear text input"</extracomment>
|
<extracomment>"Clear text input"</extracomment>
|
||||||
<translation>Clear text input</translation>
|
<translation>Clear text input</translation>
|
||||||
|
|
|
||||||
|
|
@ -5640,13 +5640,13 @@ Pour les activer dans un projet commercial, merci de nous contacter.</translatio
|
||||||
<context>
|
<context>
|
||||||
<name>SearchBar</name>
|
<name>SearchBar</name>
|
||||||
<message>
|
<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>
|
<source>open_dialer_acccessibility_label</source>
|
||||||
<extracomment>"Open dialer"</extracomment>
|
<extracomment>"Open dialer"</extracomment>
|
||||||
<translation>Ouvrir le numéroteur</translation>
|
<translation>Ouvrir le numéroteur</translation>
|
||||||
</message>
|
</message>
|
||||||
<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>
|
<source>clear_text_input_acccessibility_label</source>
|
||||||
<extracomment>"Clear text input"</extracomment>
|
<extracomment>"Clear text input"</extracomment>
|
||||||
<translation>Supprimer le texte saisi</translation>
|
<translation>Supprimer le texte saisi</translation>
|
||||||
|
|
|
||||||
|
|
@ -41,9 +41,7 @@ FocusScope {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Keys.onPressed: (event) => {
|
function handleKeyPadEvent(event) {
|
||||||
event.accepted = false
|
|
||||||
if (event.modifiers & Qt.KeypadModifier) {
|
|
||||||
if (event.key === Qt.Key_0) {
|
if (event.key === Qt.Key_0) {
|
||||||
keypadKeyPressedAtIndex(10)
|
keypadKeyPressedAtIndex(10)
|
||||||
event.accepted = true
|
event.accepted = true
|
||||||
|
|
@ -97,6 +95,12 @@ FocusScope {
|
||||||
event.accepted = true
|
event.accepted = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Keys.onPressed: (event) => {
|
||||||
|
event.accepted = false
|
||||||
|
if (event.modifiers & Qt.KeypadModifier) {
|
||||||
|
handleKeyPadEvent(event)
|
||||||
|
}
|
||||||
if (event.key === Qt.Key_Backspace) {
|
if (event.key === Qt.Key_Backspace) {
|
||||||
mainItem.wipe()
|
mainItem.wipe()
|
||||||
event.accepted = true
|
event.accepted = true
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,13 @@ FocusScope {
|
||||||
repeat: false
|
repeat: false
|
||||||
onTriggered: textField.searchText = textField.text
|
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 {
|
Button {
|
||||||
id: dialerButton
|
id: dialerButton
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,10 @@ Control.Popup {
|
||||||
property var currentCall
|
property var currentCall
|
||||||
onOpened: numPad.forceActiveFocus()
|
onOpened: numPad.forceActiveFocus()
|
||||||
signal buttonPressed(string text)
|
signal buttonPressed(string text)
|
||||||
|
signal keyPadKeyPressed(KeyEvent event)
|
||||||
|
onKeyPadKeyPressed: (event) => {
|
||||||
|
numPad.handleKeyPadEvent(event)
|
||||||
|
}
|
||||||
signal launchCall()
|
signal launchCall()
|
||||||
signal wipe()
|
signal wipe()
|
||||||
|
|
||||||
|
|
@ -72,7 +76,6 @@ Control.Popup {
|
||||||
lastRowVisible: mainItem.lastRowVisible
|
lastRowVisible: mainItem.lastRowVisible
|
||||||
currentCall: mainItem.currentCall
|
currentCall: mainItem.currentCall
|
||||||
onButtonPressed: (text) => {
|
onButtonPressed: (text) => {
|
||||||
console.log("BUTTON PRESSED NUMPAD")
|
|
||||||
mainItem.buttonPressed(text)
|
mainItem.buttonPressed(text)
|
||||||
}
|
}
|
||||||
onLaunchCall: mainItem.launchCall()
|
onLaunchCall: mainItem.launchCall()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue