ListView cannot focus #1718
Answered
by
ogoffart
Decodetalkers
asked this question in
Q&A
-
I want to focus on the item and select the item in the listview, and listen to the keyboard event of enter, but I cannot find how to use up and down to select the item in listview |
Beta Was this translation helpful? Give feedback.
Answered by
ogoffart
Oct 8, 2022
Replies: 1 comment 1 reply
-
The StandardListView widget actually handle the up and down keys. Here is the implementation in case you want to do the same in your custom ListView: slint/internal/compiler/widgets/fluent/std-widgets.slint Lines 496 to 528 in b1b4a44 Edit: The part that handle the keys is the FocusScope part, line 516 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Decodetalkers
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The StandardListView widget actually handle the up and down keys. Here is the implementation in case you want to do the same in your custom ListView:
slint/internal/compiler/widgets/fluent/std-widgets.slint
Lines 496 to 528 in b1b4a44