Skip to content

Troubleshooting

You are probably not in the input group yet (groups should list input), or you need a fresh login. Test the event stream first:

Terminal window
libinput debug-events --show-keycodes

Type a few keys — you should see KEYBOARD_KEY ... pressed lines. If you see *** (-1), you forgot --show-keycodes.

If id <user> lists input but plain id doesn’t, you were added to the group after login — this session (and the service) won’t have it until you log out/in. The installer detects this and writes an sg input systemd drop-in so counting works immediately without re-login; remove it after your next login with systemctl --user revert keyount.

On distros whose util-linux ships newgrp but no sg symlink (e.g. CachyOS), the installer symlinks ~/.local/bin/sg to newgrp — same binary, behaviour picked by name.

Terminal window
journalctl --user -u keyount -n 50

Linux: widget shows 0 but terminal shows data

Section titled “Linux: widget shows 0 but terminal shows data”

Widgets poll every 30s, so give it a moment — or use the KDE popup’s Refresh button (totals are saved within 2s of typing). Also check the widget command uses the full $HOME/.local/bin/wordcount path. For XFCE genmon showing XXX, see the XFCE page.

External keyboards need no config — libinput sees all keyboards.

Low-level keyboard hooks are also used by keyloggers, so some AVs are suspicious of any process installing one — and unsigned PyInstaller executables (keyount.exe) are a common false-positive trigger on their own. This code only counts and is short enough to audit; whitelist the install folder (%LOCALAPPDATA%\keyount) if your AV quarantines it, or use the Python fallback install.

Is the task running? Task Scheduler → Keyount → Run. Also check you are not paused (wordcount.exe today prints PAUSED; Python fallback: wordcount.py today).

In the Python fallback install, pythonw.exe = no console window (used by the task). Use python.exe in a terminal when debugging so errors are visible: python counter_win.py.

Note: holding a key counts repeatedly (each WM_KEYDOWN). The Linux libinput version counts physical presses; totals are therefore not perfectly comparable.

Almost always the Input Monitoring permission — see the install steps. Check the log:

Terminal window
cat ~/.local/share/keyount/counter.log
launchctl list | grep keyount

Permission granted but still 0? The permission is tied to the exact binary. If you switch between the standalone binary and a Python install (or switch Pythons, e.g. Homebrew upgrades), re-add the new binary and restart the agent:

Terminal window
launchctl kickstart -k gui/$(id -u)/com.chandan.keyount

Non-US layouts: keycodes are ANSI positions; letters/digits map correctly on most layouts, punctuation may differ. Autorepeat counts repeatedly (each key-down event), unlike Linux.