Closed dalance closed 1 year ago
Hey thanks for filling rhe issue, It's surely a bug.
Now regarding the actual thing, it is quite simple to fix this if you just want to check or unwrap message
s contents, I just need to make it a public item.
But it's currently not possible to change it from the implementation of the trait.
Btw if you are trying to overwrite the default input events, I wanna tell you that I have merged a PR(#75 ) to give a much more ergonomic API for better overwriting the defaults. If you give me a couple of days, I will get both of the above completed.
Thanks. I'll try to use the native API.
Ok, I just pushed a patch (#91) which should solve this issue. Can you just bring minus as a dependency from that branch and check if everything works, then we can close this.
There we go then.... I will make a patch release from that branch by today.
Hi @dalance. Sorry I was busy for a while but I completed all the stuff that were needed in the native inputs API and it's ready for use. I will make out a release tomorrow with all these updates.
Thanks.
I tried to use the native input API, but HashedEventRegister::default()
seems to be empty.
Should I add all input event by myself?
You need to call generate_default_bindings()
on the HashedEventRegister
. I missed it in the docs but the upcoming releases have it.
OK. It works fine.
I think get_key_event
method may be useful.
I want to add some alias key bindings, but copy and paste of callback implementation is required.
input_register.add_key_events(&["c-v", "f", "c-f"], |_, ps| {
InputEvent::UpdateUpperMark(ps.upper_mark.saturating_add(ps.rows - 1))
});
If the existing callback can be got, I can avoid the duplication.
input_register.add_key_events(&["c-v", "f", "c-f"], input_register.get_key_event("pagedown"));
Hey @dalance sorry for the late reply, it's actually easy to get the above done because there is already a HashedEventRegister::get()
function which returns the callback associated with an event. It's just that it isn't public. I will get it done by today/tomorrow.
Hi @dalance sorry I was out for awhile but I wanna share you why I didn't make a patch on the basis of my previous comment. Actually there are layers that minus adds over the crossterm
event API which aren't public. So to get a function out of the HashedEventRegister
isn't as easy as I mentioned in my previous comment. I am currently exploring on what can be done to get this feature. I will get back to you as I get some results.
Describe the bug
I want to add a bit change to
DefaultInputClassifier
to customize keybinding. So I copiedDefaultInputClassifier
to myCustomInputClassifier
. But it can't be compiled.To Reproduce
The error message is below:
Expected behavior
Changing
message
topublic
or adding an API which has the same behavior asmessage.is_some()
.