online icon indicating copy to clipboard operation
online copied to clipboard

macOS keyboard shortcuts are not like native for selecting text

Open juliusknorr opened this issue 1 year ago • 2 comments

Describe the Bug

Keyboard shortcuts on mac os are not as used to from native apps

Steps to Reproduce

Use keyboard shortcuts in writer as described below

Expected Behavior

Command+Command+ selects everything to the left Command+Command+ selects everything to the right Option+Command+ selects the word to the left Option+Command+ selects the word to the right

Actual Behavior

Command+Command+ selects the word to the left Command+Command+ selects the word to the right Not sure which shortcuts trigger selecting everything to line start / line end

Does anyone have some pointers where those are handled? I'd be interested in contributing a fix there

Additional Context

COOLWSD version: 24.04.10.1(git hash: d1fee3efa2 (E)) LOKit version: Collabora Office 24.04.10.1(git hash: 2bacb30) Served by: Ubuntu 24.04.1 LTS Server ID: 811a5f57 WOPI host: nextcloud 31.0.0.5 - richdocuments 9.0.0-dev.0

juliusknorr avatar Dec 05 '24 08:12 juliusknorr

I think for the arrow keys and modifiers: browser/src/map/handler/Map.Keyboard.js is the right place, for normal text input we would use browser/src/layer/marker/TextInput.js which has a hidden text area and is not your friend! =) so I expect this would be fixed in Map.Keyboard.js.

Ctrl-Alt-Shift-D and look in the console for the protocol messages, bit of a break-point in Socket.js sendMessage might help find the code sending the actual keystrokes you care about (which are prolly modifier presses) :-)

Thanks for poking at this ! =)

mmeeks avatar Jun 17 '25 10:06 mmeeks

Also there is new location for keyboard shortcuts handled in Online: https://github.com/CollaboraOnline/online/blob/master/browser/src/map/handler/Map.KeyboardShortcuts.ts#L292

We migrate to it when possible as modifying Map.Keyboard.js was hard without breaking anything else :)

eszkadev avatar Jun 17 '25 12:06 eszkadev