legui icon indicating copy to clipboard operation
legui copied to clipboard

Selection Event

Open DeflatedPickle opened this issue 6 years ago • 2 comments

The selection event would be a way to cause a widget to be selected without a mouse. The event would be fired when the widget was; clicked, tabbed to or when a select method was called.

DeflatedPickle avatar Mar 06 '20 21:03 DeflatedPickle

Actually there is focus event, fired when component was clicked or tabbed (ctrl+tab/ctrl+shift+tab) You can also define some method in your component and call Context#setFocusedGui(Component toGainFocus, Context context, Frame frame) to make some component focused and fire focus event. Context and Frame arguments are optional but required for valid focus switch from previous focus owner and to let system know that focused event was changed. Also you have to keep in mind that Component#setFocused(boolean focused) called by event listeners/handlers so it is not the best option to override it and add event generation here.

SpinyOwl avatar Mar 10 '20 19:03 SpinyOwl

I'm proposing an event for when a component has no visual way to select it. The selection event could also be called with some select method as well as using a possible visual way.

DeflatedPickle avatar Mar 10 '20 20:03 DeflatedPickle