I also noticed that the javascript API says that the Thermometer object is supposed to listen for ESC key being pressed and set the .cancelled property if so. I'm not finding that is happening though.
https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/JS_API_AcroJS.html#id1055
Code: Select all
// test if esc key is listened to by thermometer
async function listenForEsc() {
// start the thermometer
const th = app.thermometer;
th.begin();
th.text = "This is supposed to close with ESC, but I think it doesn't.";
th.duration = 1000;
// start a really long loop
for (th.value = th.duration; th.value--;) {
if (th.cancelled) break;
await app.timeOut(100);
}
th.end();
}
listenForEsc();