diff --git a/TODO.md b/TODO.md index c4f0055f4..37c53e7e2 100644 --- a/TODO.md +++ b/TODO.md @@ -18,7 +18,6 @@ Correctness: Improvements: * scrollback: configurable -* shift-click and drag to continue selection Mac: diff --git a/src/Surface.zig b/src/Surface.zig index d78e82483..80fd87ac6 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -1514,6 +1514,17 @@ pub fn mouseButtonCallback( self.mouse.click_state[@intCast(usize, @enumToInt(button))] = action; self.mouse.mods = @bitCast(input.Mods, mods); + // Shift-click continues the previous mouse state. cursorPosCallback + // will also do a mouse report so we don't need to do any the logic + // below. + if (button == .left and action == .press) { + if (mods.shift and self.mouse.left_click_count > 0) { + const pos = try self.rt_surface.getCursorPos(); + try self.cursorPosCallback(pos); + return; + } + } + self.renderer_state.mutex.lock(); defer self.renderer_state.mutex.unlock();