diff --git a/src/evdev_mappings.rs b/src/evdev_mappings.rs index c0db18c..d0226eb 100644 --- a/src/evdev_mappings.rs +++ b/src/evdev_mappings.rs @@ -70,6 +70,10 @@ static KEY_MAP: phf::Map<&'static str, Key> = phf_map! { "kprightparen" => Key::KEY_KPRIGHTPAREN, "minus" => Key::KEY_MINUS, "-" => Key::KEY_MINUS, + "asterisk" => Key::KEY_8, + "*" => Key::KEY_8, + "asciicircum" => Key::KEY_6, + "^" => Key::KEY_6, "equal" => Key::KEY_EQUAL, "=" => Key::KEY_EQUAL, "grave" => Key::KEY_GRAVE, diff --git a/template.pest b/template.pest index c80666a..4fefc14 100644 --- a/template.pest +++ b/template.pest @@ -46,6 +46,10 @@ key_base = { | ^"kprightparen" | ^"minus" | ^"-" + | ^"asterisk" + | ^"*" + | ^"asciicircum" + | ^"^" | ^"equal" | ^"=" | ^"grave" diff --git a/tests/tests.rs b/tests/tests.rs index b21bf82..5200013 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -1036,3 +1036,28 @@ fn test_all_alphanumeric() -> Result<(), ParseError> { assert_equal_binding_set(parsed.bindings, known); Ok(()) } + +#[test] +fn test_parse_asterisk_and_circumflex() -> Result<(), ParseError> { + let contents = " +super + * + asterisk +super + shift + ^ + circumflex +super + alt + asterisk + asterisk_word +super + ctrl + asciicircum + circumflex_word + "; + let parsed = SwhkdParser::from(ParserInput::Raw(&contents))?; + + let known = vec![ + Binding::running("asterisk").on(Definition::new(evdev::Key::KEY_8).with_modifiers(&[Super])), + Binding::running("circumflex").on(Definition::new(evdev::Key::KEY_6).with_modifiers(&[Super, Shift])), + Binding::running("asterisk_word").on(Definition::new(evdev::Key::KEY_8).with_modifiers(&[Super, Alt])), + Binding::running("circumflex_word").on(Definition::new(evdev::Key::KEY_6).with_modifiers(&[Super, Control])), + ]; + + assert_eq!(parsed.bindings, known); + Ok(()) +}