| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
Finally, a use case for ‘goto’ that I think solves the issue pretty nicely. Not
so evil after all, perhaps.
|
| |
|
|
|
|
|
|
| |
I want to know specifically which keys I use the most that _aren't_ just
letters.
I have a keyboard layout that I like just fine, but I want to know which special
keys I actually use the most.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #5, perhaps fully this time.
It seems non-zero keysym groups work such that if no keysym is defined
in it, the default 0 group's keysym is assumed.
In other words, common keys that would otherwise just be duplicated in
the group's definition, such as Return, Backspace, Delete, Shift, Space,
or the numpad keys, just have no symbol mapped to them at all in the
group (XkbKeycodeToKeysym returns NoSymbol). In such cases, it seems
the receiving program is expected to just fall back to group 0 and read
the keysym from there instead.
This is about XKeycodeToKeysym, but XkbKeycodeToKeysym which we're using
(note the different prefix) seems to function the same:
https://stackoverflow.com/questions/54483276/xkeysymtokeycode-and-keyboard-layout
This seems to be correct with the keyboard layouts I've tested.
- - -
Other Xlib users have replaced XKeycodeToKeysym with XGetKeyboardMapping
instead. These patches to that effect imply XKeycodeToKeysym is
deprecated:
- https://lists.freedesktop.org/archives/piglit/2012-January/001795.html
- https://github.com/ArcticaProject/nx-libs/commit/c79f2d289004d419d8bb76cf8bf731980d40da5d
XkbKeycodeToKeysym is not deprecated though, and seems a much better fit
here than doing heap allocations in a loop, so I'll go with it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
As noted in issue #5, xkbcat would previously not react at all to
keyboard layout changes; it would continue to print keysyms according to
the first keyboard layout X was started with.
Keyboard keysym group changes (i.e. keyboard layout changes) are
listened to as separate events, so if you only use 1 layout, this causes
no performance overhead.
Closes #5.
Thanks to @unxed for very helpful research.
|
| |
|
|
|
|
|
|
| |
This was always invalid input, but there was no special handling, so if
the `-display` option was given in the last position, the value could be
read 1 entry off the end of the `argv` array.
This catches that, and gives an informative error.
|
| |
|
|
| |
Clearer.
|
| |
|
|
| |
Maintenance. No functionality changes.
|
| |
|
|
| |
Saves cycles.
|
| |
|
|
| |
Saves cycles.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This is necessary to guarantee the same API in case future versions of
XInput decide to break backward compatibility in their defaults.
Quoting `man 3 xiqueryversion`:
> Clients are required to use XIQueryVersion instead of
> XGetExtensionVersion if they use XI2 calls. The server may treat a
> client differently depending on the supported version announced by the
> client.
|
| | |
|
| |
|
|
| |
Neater implementation, better performance.
|
| |
|
|
| |
Undoing my unnecessary feature creep.
|
| |
|
|
| |
Ensures that all output is received immediately if it's being piped.
|
| |
|
|
|
|
| |
This is clearer to read, as the amount of state being passed into the
utility function caused more distracting boilerplate than having a
separate function was worth.
|
| |
|
|
| |
Yeah, that did look a bit arcane.
|
| |
|
|
|
| |
Means we need no separate declaration, and it's a lot easier to infer
that the function is pure.
|
| | |
|
| |
|
|
|
|
|
| |
It's seconds since epoch. People tend to type faster than that, but this
is a standard format.
Existing options work the same way.
|
| | |
|
| |
|
|
|
| |
Easier to read. (Compilers would probably optimise the `printf` into a
`puts` anyway.)
|
| |
|
|
|
|
|
| |
Improved comments.
Moved declaration of `printKeyPress` further down to decrease cognitive
load.
|
| | |
|
| |
|
|
|
|
|
| |
Yep, `hostname` is a `const char *` too, even though it's potentially
being assigned to. This is
[unintuitive](http://stackoverflow.com/a/9834194/777586), but
intentional.
|
| | |
|
| |
|
|
|
| |
Since XKBlib pulls in all of our other X dependencies, there's no need
to separately `#include` them.
|
| |
|
|
|
|
|
|
|
| |
There's no need to copy strings around when all we want is to print it
anyway. This is faster and easier to read.
Also made the output format adapt to whether `printKeyUps` is set:
There's no need to print `+` and `-` if all that we're printing is
keydowns anyway.
|
| | |
|
| |
|
|
| |
Easier to read `main` when this state isn't there.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
The typedef makes stuff a little more readable and introduces to the
typechecker that its size must be 32 elements.
Naming clarifications too.
The logic in the inner conditionals was often `fflush`ing even when
there had been no `printf`.
|
| |
|
|
|
| |
This also somewhat clarifies the relationships between the `char` arrays
and the pointers to them.
|
| |
|
|
| |
Simpler to read. Also makes it clearer what the default values are.
|
| |
|
|
| |
Less to remember when reading.
|
| |
|
|
| |
Easier on the eyes this way.
|
| | |
|
| |
|
|
|
|
|
|
| |
Makes the code easier to read: Less state to remember.
This also "accidentally" fixes a bug where `-help` would report the
wrong default value for the `-up` argument if `-up` had was set
previously in the same command.
|
| | |
|
| |
|
|
| |
This keeps source separate from history.
|
| |
|
|
|
| |
It's not just converting a keycode, but also the key's down-state, so
this is a better name. Also converted down-state arg to `bool`.
|
| |
|
|
|
|
| |
...with XKB's equivalent.
`-Wall` without warnings, yey.
|
| |
|
|
| |
Somewhat more readable this way.
|
| | |
|
| |
|
|
| |
Might as well expose that precision to the user.
|
| |
|
|
| |
`usleep` is removed from POSIX C11.
|
| |
|
|
| |
Inlined just like a macro, but has typechecking to prevent bloopers.
|
| |
|
|
| |
The `compile`-script already documents this sufficiently.
|
| |
|
|
| |
No need for TRUE/FALSE macros anymore.
|