Make key macro more portable

pull/924/head
Nehliin 3 years ago committed by Blaž Hrastnik
parent a4c5f46739
commit da4d9340ba

@ -12,13 +12,13 @@ use std::{
#[macro_export]
macro_rules! key {
($key:ident) => {
KeyEvent {
::helix_view::input::KeyEvent {
code: ::helix_view::keyboard::KeyCode::$key,
modifiers: ::helix_view::keyboard::KeyModifiers::NONE,
}
};
($($ch:tt)*) => {
KeyEvent {
::helix_view::input::KeyEvent {
code: ::helix_view::keyboard::KeyCode::Char($($ch)*),
modifiers: ::helix_view::keyboard::KeyModifiers::NONE,
}

Loading…
Cancel
Save