pell
pell copied to clipboard
Map hotkeys to actions
Such as Control + b to bold. It'd be useful to make this configurable.
I would also like to see more common shortcuts like CMD+K for links and also I would include the keymap in the buttons title attribute so users can find out what shortcuts are available:
Guys, please check out the src/
and you'll see why it's so light weighted. It's only 100+ lines of code.
I think the whole point of this lib is to demonstrate how simple wyswyg can be done with modern browser APIs. Feature request like this should be done by some plugin, not included in core lib.
maybe if you want to use such as control+b ,maybe you can try to listen keydown and trigger the editor action
Integration with mousetrap: https://jsfiddle.net/hackape/jpffb9f5/
One interesting thing I found while making the demo, browsers actually implement some default hotkeys, but just not consistently. I tested on Chrome and Firefox, macOS version. Firefox implements cmd/ctrl+b/i/u
as expected, while Chrome implements weirdly just cmd+b, cmd+i, ctrl+u
.