Use alt modifier instead of cmd to add selections
This commit is contained in:
parent
9e651ee127
commit
73afb29b04
4 changed files with 12 additions and 5 deletions
|
@ -55,8 +55,8 @@ impl EditorElement {
|
||||||
fn mouse_down(
|
fn mouse_down(
|
||||||
&self,
|
&self,
|
||||||
position: Vector2F,
|
position: Vector2F,
|
||||||
|
alt: bool,
|
||||||
shift: bool,
|
shift: bool,
|
||||||
cmd: bool,
|
|
||||||
mut click_count: usize,
|
mut click_count: usize,
|
||||||
layout: &mut LayoutState,
|
layout: &mut LayoutState,
|
||||||
paint: &mut PaintState,
|
paint: &mut PaintState,
|
||||||
|
@ -79,7 +79,7 @@ impl EditorElement {
|
||||||
} else {
|
} else {
|
||||||
cx.dispatch_action(Select(SelectPhase::Begin {
|
cx.dispatch_action(Select(SelectPhase::Begin {
|
||||||
position,
|
position,
|
||||||
add: cmd,
|
add: alt,
|
||||||
click_count,
|
click_count,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -861,10 +861,11 @@ impl Element for EditorElement {
|
||||||
match event {
|
match event {
|
||||||
Event::LeftMouseDown {
|
Event::LeftMouseDown {
|
||||||
position,
|
position,
|
||||||
|
alt,
|
||||||
shift,
|
shift,
|
||||||
cmd,
|
|
||||||
click_count,
|
click_count,
|
||||||
} => self.mouse_down(*position, *shift, *cmd, *click_count, layout, paint, cx),
|
..
|
||||||
|
} => self.mouse_down(*position, *alt, *shift, *click_count, layout, paint, cx),
|
||||||
Event::LeftMouseUp { position } => self.mouse_up(*position, cx),
|
Event::LeftMouseUp { position } => self.mouse_up(*position, cx),
|
||||||
Event::LeftMouseDragged { position } => {
|
Event::LeftMouseDragged { position } => {
|
||||||
self.mouse_dragged(*position, layout, paint, cx)
|
self.mouse_dragged(*position, layout, paint, cx)
|
||||||
|
|
|
@ -3650,6 +3650,8 @@ mod tests {
|
||||||
presenter.borrow_mut().dispatch_event(
|
presenter.borrow_mut().dispatch_event(
|
||||||
Event::LeftMouseDown {
|
Event::LeftMouseDown {
|
||||||
position: Default::default(),
|
position: Default::default(),
|
||||||
|
ctrl: false,
|
||||||
|
alt: false,
|
||||||
shift: false,
|
shift: false,
|
||||||
cmd: false,
|
cmd: false,
|
||||||
click_count: 1,
|
click_count: 1,
|
||||||
|
|
|
@ -14,8 +14,10 @@ pub enum Event {
|
||||||
},
|
},
|
||||||
LeftMouseDown {
|
LeftMouseDown {
|
||||||
position: Vector2F,
|
position: Vector2F,
|
||||||
cmd: bool,
|
ctrl: bool,
|
||||||
|
alt: bool,
|
||||||
shift: bool,
|
shift: bool,
|
||||||
|
cmd: bool,
|
||||||
click_count: usize,
|
click_count: usize,
|
||||||
},
|
},
|
||||||
LeftMouseUp {
|
LeftMouseUp {
|
||||||
|
|
|
@ -92,6 +92,8 @@ impl Event {
|
||||||
native_event.locationInWindow().x as f32,
|
native_event.locationInWindow().x as f32,
|
||||||
window_height - native_event.locationInWindow().y as f32,
|
window_height - native_event.locationInWindow().y as f32,
|
||||||
),
|
),
|
||||||
|
ctrl: modifiers.contains(NSEventModifierFlags::NSControlKeyMask),
|
||||||
|
alt: modifiers.contains(NSEventModifierFlags::NSAlternateKeyMask),
|
||||||
shift: modifiers.contains(NSEventModifierFlags::NSShiftKeyMask),
|
shift: modifiers.contains(NSEventModifierFlags::NSShiftKeyMask),
|
||||||
cmd: modifiers.contains(NSEventModifierFlags::NSCommandKeyMask),
|
cmd: modifiers.contains(NSEventModifierFlags::NSCommandKeyMask),
|
||||||
click_count: native_event.clickCount() as usize,
|
click_count: native_event.clickCount() as usize,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue