我正在使用 mathquill lib (mathquill git),我正在尝试制作键盘和退格键使用 html 按钮,但我不知道如何移动光标抛出公式.
I am using mathquill lib (mathquill git) and I am trying to make a keypad and a backspace using html buttons but I can't figure out how to move the cursor throw the formula.
谢谢,
您可以在 mathquill 中的 textarea 上触发自定义 keydown 事件以在公式中移动光标.
You can trigger custom keydown event on textarea within mathquill to move cursor through formula.
var customKeyDownEvent = $.Event('keydown');
customKeyDownEvent.bubbles = true;
customKeyDownEvent.cancelable =true;
customKeyDownEvent.charCode = 37; // 37 for left arrow key
customKeyDownEvent.keyCode = 37;
customKeyDownEvent.which = 37;
$('.mathquill-editable textarea').trigger(customKeyDownEvent);
使用charCode/keyCode/分别是:
Use charCode / keyCode / which are:
谢谢.
这篇关于mathquill latex-如何通过代码移动光标(选择)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!