Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Momomotus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pouchet Pierre
Momomotus
Commits
196418d9
Commit
196418d9
authored
2 months ago
by
Massies Alexandre
Browse files
Options
Downloads
Patches
Plain Diff
essai clavier bind
parent
da969b70
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Motus/Main.qml
+34
-0
34 additions, 0 deletions
Motus/Main.qml
with
34 additions
and
0 deletions
Motus/Main.qml
+
34
−
0
View file @
196418d9
...
...
@@ -7,6 +7,40 @@ Window {
visibility
:
Window
.
Maximized
title
:
qsTr
(
"
Hello World
"
)
property
var
caseArray
:
[
_case_1_1
,
_case_1_2
,
_case_1_3
,
_case_1_4
,
_case_1_5
,
_case_2_1
,
_case_2_2
,
_case_2_3
,
_case_2_4
,
_case_2_5
,
_case_3_1
,
_case_3_2
,
_case_3_3
,
_case_3_4
,
_case_3_5
,
_case_4_1
,
_case_4_2
,
_case_4_3
,
_case_4_4
,
_case_4_5
,
_case_5_1
,
_case_5_2
,
_case_5_3
,
_case_5_4
,
_case_5_5
,
_case_6_1
,
_case_6_2
,
_case_6_3
,
_case_6_4
,
_case_6_5
]
property
int
indice_case
:
0
property
var
case_focus
:
caseArray
[
0
]
Keys.onPressed
:
{
// Vérifier que l'élément qui a le focus possède la propriété _textText
if
(
case_focus
&&
case_focus
.
_textText
!==
undefined
&&
/^
[
a-zA-Z
]
$/
.
test
(
event
.
text
))
{
case_focus
.
_textText
=
event
.
text
;
indice_case
+=
1
;
case_focus
=
caseArray
[
indice_case
]
console
.
log
(
"
Lettre pressée :
"
,
event
.
text
);
event
.
accepted
=
true
;
}
else
if
(
event
.
key
===
Qt
.
Key_Backspace
)
{
console
.
log
(
"
Backspace a été pressée
"
);
case_focus
.
_textText
=
""
;
if
(
indice_case
!=
0
){
indice_case
-=
1
;
case_focus
=
caseArray
[
indice_case
];
}
// Ajoutez ici le code pour effacer le contenu ou réaliser l'action souhaitée
}
}
Rectangle
{
id
:
rectangle
x
:
0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment