mathlive-tera
Advanced tools
Changelog
0.100.0 2024-06-12
#2396 Pressing the arrow keys in the virtual keyboard would not move the selection in the mathfield and display a runtime error in the console.
#2395 Added a dispatchEvent
command which can be attached to a
custom keycap.
#2392 Pressing the backspace key after typing several digits would delete all the digits.
Its first argument is the name of the dispatched event, and the second
argument is an object with the detail
property, which is the data
associated with the event.
{
label: "✨",
command: "dispatchEvent('customEvent', {detail: 'some data'})"
}
To handle the event, add an event listener to the mathfield element:
mf.addEventListener('customEvent', (ev) => {
console.log(ev.detail);
});