Totally misread the code in the Action_keys::act method -- the code actually
reverse sends events in an up condition. Still, keeping the C++11 iteration and
improving by using boost::adaptors::reverse.
Double underbars are reserved for the compiler and system, so we shouldn't use
them for header guards. Additionally, remove a bunch of these line breaks.
Lots of cross-translation unit messes in here cleaned up finally. This should be
the last change necessary to clean up these refs between translation units.
This is the first half of some major rework of the g13d codebase to make things
a bit more manageable. This splits out a great deal of stuff from helper.h into
separate translation units, and also breaks out a great deal of the g13.h header
into separate translation units as well.
Doing this saves in compilation time as we make changes to the system, and also
helps to clean up a whole bunch of leaking symbols.
Since we start from udev/systemd these days, we should exit when we don't have
any more devices to manage, and let udev/systemd manage things when a new one is
connected.
Migrate to C++11 iteration and clean up the mess of code that this was
originally with a single call to send_event and a proper use of a ternary for
logging.
The sizeof was actually using the size of the statically allocated name instead
of the size of the destination. In practice, it's not a problem, but still, it
should be fixed.
The original code was just throwing away error conditions for write calls to an
fd. Obviously this is bad, but really, we should probably be using an ostream
instead of a raw file handle here. For now, deal with the warning by checking
the result for errors, at least, and later we'll refactor to use ostream
properly.
This starts to make g13d more automatic. Instead of requiring manual
intervention or automatic starts on system start, this will allow udevd to
automatically trigger g13d when a g13 is plugged in.
There's still a bug in g13d where if the device falls off the USB chain g13d
won't exit, though, but this is a good start.
This preps us for proper system installs to distributions, finding depending
libraries, and allowing us to build the foundation for the GUI and support
tooling next.
The plan is to run g13d as a system daemon managed by systemd. We'll use the
system-wide input group to control access to the daemon.
- Add a CMakeLists for etc so we can install the udev rules.
- Move the src dir to g13d to disambiguate a bit.
- Update the toplevel Makefile so we can still build the old way (for now).
The original source was under the public domain from "ecraven" off of github --
this places the entire tree under the MIT license. In terms of licensing, this
isn't much different from the public domain, except for the indemnity clauses.
This is in prep to turn on more warnings.
- Stop using libusb_set_debug, according to the deprecation warning for
libusb.
- Return correctly in G13_Manager::run
- Fix the ostream logging helper to return an ostream instead of just
returning whatever the last expression was.
This cleans things up significantly in the source tree and makes this easier to
manage longer term. In the next few commits, we'll migrate the build to CMake in
prep for packaging support.
- Move bindings into bindings
- Move system configs and misc files into etc
- Move LCD apps into contrib/
- Move all source files into srcs
- Rename helper extensions to match GNU extension naming, fix the #includes as
well
- Adjust Makefile to be less verbose and more programmatic