online icon indicating copy to clipboard operation
online copied to clipboard

Improve keyboard focus

Open juliusknorr opened this issue 3 years ago • 3 comments

Signed-off-by: Julius Härtl [email protected] Change-Id: I712d5457b65c0c8a84efdfb3d031160c8455ea3c

  • Resolves: #
  • Target version: master

Summary

TODO

  • [x] Convert notebook bar tabs to buttons
  • [x] Convert close button to an actual button
  • [ ] Fix styling of close button
  • [ ] Figure out why the focus is brought back to the leaflet container after some time
  • [ ] Find a way to register a global keyboard shortcut to move the focus out of leaflet to the menu bar
  • [ ] Extend further cases of the JSDialogBuilder to use proper elements

Checklist

  • [ ] Code is properly formatted
  • [ ] All commits have Change-Id
  • [ ] I have run tests with make check
  • [ ] I have issued make run and manually verified that everything looks okay
  • [ ] Documentation (manuals or wiki) has been updated or is not required

juliusknorr avatar Aug 11 '22 19:08 juliusknorr

Figure out why the focus is brought back to the leaflet container after some time Find a way to register a global keyboard shortcut to move the focus out of leaflet to the menu bar

@pedropintosilva @eszkadev I would need some pointers for those two items. I've noticed that the keyboard events are catched in Map.Keyboard.js and mostly forwarded to core as UNO commands but I'm unsure what a proper way of achieving the above mentioned goals would be.

I think for the shortcuts it might make most sense to stick to what is used on Collabora Office on the desktop:

  • F6 | Repeatedly pressing F6 switches the focus and circles through the following objects:•Menu bar •Every toolbar from top to bottom and from left to right •Every free window from left to right •Document
  • F10 or Alt | Switches to the Menu bar and back.

juliusknorr avatar Aug 11 '22 19:08 juliusknorr

Figure out why the focus is brought back to the leaflet container after some time

In Calc there is CellCursor message from core which often moves focus to the map. We don't do that if input is focused. Worth checking that place: https://github.com/CollaboraOnline/online/blob/master/browser/src/layer/tile/CanvasTileLayer.js#L4300

eszkadev avatar Aug 12 '22 06:08 eszkadev

Find a way to register a global keyboard shortcut to move the focus out of leaflet to the menu bar

Yes, Map.Keyboard.js seems to be good point to start.

We have one place where we pass keyboard event to JSDialogs (only dialogs and popups, not sidebar or notebookbar) to check if it should be handled there (ESC key): https://github.com/CollaboraOnline/online/blob/master/browser/src/map/handler/Map.Keyboard.js#L252

But most of global actions are in _handleKeyEvent, like F1 for Help.

If you need to access UI components: map.uiManager -> Control.UIManager.js has code related to the toolbar, notebookbar or sidebar.

eszkadev avatar Aug 12 '22 06:08 eszkadev

Closing as this is beeing addressed differently already in the meantime

juliusknorr avatar Jun 06 '23 07:06 juliusknorr