-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add derive(Debug) for InputEvent #2
Conversation
I am really happy that people are using my library. It makes me even happier that people are contributing to it. There's no real reason to not have the Debug trait. It's just that I never really needed it. But its good to have it. But the patch is incorrect because the src/enums.rs file should not be modified directly but should be generated using tools/make-event-names.py. I have not documented this part anywhere so that's my fault. For this patch please update the make-event-names.py (the functions print_enums and print_event_code) and send the patch as is. I was planning to bump libevdev soon, I'll regenerate the src/enums.rs file then. |
@ndesh26: Thanks for your reply. I'm looking into
and then exits with exit-code 2. I feel a bit uneasy creating a PR that I can't test, so I'd like to get the script running on my end, if possible. Do you have an idea what's going wrong? |
To generate the file we need to provide the headers that are part of libevdev. Try with the following command:-
|
Yup, that works, thanks. |
7aaabb9
to
56713ce
Compare
I've updated the PR. Now it doesn't modify I think a good way to deal with generating code that is checked into the repo is this: whenever a PR changes either Currently the two seem to be already out of sync. Or the script is non-deterministic. I'll probably look into this further, but I wanted to get your input. What do you think? |
AFAIK the script is deterministic. The out of sync part was my fault as I had updated the libevdev without updating the We could have a git hook to check if a change in |
I'm not 100% sure, but I think you can't commit git hooks. So it's just something that you can put into your repo on your local machine. But ideally we would run a check like that on CI. I think it's nice to have a commit history with a separate commit for just bringing |
56713ce
to
016b9e1
Compare
Alright, now I've updated the PR. It compiles and is ready to merge from my side. |
@ndesh26: Awesome, thanks a lot for merging all the PRs! |
This PR adds
#[derive(Debug)]
attributes toInputEvent
and to all types that could be contained in anInputEvent
. Is there a reason why this is not wanted?Thanks for the nice library!