multi_trigger_autocomplete icon indicating copy to clipboard operation
multi_trigger_autocomplete copied to clipboard

prevent default keyboard event on the desktop platform

Open DogeVenci opened this issue 2 years ago • 5 comments

Is your feature request related to a problem? Please describe. I hope to be able to use the tab, up and down arrow keys, and other keys to select options. For TextField, the default key events need to be blocked.

Describe the solution you'd like prevent default key event like tab, up and down arrows key .

DogeVenci avatar Jul 14 '23 03:07 DogeVenci

Hey @DogeVenci, can you explain a bit more on the prevent them on desktop?

xsahil03x avatar Jul 18 '23 10:07 xsahil03x

@xsahil03x I am currently using RawKeyboardListener to customize shortcuts.

RawKeyboardListener(
          focusNode: FocusNode(onKey: (node, event) {
            // The process of handling key events.
            return (
                event.logicalKey == LogicalKeyboardKey.arrowUp ||
                    event.logicalKey == LogicalKeyboardKey.arrowDown ||
                    event.logicalKey == LogicalKeyboardKey.tab
            )
                ? KeyEventResult.handled
                : KeyEventResult.ignored;
          }),
         child:  TextField()
         ...
)

My suggestion is to add an onKey method on MultiTriggerAutocomplete to customize the processing of keys event

DogeVenci avatar Jul 19 '23 01:07 DogeVenci

@DogeVenci thanks, I will try to work on this sometime next week.

xsahil03x avatar Jul 28 '23 10:07 xsahil03x

@xsahil03x Hey Sahil, do you still have any plans of adding keyboard navigation? I've been trying to do it by myself to then open a PR but it's way too different of how the default Autocomplete widget works. Great job on the plugin!

gildaswise avatar Aug 31 '23 21:08 gildaswise

@gildaswise i do have the plans but I'm a bit busy with the work.

xsahil03x avatar Sep 01 '23 03:09 xsahil03x