nib-edit / nib

Wysiwyg / Text editor components built using React and Prosemirror
https://nib-edit.github.io/nib/
GNU General Public License v3.0
228 stars 26 forks source link

Modifier-key detection only works for Windows and macOS #95

Open aried3r opened 4 years ago

aried3r commented 4 years ago

Hey!

I believe this check https://github.com/nib-edit/Nib/blob/8cc08f1b9e41c8bec5b6e170f9fc05ec60dee4f1/packages/core/src/utils/format-keymap.js#L9 should probably be the inverse, if it's a Mac, the cmd key symbol should be shown, otherwise a circumflex or Ctrl. This also covers all other OS', since macOS is the only one with a cmd key I believe.

On mobile, I'd leave out the shortcuts completely, but I'm not sure how feasible detection is, especially that the iPad Pro keyboard has a command key.

WDYT?

jpuri commented 4 years ago

This definitely can be improved, I will take time to work on it.