How would you use this?

https://wowpedia.fandom.com/wiki/API_IsModifiedClick

The actions . . . I can’t quite wrap my head around how this would work with one of those actions.

Apparently this is what is invoked when you code /<command> [mod:<something>] in a macro. Supposedly you can use the actions from this list instead of just the normal ctrl/alt/shift.

Can someone do a better job of explaining how and when you might use this than the wiki does?

I’m taking the game downtime to research edge cases for my macro-parsing addon and this one struck me as . . . odd.

isHeld = IsModifiedClick("action")
if isHeld then
   if IsRightShiftKeyDown() then
      -- do something
    elseif IsShiftKeyDown() then
      -- do something else 
    ...
    end
else
    -- no modifier key so do whatever
end

also https://wowpedia.fandom.com/wiki/API_IsModifierKeyDown

It looks like it exists so things like the auto loot or self cast modifiers can be bound to different keys.

I understand how to code it. What I’m asking is under what circumstances would…

/cast [mod:CHATLINK]SomeSpell

…make any sense.

This is the list of actions you’re supposedly able to use in there.

    AUTOLOOTTOGGLE            QUESTWATCHTOGGLE
    CHATLINK                  SELFCAST
    COMPAREITEMS              SHOWITEMFLYOUT
    DRESSUP                   SOCKETITEM
    FOCUSCAST                 SPLITSTACK
    OPENALLBAGS               STICKYCAMERA
    PICKUPACTION              TOKENWATCHTOGGLE
**modifier**, **mod**, mod:key, mod:action
    IsModifierKeyDown() or IsModifiedClick(action)
        Accepts shift, ctrl, alt, lshift, rshift, ..., and any action title

Reformatted a touch to remove links and fit on the page nicely, that’s from the wiki.

Are these actions valid in macros?

If so I guess you could use SELFCAST or FOCUSCAST to use the settings to change which modifier does those.

/cast [mod:FOCUSCAST,@focus][mod:SELFCAST,@player][] spellname

I’m not sure why you would want to.

The action is not required to just check if a modifier is pressed but if you’re “listening” for a specific ation you can check for it.

if(IsModifiedClick() and not ignoreModifiers) then
	local handled = nil;
	if ( IsModifiedClick("CHATLINK") ) then
		...
	end
end

I’m gonna have to experiment a bit on a toon with the default keybinds and see what the actual effect of using those “action” values in there are.

I can’t for the life of me see what use they’d be unless they’re just code for “whatever key you have bound to this action - is it held down with a modifier held also”.

@Fizzlemizz - Yeah, but it’s in the MACRO API we’re talking about here.

How would that be a listening thing? Everything in there, almost by system definition, has to be in response to a system event.

Game’s back up. I’ll experiment a bit and see a) does this really work (the Wiki could be wrong) and b) what does it actually do?

So you’re probably not interested in the action as previously mentioned.

The action mentioned is part of how conditionals in macros are implemented. The wiki (as extracted and included in this thread) specifically states that those actions are as acceptable as ctrl/shift/alt (and the variants thereto).

What I’m curious about, what I’m interested in, is what specifically is being tested when you code…

/cast [mod: SHOWITEMFLYOUT]SpellName

…or any other of the 14 actions listed.

/cast [mod: SHOWITEMFLYOUT]SpellName

If you are holding the modifier you have bound to SHOWITEMFLYOUT then it will be true.

They’re just aliases for actual modifiers.

I don’t mean to be a noodge, but you can’t actually bind anything to a modifier key. You can have a binding that includes a normal key and a modifier bound to an action, but my understanding is that blizzard eats keybinds that are attached to actions before they would get as far as a macro.

I’m looking at my keybindings now and none of these are bound to anything.

I do have these three lines in the bindings.wtf file that intrigue me though:

bind CTRL-SHIFT-NUMPADMULTIPLY TOGGLEUI
modifiedclick NONE SELFCAST
modifiedclick NONE AUTOLOOTTOGGLE

TOGGLEUI isn’t in the list from above.

SELFCAST and AUTOLOOTTOGGLE are not bound in my system (I might be able to change that).

@Sharinthia Just saw that and saw that you do in fact bind some TARGETING directly to modifier keys. I’ve just always disabled that.

I would guess that’s probably fairly common as well.

Here are the defaults from bindings.xml

	<ModifiedClick action="SELFCAST" default="ALT"/>
	<ModifiedClick action="FOCUSCAST" default="NONE"/>
	<ModifiedClick action="AUTOLOOTTOGGLE" default="SHIFT"/>
	<ModifiedClick action="MAILAUTOLOOTTOGGLE" default="SHIFT"/>
	<ModifiedClick action="STICKYCAMERA" default="CTRL"/>
	<ModifiedClick action="CHATLINK" default="SHIFT-BUTTON1"/>
	<ModifiedClick action="DRESSUP" default="CTRL-BUTTON1"/>
	<ModifiedClick action="EXPANDITEM" default="SHIFT-BUTTON2"/>
	<ModifiedClick action="SPLITSTACK" default="SHIFT"/>
	<ModifiedClick action="PICKUPACTION" default="SHIFT"/>
	<ModifiedClick action="PICKUPITEM" default="SHIFT"/>
	<ModifiedClick action="COMPAREITEMS" default="SHIFT"/>
	<ModifiedClick action="OPENALLBAGS" default="SHIFT"/>
	<ModifiedClick action="QUESTWATCHTOGGLE" default="SHIFT"/>
	<ModifiedClick action="TOKENWATCHTOGGLE" default="SHIFT"/>
	<ModifiedClick action="SHOWITEMFLYOUT" default="ALT"/>
	<ModifiedClick action="SHOWMULTICASTFLYOUT" default="ALT"/>

https://www.townlong-yak.com/framexml/live/Bindings.xml#1361

So I guess for everything not rebound by the user from that list except CHATLINK, DRESSUP, EXPANDITEM, and FOCUSCAST the value would just mimic the value of the modifier value for that “action” (although quite a few of those are not actually actions, but action modifiers).

I wonder what happens when you use something like CHATLINK in there with a value of SHIFT-BUTTON1 or EXPANDITEM with a value of SHIFT-BUTTON2?

Experimenting now.

Edited to add results:

SELFCAST changed to “ALT” in Interface panel.
CHATLINK discovered to be SHIFT-BUTTON1 with /run print(GetModifiedClick("CHATLINK"))

Created a test macro as follows:

#showtooltip
/cast [mod:SELFCAST]Caravan Hyena

Placed it on one of my buttons.

Alt key pressed, the icon changes from “?” to the correct icon for that spell.

Changed macro from [mod:SELFCAST] to [mod:CHATLINK ].

Shift key pressed, the icon changes from “?” to the correct icon for that spell.

Apparently it takes ONLY the modifier keys from whatever is defined as the keybind for the listed action and applies uses it in the “mod:” conditional.

I can actually see a use for this, although it’s a bit baroque. If you had a very long macro with lots of modifier clumps (like altshift or altctrlshift) you could conceivably shortcut some of those by redefining the bindings for some of the shorter commands in that list and use them as sort of set names for that set of mod parameters.

Okay, I didn’t say it was a particularly GOOD use for this but I can see it being useful.

It might also allow you to override, say, self-target in certain situations where you need to have the ability to use the modifier tied to that in a macro that needs to target someone or something else.

For my purposes, it’s enough that I know how to extract the modifiers for each of the “actions” listed and substitute them in my logic.

On the plus side, my “while the game is down” code all worked perfectly.

I now have macros parsed (not interpreted yet) completely.

This is one of my more complex ones:

["3"] = {
	{
		["cmd"] = "/dismount",
		["cmdObjTbl"] = {
			{
				["conds"] = {
				},
				["cmdObj"] = "",
			}, -- [1]
		},
		["cmdType"] = "S",
		["rawLine"] = "/dismount",
	}, -- [1]
	{
		["cmd"] = "/cleartarget",
		["cmdObjTbl"] = {
			{
				["conds"] = {
					"[help]", -- [1]
					"[noharm,exists]", -- [2]
					"[dead]", -- [3]
					"[mod]", -- [4]
				},
				["cmdObj"] = "",
			}, -- [1]
		},
		["cmdType"] = "S",
		["rawLine"] = "/cleartarget [help][noharm,exists][dead][mod]",
	}, -- [2]
	{
		["cmd"] = "/targetenemy",
		["cmdObjTbl"] = {
			{
				["conds"] = {
					"[help]", -- [1]
					"[noexists]", -- [2]
					"[noharm]", -- [3]
					"[dead]", -- [4]
					"[mod]", -- [5]
				},
				["cmdObj"] = "",
			}, -- [1]
		},
		["cmdType"] = "S",
		["rawLine"] = "/targetenemy [help][noexists][noharm][dead][mod]",
	}, -- [3]
	{
		["cmd"] = "/petautocaston",
		["cmdObjTbl"] = {
			{
				["conds"] = {
					"[nogroup:raid]", -- [1]
					"[@focus,exists,nohelp]", -- [2]
					"[@focus,noexists]", -- [3]
					"[@focus,dead]", -- [4]
				},
				["cmdObj"] = "Growl",
			}, -- [1]
		},
		["cmdType"] = "S",
		["rawLine"] = "/petautocaston [nogroup:raid][@focus,exists,nohelp][@focus,noexists][@focus,dead]Growl",
	}, -- [4]
	{
		["cmd"] = "/click",
		["cmdObjTbl"] = {
			{
				["conds"] = {
				},
				["cmdObj"] = "ElvUI_Bar5Button10",
			}, -- [1]
		},
		["cmdType"] = "S",
		["rawLine"] = "/click ElvUI_Bar5Button10",
	}, -- [5]
},

Edited to add: I’ve been testing the limits of this whole [mod:SELFCAST] pattern and there are a few.

  1. It doesn’t appear that you can aggregated them - that is, while [mod:altctrl] works just fine, [mod:SELFCASTFOCUSCAST] (where self is alt and focus is ctrl) does not.

  2. You can, however “or” them - as in [mod:alt/ctrl] and [mod:SELFCAST/FOCUSCAST] works just fine with them set to alt and ctrl respectively. The behavior of this when one of them set to “NONE” is anomolous, however. Instead of “or”-ing nomod and alt, the nomod part is simply ignored, so Blizzard’s coding motto, “Inconsistency is better than no consistency at all” seems to be actively in play here.

  3. The “NONE” option in the interface panel apparently causes the conditional parsing code to branch somewhere. “No modifier” in the macro api is [nomod] but when a conditional is coded [mod:SELFCAST] where self is set to NONE, it behaves as if you’d coded [nomod] (which works) rather than [mod:NONE] (which does not). so the game is not simply pulling the value from GetModifiedClick(“SELFCAST”) and inserting it. It’s altering [mod:SELFCAST] to be [nomod] instead (something I can easily do).

I think I have everything I need from this thread to continue. I can see that I’m either going to have to explicitly NOT support actions as modifier parameters or I’m probably going to have as much code to deal with them as I have in about half the rest of the addon.

Thanks all.