355 views
in GUI Development by
Hi,

Attaching one action for one key is done as reference, similarly same key should attach different actions based on the selected item in the vertical list. So that respective action attached based on selected item should take place when the key is pressed, also other actions for the same key should be detached.

Is it possible to achieve this or is there any alternate solutions for this case?

Thank you.

1 Answer

0 votes
by

Hello Meenakshi Sundaram,

I have to admit that I don't really understand your question. Especially the part with ' ... other actions for the same key should be detached' is not clear what you try to achieve. If you want different operations to be performed on the same key event but depending on the selected item, following are the possibilities:

Option 1: handle the key events in the components implementing the items. Then each component can perform the operation which is related to it. The selection in the list relays the keyboard events to the selected item automatically. This expects that the list itself is focused. See also Keyboard events and the focus path.

Option 2: in the slot method associated to the key event handler test which item is actually selected and depending on this information perform the desired operation. See also the list property SelectedItem to query the current selection.

I hope it helps you further.

Best regards

Paul Banach

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...