Dialog Window Shortcuts
Posted: Sat Apr 09, 2022 3:56 pm
Hello,
I made a couple simple scripts that did a single thing, then I made a script that had a couple versions of how I wanted it to behave, and I was happy making two copies with different hard-coded settings, as clunky as that is.
Then I wanted to add a script that would have eight permutations of options, and that was absurd. It took an unfortunate amount of work, but I managed to crib together a working popup dialog with all the options and settings, and I love it.
But now I'm thinking I would like to add keyboard shortcuts for the buttons in my dialog popup, and I have no idea how to start that. (Like pressing ESC cancels (something does that for me), I want to be able to type Y or N for "yes" or "no," that kind of thing.
Not a global hotkey, that's working already.) Is that something defined in the HTML? In the popup JS? Or still in the action JS? All three? I'm not having luck with the wiki or any scripts I've already tried - is there a script I could reference that does that?
If anyone wants specifics, here's the current plugin I've got:
https://www.dropbox.com/s/w5wuhd1q86zhu ... .mmip?dl=0
I made a couple simple scripts that did a single thing, then I made a script that had a couple versions of how I wanted it to behave, and I was happy making two copies with different hard-coded settings, as clunky as that is.
Then I wanted to add a script that would have eight permutations of options, and that was absurd. It took an unfortunate amount of work, but I managed to crib together a working popup dialog with all the options and settings, and I love it.
But now I'm thinking I would like to add keyboard shortcuts for the buttons in my dialog popup, and I have no idea how to start that. (Like pressing ESC cancels (something does that for me), I want to be able to type Y or N for "yes" or "no," that kind of thing.
Not a global hotkey, that's working already.) Is that something defined in the HTML? In the popup JS? Or still in the action JS? All three? I'm not having luck with the wiki or any scripts I've already tried - is there a script I could reference that does that?
If anyone wants specifics, here's the current plugin I've got:
https://www.dropbox.com/s/w5wuhd1q86zhu ... .mmip?dl=0