Forum for the PDF-XChange Editor - Free and Licensed Versions
Moderators:Daniel - PDF-XChange, PDF-XChange Support, Vasyl - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
For some scripts, it would be useful to have a way to run the script without a dialog, and have a way to make a dialog show to change options, etc. Currently this can be done by making two separate tools, but it would be very useful for a toolbar or menu script to know if the Ctrl or Shift key was held down while the menu item was selected. This would allow the script to provide one or the other option.
I can't find anything in the JS API saying only field events get those properties, but that's the only time they seem to be filled for PDF XChange(?)
// test for event.modifier and event.shift
app.addToolButton( {
cName: 'CtrShiftTest',
cLabel: "Hold down Ctrl or Shift",
cExec: 'testCtrlShiftEvent(event);'
});
function testCtrlShiftEvent(evt) {
let kp = [];
if (evt.modifier) kp.push("Ctrl");
if (evt.shift) kp.push("Shift");
if (!kp.length) kp.push("No");
app.alert( kp.join(" & ") + " key pressed!");
}
Ive passed this along to the dev team for review, and will let you know what they have to say here.
Also, unrelated to the question itself, I notice you posted in the Viewer forum, I presume that this question is related to the Editor? Should I move the topic for you?
Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Ivan wrote:fixed. now "modifier" and "shift" properties will have proper value for every type of event
Hopefully it makes it into the 10.6 release next week, but if not it should be in the one following that.
Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Daniel - PDF-XChange wrote: ↑Fri May 02, 2025 6:11 pm
Also, unrelated to the question itself, I notice you posted in the Viewer forum, I presume that this question is related to the Editor? Should I move the topic for you?
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com