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

Add keyboard shortcuts that control whether a drag/drop operation is move or copy #4876

Open
arbron opened this issue Dec 13, 2024 · 0 comments · May be fixed by #4879
Open

Add keyboard shortcuts that control whether a drag/drop operation is move or copy #4876

arbron opened this issue Dec 13, 2024 · 0 comments · May be fixed by #4879
Assignees
Labels
ux User experience related features or bugs
Milestone

Comments

@arbron
Copy link
Collaborator

arbron commented Dec 13, 2024

Currently the drag & drop behavior in the system varies depending on where you are dragging to and from:

Actor Inventory -> Another Actor: Copy
Actor Inventory -> Container on Actor: Move
Sidebar -> Actor Inventory: Copy
Sidebar -> Container in Sidebar: Move
Compendium -> Anywhere Else: Copy
Compendium -> Container in Compendium: Move

While these default behaviors should be retained, it would be very nice to be able to toggle to the opposite mode when dragging. This would involve holding down a certain keyboard modifier much like you would in a file browser on your computer. This should also involve changing the drag cursor to make it clear whether a drag will result in a copy or a move operation.

@arbron arbron added the ux User experience related features or bugs label Dec 13, 2024
@arbron arbron added this to the D&D5E 4.2.0 milestone Dec 13, 2024
@arbron arbron self-assigned this Dec 13, 2024
arbron added a commit that referenced this issue Dec 14, 2024
Adds the ability to use the OS-defined modifier key (usually
Alt on Windows and Option on Mac) to toggle between the default
drop behavior and the opposite behavior. So if dragging within
the same actor this changes from the default move behaior to
copy behavior and the opposite when dragging between different
actors or to the sidebar.

Enabling this required access to the current drag payload during
the `ondragover` event, so this extends the `DragDrop` class
provided by core to store that information during the `ondragstart`
event and adds a new handler for the `ondragend` event to clear
the stored payload.

Currently this only covers dragging items, with some minor
improvements to dragging favorites on the character sheet.
This framework could be expanded in the future to support
dragging actors into the bastion tab as well as dragging active
effects, advancements, or activities.

Closes #4876
arbron added a commit that referenced this issue Dec 14, 2024
Adds the ability to use the OS-defined modifier key (usually
Alt on Windows and Option on Mac) to toggle between the default
drop behavior and the opposite behavior. So if dragging within
the same actor this changes from the default move behaior to
copy behavior and the opposite when dragging between different
actors or to the sidebar.

Enabling this required access to the current drag payload during
the `ondragover` event, so this extends the `DragDrop` class
provided by core to store that information during the `ondragstart`
event and adds a new handler for the `ondragend` event to clear
the stored payload.

Currently this only covers dragging items, with some minor
improvements to dragging favorites on the character sheet.
This framework could be expanded in the future to support
dragging actors into the bastion tab as well as dragging active
effects, advancements, or activities.

Closes #4876
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ux User experience related features or bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant