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

'beforecommand' and 'aftercommand' do not react to tool switches #118

Closed
perludum opened this issue Jan 11, 2025 · 2 comments
Closed

'beforecommand' and 'aftercommand' do not react to tool switches #118

perludum opened this issue Jan 11, 2025 · 2 comments

Comments

@perludum
Copy link

The 'beforecommand' and 'aftercommand' event listeners do not trigger when switching tools (e.g., from "Brush" to "Marquee") in Aseprite. This behavior is inconsistent because these events fire correctly for other commands, such as "Cut", "Copy", "Paste" and others.

Simple test script:

app.events:on('aftercommand',
  function(ev)
    app.alert("After Command Triggered")
end)

The 'aftercommand' event should trigger when switching tools, as it does for other commands.

Aseprite v. 1.3.10.1 on macOS Sequoia

@dacap
Copy link
Member

dacap commented Jan 23, 2025

Hi @perludum, here the issue is that tools are not changed with commands (there is no command execution when a tool is changed), so the situation is a little tricky.

What are you trying to achieve observing the tool change? Probably we can offer some other kind of event/workaround.

@perludum
Copy link
Author

Thank you, @dacap, for the clarification.

I’ve created a custom toolbar, and my goal was to update it dynamically when the active tool changes, so it visually highlights the selected tool. However, I recently came across this related issue, which you’re already working on - exactly what I was looking for!

Since this feature is already in development, my request will likely become obsolete, so I’ll close this issue. Looking forward to the upcoming improvements - thank you for your time and support!

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

No branches or pull requests

2 participants