summaryrefslogtreecommitdiffstatshomepage
Commit message (Collapse)AuthorAgeFilesLines
* Consistency: Make default display a const char *Gravatar Antti K2014-07-302-7/+7
| | | | | | | 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.
* Minor spacing and arrangementGravatar Antti K2014-07-301-10/+7
|
* Prune includesGravatar Antti K2014-07-301-2/+0
| | | | | Since XKBlib pulls in all of our other X dependencies, there's no need to separately `#include` them.
* Simplify result printingGravatar Antti K2014-07-301-26/+14
| | | | | | | | | 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.
* Conciser global-description commentGravatar Antti K2014-07-301-6/+1
|
* Move keysym length constant to where neededGravatar Antti K2014-07-301-1/+1
| | | | Easier to read `main` when this state isn't there.
* Indentation and spacing fixesGravatar Antti K2014-07-301-15/+15
|
* Clarify key state buffer handlingGravatar Antti K2014-07-301-15/+22
| | | | | | | | | | 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`.
* Setup buffers only once necessaryGravatar Antti K2014-07-301-4/+3
| | | | | This also somewhat clarifies the relationships between the `char` arrays and the pointers to them.
* Separate variables that have opt-set valuesGravatar Antti K2014-07-301-4/+5
| | | | Simpler to read. Also makes it clearer what the default values are.
* Scope temporary variable (for swapping) further inGravatar Antti K2014-07-301-5/+5
| | | | Less to remember when reading.
* Clean up argument handlingGravatar Antti K2014-07-301-10/+4
| | | | Easier on the eyes this way.
* More explicit name for usage printer functionGravatar Antti K2014-07-301-3/+3
|
* Remove globals in favour of arg passingGravatar Antti K2014-07-301-11/+10
| | | | | | | | 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.
* Convert single-line comments to C99Gravatar Antti K2014-07-301-9/+9
|
* Document origin and inspiration in a separate fileGravatar Antti K2014-07-302-10/+18
| | | | This keeps source separate from history.
* Rename stringification functionGravatar Antti K2014-07-301-4/+3
| | | | | 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`.
* Replace deprecated XKeycodeToKeysymGravatar Antti K2014-07-301-1/+2
| | | | | | ...with XKB's equivalent. `-Wall` without warnings, yey.
* Shorter struct initGravatar Antti K2014-07-301-4/+1
| | | | Somewhat more readable this way.
* Nicer constant formattingGravatar Antti K2014-07-301-5/+3
|
* Use nanosecond parameterGravatar Antti K2014-07-301-4/+4
| | | | Might as well expose that precision to the user.
* Use nanosleep instead of usleepGravatar Antti K2014-07-292-5/+11
| | | | `usleep` is removed from POSIX C11.
* Convert BIT macro to inlined functionGravatar Antti K2014-07-291-1/+3
| | | | Inlined just like a macro, but has typechecking to prevent bloopers.
* Remove compilation instructions from source fileGravatar Antti K2014-07-291-1/+0
| | | | The `compile`-script already documents this sufficiently.
* Use C99 booleansGravatar Antti K2014-07-291-7/+4
| | | | No need for TRUE/FALSE macros anymore.
* Convert simple macros to C99 constantsGravatar Antti K2014-07-292-9/+9
| | | | Constants are type-checked; macros aren't.
* Gitignore executable outputGravatar Antti K2014-07-291-0/+1
|
* Print defaults in usageGravatar Antti K2014-07-291-5/+6
|
* Fix pluralisation in usageGravatar Antti K2014-07-291-2/+2
|
* Operator spacingGravatar Antti K2014-07-291-18/+18
|
* Clarify delay microseconds usageGravatar Antti K2014-07-291-2/+2
|
* Fix indentationGravatar Antti K2014-07-291-68/+68
| | | | | Consistent 4-space everywhere. There were previously either 2 or 3, sometimes funky.
* Clearer variable nameGravatar Antti K2014-07-291-3/+3
|
* Simplify global initialisationGravatar Antti K2014-07-291-4/+1
|
* Clarify how-to-compile commentGravatar Antti K2014-07-291-1/+1
|
* Simplify usage outputGravatar Antti K2014-07-291-7/+5
|
* Rebrand to xkbcatGravatar Antti K2014-07-262-13/+9
| | | | | Having taken all reasonable measures to reach the author, I'll rename to avoid confusion.
* Clean upGravatar Antti K2014-07-261-3/+2
| | | | | Stop compiler complaining about implicit usleep with explicit include. Neater variable declaration-initialisation on one line.
* Neater formatGravatar Antti K2014-07-261-3/+2
| | | | No need for brackets.
* Remove modifier handlingGravatar Antti K2014-07-261-144/+11
| | | | | | I only want to use this for naming which physical keys I press, so having different output when modifiers are pressed would be bad. Also, I can postprocess the data.
* InitGravatar Antti K2014-07-262-0/+272
Straight from https://www.eigenheimstrasse.de/~ben/keyspeedapplet/xspy.c