I just ran into an issue where I don't get qualifier keys reported in ScriptCommandData.func.qualifiers
when the button script calls the user command from a @keydown
modifier conditional.
In fact, when there is any @keydown
modifier present in the button script
Command MYCOMMAND:
function OnInit(initData){
initData.name = "Test Command";
initData.version = "0.1.0";
var cmd = initData.AddCommand();
cmd.name = "MYCOMMAND";
cmd.method = "OnCmd";
cmd.label = "MYCOMMAND";
cmd.template = "STR";
}
function OnCmd(data){
DOpus.Output(data.func.args.STR + " <--> " + data.func.qualifiers);
}
Button script:
@keydown:ctrl
MYCOMMAND ctrl
@keydown:none
MYCOMMAND none
@keydown:shift
MYCOMMAND shift
@keydown:any
MYCOMMAND any
Always gives "none":
2024-08-15 16:39 Test Command: none <--> none
2024-08-15 16:39 Test Command: ctrl <--> none
2024-08-15 16:39 Test Command: any <--> none
2024-08-15 16:39 Test Command: shift <--> none
2024-08-15 16:39 Test Command: any <--> none
2024-08-15 16:39 Test Command: any <--> none
Only when there is no @keydown
modifier in the script will the script get the qualifiers:
MYCOMMAND NoModifier
Gives
2024-08-15 16:45 Test Command: NoModifier <--> none
2024-08-15 16:45 Test Command: NoModifier <--> ctrl
2024-08-15 16:45 Test Command: NoModifier <--> shift
2024-08-15 16:45 Test Command: NoModifier <--> alt
2024-08-15 16:45 Test Command: NoModifier <--> shift,ctrl
2024-08-15 16:45 Test Command: NoModifier <--> shift,alt
2024-08-15 16:45 Test Command: NoModifier <--> ctrl,alt
2024-08-15 16:45 Test Command: NoModifier <--> shift,ctrl,alt
Note that even keydowns below will break it:
MYCOMMAND NoModifierButStillBroken
@keydown:ctrl
MYCOMMAND ctrl
2024-08-15 16:50 Test Command: NoModifierButStillBroken <--> none
2024-08-15 16:50 Test Command: ctrl <--> none
What's up with that?
is this still a thing/related? User command and @keydown : bug? - #4 by Leo