Hacker News new | ask | show | jobs
by FattiMei 23 days ago
A minimal X11 application that prints state and keycode on key press. I needed the state for special function keys like Alt-GR, but I didn't want to search the web for it.

Originally started from the st[0] terminal and removed unused functionality, but there was still too much code. Ultimately I followed a minimal example from rosetta code[1].

For the task of removing functionality I developed a small tool based on LLVM that prints the source code location of functions that are unreachable from main, so that I can safely remove them without altering functionality, deleted ~3000 LOC in a couple of minutes[2], still I'm struggling with integrating the tool with cmake

[0] https://st.suckless.org/ [1] https://rosettacode.org/wiki/Window_creation/ [2] https://github.com/FattiMei/modmask

1 comments

Is st like xev but fancier?
st is a terminal emulator, but you are right in saying this could be replaced by xev. I just have fancier output and I'm only looking at keyboard events