Pass ModifiersState to mouse_moved method too
This commit is contained in:
parent
f625257fc8
commit
7b4ba80bb1
|
@ -310,7 +310,7 @@ impl<N: Notify> Processor<N> {
|
||||||
let y = limit(y, 0, processor.ctx.size_info.height as i32);
|
let y = limit(y, 0, processor.ctx.size_info.height as i32);
|
||||||
|
|
||||||
*hide_cursor = false;
|
*hide_cursor = false;
|
||||||
processor.mouse_moved(x as u32, y as u32, modifiers.shift);
|
processor.mouse_moved(x as u32, y as u32, modifiers);
|
||||||
|
|
||||||
if !processor.ctx.selection.is_none() {
|
if !processor.ctx.selection.is_none() {
|
||||||
processor.ctx.terminal.dirty = true;
|
processor.ctx.terminal.dirty = true;
|
||||||
|
|
|
@ -253,7 +253,7 @@ impl From<&'static str> for Action {
|
||||||
|
|
||||||
impl<'a, A: ActionContext + 'a> Processor<'a, A> {
|
impl<'a, A: ActionContext + 'a> Processor<'a, A> {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn mouse_moved(&mut self, x: u32, y: u32, shift: bool) {
|
pub fn mouse_moved(&mut self, x: u32, y: u32, modifiers: ModifiersState) {
|
||||||
self.ctx.mouse_mut().x = x;
|
self.ctx.mouse_mut().x = x;
|
||||||
self.ctx.mouse_mut().y = y;
|
self.ctx.mouse_mut().y = y;
|
||||||
|
|
||||||
|
@ -274,7 +274,7 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> {
|
||||||
|
|
||||||
if self.ctx.mouse_mut().left_button_state == ElementState::Pressed {
|
if self.ctx.mouse_mut().left_button_state == ElementState::Pressed {
|
||||||
let report_mode = mode::TermMode::MOUSE_REPORT_CLICK | mode::TermMode::MOUSE_MOTION;
|
let report_mode = mode::TermMode::MOUSE_REPORT_CLICK | mode::TermMode::MOUSE_MOTION;
|
||||||
if shift || !self.ctx.terminal_mode().intersects(report_mode) {
|
if modifiers.shift || !self.ctx.terminal_mode().intersects(report_mode) {
|
||||||
self.ctx.update_selection(Point {
|
self.ctx.update_selection(Point {
|
||||||
line: point.line,
|
line: point.line,
|
||||||
col: point.col
|
col: point.col
|
||||||
|
|
Loading…
Reference in New Issue