Enable keyboard `on_activate` in Table and Tree
Pressing the Return key on a table or tree should be semantically identical to double clicking. This PR aims to do that, by invoking on_activate, just like double clicking does.
On GTK, this is the default behaviour, so nothing to do there.
There's a small snag when multiple_select is enabled.
Currently, on_activate has an argument: the row/node that was double clicked.
When pressing Return when multiple rows are selected, there isn't a single row that should be activated. I chose to not invoke the event in this case.
I placed the code that helps handling this on the core widgets: the _selection_single method. This way it can be shared across implementations.
PR Checklist:
- [ ] All new features have been tested
- [x] All new features have been documented
- [x] I have read the CONTRIBUTING.md file
- [x] I will abide by the code of conduct
Winforms failure is unrelated. c.f. the latest run on https://github.com/beeware/toga/pull/3769
I've restarted CI; if it passes and you think the PR is ready for review, please post a comment.
I think this PR is ready for review.
I'm currently preparing a demo for Wednesday, so I may not get a chance to look at this until Thursday.