Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the shortcut keys in tooltip titles to show cmd on Mac instead of ctrl #1628

Open
mbeekhuis opened this issue Nov 11, 2024 · 8 comments

Comments

@mbeekhuis
Copy link

mbeekhuis commented Nov 11, 2024

It would be nice if we could disable tool tips as a feature. Maybe adding an option "toolTips: false". I don't need these toolTips and therefore have to collect all nodes with a title attribute in the DOM and remove the attribute. Not so elegant. What do you think?

@josdejong
Copy link
Owner

Thanks for your suggestion. Which tooltips do you mean exactly? Those created based on a provided JSON Schema?

@mbeekhuis
Copy link
Author

The tooltips generated through setting title attributes. Like "undo.title = (0,i18n/* translate */.Tl)('undo');"

@josdejong
Copy link
Owner

Ah, ok, clear.

I think these titles should not be removed: they can be helpful in understanding the functionality of the editor and discover quick keys. If you really want to disable the titles I think you'll have to fork the project or built some code to clear all the .title attributes.

@josdejong josdejong added wontfix and removed feature labels Nov 14, 2024
@mbeekhuis
Copy link
Author

The reason why I want to hide these tool tips are the short cuts. for example, if I hold down the ctrl key and click, a dialog of the operating system opens instead of the action described in the tool tip. At least on MacOS this is the case. So the shortcuts would have to be adapted to all operating systems. Instead of addressing this, I thought it's probably better to not show any tool tip at all.

@josdejong
Copy link
Owner

Ah, so the shortcut keys are wrong on Mac, and should be say Cmd+Z instead of Ctrl+Z? If we fix that, does that solve your issue?

@mbeekhuis
Copy link
Author

Yes, Cmd would be the right choice.

@josdejong
Copy link
Owner

Ok then makes sense!

I'll change the title accordingly. So the plan is:

  • detect whether on a Mac
  • adjust all shortcut keys in titles to use cmd on Mac, and ctrl on Windows and Linux.

Help would be welcome :)

@josdejong josdejong changed the title Disable tool tips Change the shortcutkeys in tooltip titles to show <kbd>cmd</kbd> on Mac instead of <kbd>ctrl</kbd> Nov 15, 2024
@josdejong josdejong changed the title Change the shortcutkeys in tooltip titles to show <kbd>cmd</kbd> on Mac instead of <kbd>ctrl</kbd> Change the shortcutkeys in tooltip titles to show cmd on Mac instead of ctrl Nov 15, 2024
@josdejong josdejong changed the title Change the shortcutkeys in tooltip titles to show cmd on Mac instead of ctrl Change the shortcut keys in tooltip titles to show cmd on Mac instead of ctrl Nov 15, 2024
@mbeekhuis
Copy link
Author

mbeekhuis commented Nov 15, 2024

var shortCutKey = ~navigator.platform.indexOf('Mac') ? 'metaKey' : 'ctrlKey';
var shortCutKeyLabel = shortCutKey === 'metaKey' ? 'Cmd' : 'Ctrl';

appendTitle: 'Append a new field with type \'auto\' after this field ('+shortCutKeyLabel+'+Shift+Ins)',...

textmode._onKeyDown = function (event) {
  var keynum = event.which || event[shortCutKey];
  var handled = false;
  if (keynum === 73 && event[shortCutKey]) {...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants