Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macros created by dragging an item to the hotbar do not respect shift/ctl/alt presses #4819

Closed
tposney opened this issue Dec 4, 2024 · 0 comments · Fixed by #4994
Closed

Comments

@tposney
Copy link

tposney commented Dec 4, 2024

The created hotbar macro does not pass through the event and the rollItem function it calls does not accept or forward an event.

function rollItem could be changed to

function rollItem(itemName, { event, activityName }={}) {
  let target = getMacroTarget(itemName, "Item");
  if ( activityName ) target = target?.system.activities?.getName(activityName);
  return target?.use({ event, legacy: false });
}

and create5eMacro changed to have

      foundry.utils.mergeObject(macroData, {
        name: itemData.name,
        img: itemData.img,
        command: `dnd5e.documents.macro.rollItem("${itemData._source.name}", { event })`,
        flags: {"dnd5e.itemMacro": true}
      });
      break;

Which together mean that ctl/alt/shift will work as expected when clicking on the macro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants