summaryrefslogtreecommitdiffstatshomepage
path: root/xkbcat.c
diff options
context:
space:
mode:
authorGravatar Antti K2014-07-29 22:53:05 +0200
committerGravatar Antti K2014-07-30 01:11:08 +0200
commite82e92f3e802028200a4f15ffca24b51aa8acda1 (patch)
treecc01bc678093e8463314baf4dd142db4fa6e25c1 /xkbcat.c
parenta9babb7e82b567f55b3674ec093cdbf4d29442a3 (diff)
downloadxkbcat-e82e92f3e802028200a4f15ffca24b51aa8acda1.tar.gz
xkbcat-e82e92f3e802028200a4f15ffca24b51aa8acda1.zip
Move keysym length constant to where needed
Easier to read `main` when this state isn't there.
Diffstat (limited to 'xkbcat.c')
-rw-r--r--xkbcat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xkbcat.c b/xkbcat.c
index 9cc5aba..3a6d9ea 100644
--- a/xkbcat.c
+++ b/xkbcat.c
@@ -23,7 +23,6 @@ typedef char KbBuffer[32];
static inline bool keyState(KbBuffer c, int key) {
return ( c[key/8] & (1<<(key%8)) );
}
-const int KEYSYM_STRLEN = 64;
char * keyPressToString(Display * disp, int code, bool down);
@@ -101,6 +100,7 @@ int main(int argc, char * argv[]) {
*/
char * keyPressToString(Display * disp, int code, bool down) {
+ const int KEYSYM_STRLEN = 64;
static char * str, buf[KEYSYM_STRLEN + 1];
KeySym keysym = XkbKeycodeToKeysym(disp, code, 0, 0);
if (NoSymbol == keysym) return "";