mapeditor/tiled

Do you want to work on this issue?

You can request for a bounty in order to promote it!

Scripting - Tools: Add a method to capure mouseWheel up/down #3244

BlaXun posted onGitHub

Right now tools have a function mouseMoved(x,y,modifiers) that we can use to capture movement. We also have a method for mouseButton-Press. I think it would be really nice if we could have a similar method for mouse wheel up/down. For example I wrote a tool that can place an object that uses a ellipse as shape. Using mouse wheel up/down I want to pre-define the radius before actually placing the object.


None of the current tools use the wheel events, which are currently only used for scrolling and zooming. These functionalities also use most of the modifiers, so doing anything with wheel events in the tools would potentially intercept the user trying to scroll or zoom the view.

When adding support for this, probably tools should get the event first, and it would need to be somehow possible to know whether the tool has ignored the event, in which case it would still fall back to scrolling or zooming.

For now I'd suggest using a modifier along with regular mouse movement, to allow changing the radius.

posted by bjorn over 3 years ago

Thanks for the answer. Are modifiers actually documented somewhere? I've checked the Scripting API documentation but could not find a clarification... maybe its in the "normal" documentation. I am not a regular user of Tiled, but am creating multiple custom tools for a project. I feel like I should know what "modifiers" refer too ^^, sry

On Tue, Jan 18, 2022 at 11:17 AM Thorbjørn Lindeijer < @.***> wrote:

None of the current tools use the wheel events, which are currently only used for scrolling and zooming. These functionalities also use most of the modifiers, so doing anything with wheel events in the tools would potentially intercept the user trying to scroll or zoom the view.

When adding support for this, probably tools should get the event first, and it would need to be somehow possible to know whether the tool has ignored the event, in which case it would still fall back to scrolling or zooming.

For now I'd suggest using a modifier along with regular mouse movement, to allow changing the radius.

— Reply to this email directly, view it on GitHub https://github.com/mapeditor/tiled/issues/3244#issuecomment-1015265448, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNHC46DDZPFR6V5OFMSTW3UWU44FANCNFSM5MGWVWHQ . You are receiving this because you authored the thread.Message ID: @.***>

posted by BlaXun over 3 years ago

Are modifiers actually documented somewhere?

The current online docs don't explain them yet, but this has been fixed in https://github.com/mapeditor/tiled/commit/3573815b85b2aa2266af9750d4347db1d14e81c2. The online documentation will be updated along with the Tiled 1.8 release.

posted by bjorn over 3 years ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests