Is there a way to get the state of shift key while processing mouse events #1914
-
I am currently trying to write a generic DataList (DataTable) widget. At the moment, I created a new widget DataRow by copying and modifying iced::native::Row. For handling the mouse events I refer to the code of iced::native::button::Button. In the update method I check for mouse::Event::ButtonPressed. `pub fn update(event:Event, layout:Layout<'a>, cursor_position: Point, shell: &mut Shell'<'a, Message>, on_press: &Option, state: impl FnOnce() -> &'a mut state) { match (event) { Event::Mouse(m_ev) => {
} }` I guess the standard way would be to catch the iced::keyboard:Event:ModifiersChanged event in the surrounding DataList widget and to propagate the shift key state to to the contained DataRows via an operation, correct? Another question is related to the column widths. For the moment it would be sufficient to give the DataTable fixed unchangeable values at initialization. To be a bit more intuitive I would like to specify the column width in estimated number of characters. Does iced |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Same thing is asked in #1868, but no answer yet. I think for now you'll have to keep track of modifiers events yourself and maintain their states separately. |
Beta Was this translation helpful? Give feedback.
-
At the moment there does not seem to be a more easy solution than the manual one proposed by lufte, therefore closed! |
Beta Was this translation helpful? Give feedback.
At the moment there does not seem to be a more easy solution than the manual one proposed by lufte, therefore closed!