Skip to content

Commit

Permalink
docstring triple slash
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-tiwari committed Feb 6, 2022
1 parent d76b8b1 commit a2aec87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions egui/src/input_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ impl InputState {
self.pointer.wants_repaint() || self.scroll_delta != Vec2::ZERO || !self.events.is_empty()
}

// Ignore a key if it was pressed or released this frame. Useful for hotkeys.
// Returns if the key was pressed this frame
/// Ignore a key if it was pressed or released this frame. Useful for hotkeys.
/// Returns if the key was pressed this frame
pub fn consume_key(&mut self, modifiers: Modifiers, key: Key) -> bool {
self.events.retain(|event| {
!matches!(
Expand Down
7 changes: 2 additions & 5 deletions egui_demo_lib/src/easy_mark/easy_mark_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,8 @@ fn shortcuts(ui: &Ui, code: &mut dyn TextBuffer, ccursor_range: &mut CCursorRang
(Key::U, "_"), // _underline_
] {
if ui.input_mut().consume_key(
key,
egui::Modifiers {
command: true,
..Default::default()
},
egui::Modifiers::new().command(true),
key
) {
toggle_surrounding(code, ccursor_range, surrounding);
any_change = true;
Expand Down

0 comments on commit a2aec87

Please sign in to comment.