diff options
| author | 2014-08-02 18:13:53 +0200 | |
|---|---|---|
| committer | 2014-08-02 18:15:01 +0200 | |
| commit | ca9105f634badf6071aa6522c23e9219abeed2a8 (patch) | |
| tree | f28ef4e8e53fe84a92952ae947745dd983841d25 | |
| parent | e1e84630314fe01e96e9846078e7557ed2277b83 (diff) | |
| download | xkbcat-ca9105f634badf6071aa6522c23e9219abeed2a8.tar.gz xkbcat-ca9105f634badf6071aa6522c23e9219abeed2a8.zip | |
Document keyState function
Yeah, that did look a bit arcane.
| -rw-r--r-- | xkbcat.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -14,8 +14,12 @@ const bool DEFAULT_PRINT_UP = false; const bool DEFAULT_PRINT_TIME = false; typedef char KbBuffer[32]; + static inline bool keyState(KbBuffer b, int key) { + // Fetch the `key`-th bit from the buffer. return b[key/8] & (1<<(key%8)); + // This is because XQueryKeymap just writes a bit per key into the buffer. + // Assuming 8-bit chars here, of course. } int printUsage() { |
