Rename Input to InputEvent and add paste events
This commit is contained in:
parent
fdc46aa3b8
commit
6ce2afbc9f
4 changed files with 105 additions and 70 deletions
|
|
@ -38,7 +38,7 @@ pub fn derive_impl(input: DeriveInput) -> syn::Result<TokenStream> {
|
|||
let description = decapitalize(&docstring);
|
||||
let description = description.strip_suffix('.').unwrap_or(&description);
|
||||
match_cases.push(quote!{
|
||||
() if input.matches(&self.#field_ident, #description) => Some(Self::Event::#variant_ident),
|
||||
() if event.matches_key_binding(&self.#field_ident, #description) => Some(Self::Event::#variant_ident),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -52,7 +52,7 @@ pub fn derive_impl(input: DeriveInput) -> syn::Result<TokenStream> {
|
|||
impl ::cove_input::KeyGroup for #struct_ident {
|
||||
type Event = #enum_ident;
|
||||
|
||||
fn event(&self, input: &mut ::cove_input::Input) -> Option<Self::Event> {
|
||||
fn match_input_event(&self, event: &mut ::cove_input::InputEvent) -> Option<Self::Event> {
|
||||
match () {
|
||||
#( #match_cases )*
|
||||
() => None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue