keybinding logging

macos-click-through
Keith Simmons 5 years ago
parent 1f0d93ca3f
commit b337d83548

@ -1,6 +1,7 @@
use nvim_rs::Neovim; use nvim_rs::Neovim;
use nvim_rs::compat::tokio::Compat; use nvim_rs::compat::tokio::Compat;
use tokio::process::ChildStdin; use tokio::process::ChildStdin;
use log::trace;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub enum UiCommand { pub enum UiCommand {
@ -18,6 +19,7 @@ impl UiCommand {
nvim.ui_try_resize(width.max(10) as i64, height.max(3) as i64).await nvim.ui_try_resize(width.max(10) as i64, height.max(3) as i64).await
.expect("Resize failed"), .expect("Resize failed"),
UiCommand::Keyboard(input_command) => { UiCommand::Keyboard(input_command) => {
trace!("Keyboard Input Sent: {}", input_command);
nvim.input(&input_command).await nvim.input(&input_command).await
.expect("Input failed"); .expect("Input failed");
}, },

@ -1,7 +1,7 @@
use std::time::{Duration, Instant}; use std::time::{Duration, Instant};
use std::thread::sleep; use std::thread::sleep;
use log::{info, debug, error}; use log::{info, trace, debug, error};
use skulpin::{LogicalSize, PhysicalSize}; use skulpin::{LogicalSize, PhysicalSize};
use skulpin::sdl2; use skulpin::sdl2;
use skulpin::sdl2::event::Event; use skulpin::sdl2::event::Event;
@ -109,6 +109,7 @@ pub fn ui_loop() {
Event::Quit {..} => break 'running, Event::Quit {..} => break 'running,
Event::Window {..} => REDRAW_SCHEDULER.queue_next_frame(), Event::Window {..} => REDRAW_SCHEDULER.queue_next_frame(),
Event::KeyDown { keycode: Some(keycode), keymod: modifiers, .. } => { Event::KeyDown { keycode: Some(keycode), keymod: modifiers, .. } => {
trace!("KeyDown Received: {}", keycode);
if let Some((key_text, special)) = parse_keycode(keycode) { if let Some((key_text, special)) = parse_keycode(keycode) {
let will_text_input = let will_text_input =
@ -127,6 +128,7 @@ pub fn ui_loop() {
} }
}, },
Event::TextInput { text, .. } => { Event::TextInput { text, .. } => {
trace!("Keyboard Input Received: {}", &text);
if ignore_text_input { if ignore_text_input {
ignore_text_input = false; ignore_text_input = false;
} else { } else {

Loading…
Cancel
Save