diff options
Diffstat (limited to 'src/input.rs')
-rw-r--r-- | src/input.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/input.rs b/src/input.rs index 47374e47..f3efdf14 100644 --- a/src/input.rs +++ b/src/input.rs @@ -381,6 +381,19 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> { } } + pub fn on_focus_change(&mut self, is_focused: bool) { + if self.ctx.terminal_mode().contains(mode::FOCUS_IN_OUT) { + let chr = if is_focused { + "I" + } else { + "O" + }; + + let msg = format!("\x1b[{}", chr); + self.ctx.write_to_pty(msg.into_bytes()); + } + } + pub fn mouse_input(&mut self, state: ElementState, button: MouseButton) { if let MouseButton::Left = button { let state = mem::replace(&mut self.ctx.mouse_mut().left_button_state, state); |