Conversation
kernc
left a comment
There was a problem hiding this comment.
Save the indentation hodgepodge, which is absolutely not your fault, it looks good to me, thanks! Just a few comments.
| else { // event device supplied as -d argument | ||
| std::string::size_type i = args.device.find_last_of('/'); | ||
| args.device = (std::string(INPUT_EVENT_PATH) + args.device.substr(i == std::string::npos ? 0 : i + 1)); | ||
| results.push_back((std::string(INPUT_EVENT_PATH) + args.device.substr(i == std::string::npos ? 0 : i + 1))); |
There was a problem hiding this comment.
Could this be made to support multiple -d switches?
Or perhaps comma-separated -d device1,device2,device3?
There was a problem hiding this comment.
Also will take care of in the next week or so.
| for(unsigned long i = 0; i < input_fds.size() && x > 0; i++){ | ||
| int fd = input_fds[i]; | ||
| FD_SET(fd, &read_fds); | ||
| } |
There was a problem hiding this comment.
Could this re-setting snippet be put up, above select() call?
There was a problem hiding this comment.
Yes, should be, but it needs the FD_ZERO line as well. That would also allow de-complecting the initial set setup above the while loop as well.
| { | ||
| if (input_fd != -1) | ||
| close(input_fd); // closing input file will break the infinite while loop | ||
| for(int i = 0; i < input_fds.size(); i++){ |
There was a problem hiding this comment.
Signed int here raises a compilation warning.
There was a problem hiding this comment.
Oops, I'll change that sometime in the afternoon in the next week or so. If you want to make the change, it should be an unsigned long i.
|
I haven't forgotten about this, I just got extremly busy. I'll get the other changes in later. |
|
Would this PR solve this issue for logging from all keyboards or it's something different? #38 |
This can now gracefully handle multiple input devices