This removes code duplication, which will be useful for a subsequent
commit.
Furthermore, we now don’t open X11 connections unnecessarily in some
corner cases.
This adds some code duplication which we might remove in a future
refactoring or not. Depends on whether unifying the parsers actually
makes the code better or not. I suspect it doesn’t :-).
While this is a bit ugly, it makes the log messages end up where they
are supposed to: in the shmlog/stdout in case of i3 and on stdout in
case of utilities such as i3-input
From the code:
Try to use the keysym on the first level (lower-case). In case
this doesn’t make it ambiguous (think of a keyboard layout
having '1' on two different keys, but '!' only on keycode 10),
we’ll stick with the keysym of the first level.
This reduces a lot of confusion for users who switch keyboard
layouts from qwerty to qwertz or other slight variations of
qwerty (yes, that happens quite often).
CPPFLGES, CFLAGS and LDFLAGS should be user variables
We now provide default flags but use I3_*FLAGS flags for our own needed
flags
Also reoder lib flags a bit
open_input_window was slightly different for each of them, so it made no sense
to generalize it (then we would end up with a thin and useless wrapper).
Also, the API changed a bit. There are two functions now, both assume you
already got the keysyms (which is the case for i3 and i3-config-wizard),
one gets the modifier mapping for you (aio_get_mod_mask_for) while the other
assumes you also got that. No roundtrips are required for the latter.
Fixes#491
Before, we assumed XK_Alt_L was in Mod1 and XK_Super_L was in Mod4 (which is
true on most systems). Now we just check if the keycode is in Mod1 or Mod4 and
write the config accordingly.