mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-24 10:09:32 -06:00
Cause: clipboard events carry no modifiers, and the Cut and Copy/Paste mapping read i.modifiers, egui's state after all of the frame's events. A Shift+Delete with Shift released in the same frame became Ctrl+X (no deletion), and a Ctrl+X followed in the same frame by Ctrl up and Shift down became Shift+Delete: the selected items and the layers using them deleted without the prompt. Fix: walk the frame's events in order from the modifiers held when it began (the state the last pass ended with, recorded each pass), so each Cut, Copy and Paste uses the modifiers at its place in the stream. When that state isn't known (a pass was skipped), a Cut is never Shift+Delete. Only Shift alone counts, not Ctrl/Alt+Shift. Tests: a_cut_is_read_with_the_modifiers_where_it_is_in_the_frame queues modifier changes and a Cut in one frame (Shift then Cut and Shift up; Ctrl, Cut, Ctrl up, Shift down; and the mixed orders); the Windows Shift+Delete helper now sends Shift, Cut and Shift up as one frame. They fail on the previous mapping and pass now.