[英]mathquill latex- how can I move cursor (selection) by code?
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 lib( mathquill git ),我正在尝试使用html按钮制作键盘和退格键,但我无法弄清楚如何移动光标抛出公式。
Thanks, 谢谢,
You can trigger custom keydown event on textarea within mathquill to move cursor through formula. 您可以在mathquill中的textarea上触发自定义keydown事件,以通过公式移动光标。
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);
Use charCode / keyCode / which are: 使用charCode / keyCode /,它们是:
Thanks. 谢谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.