# clak Another Meccha / mechanical-sound... ## Usage ```sh $ ./clak ``` That's it. ## Goals - [ ] Cross-platform - [x] Windows - Keyboard hook: Low-level win32 hook - Audio: PlaySound (async mode) win32 - [ ] Linux - Keyboard hook: X11 + XInput2 extensions (Limitation: don't think Wayland is possible at the moment due to keyboard hook perms) - Audio: Half complete. Would like to clean up and even not use SDL if possible - looking to use ALSA (just play it as separate streams, let the system mix with dmix/pipewire/etc) - kinda sucks, might see if can mix ourselves but adds quite some complication - [ ] macOS - Keyboard hook: Planned - IOKit (on higher versions of macOS, need to turn on accessibility when prompted) - Audio: Planned - TBD, thinking of trying out ObjC from C with NSSound - if we go our own mixer route could even look into CoreAudio (unlikely though) - [ ] BSD - All TBD (never really used) - [ ] SerenityOS - All TBD (not sure how to hook in with their C++ APIs) - [ ] Dynamically extensible - Load 'board'/plugins via .dll/.so/.dylib - [ ] Allow passing of keystrokes in standard format (example usage: TTS) - [ ] Warn user if we are capturing keystrokes to the plugin ## Requirements - Windows: should work right away - Linux: specific requirements below - Xlib (Fedora: `libX11`) - XI2 (Fedora: `libXi`) - SDL2 (Fedora: `SDL2`) - SDL\_mixer 2 (Fedora: `SDL2_mixer`) ## Building ### Requirements You need: - C compiler (tested with gcc) - make - xxd For Windows specifically: - (Might have other ways, but I've only tested this way) - MinGW-w64 (via MSYS2) - `mingw-w64-x86_64-make` - `mingw-w64-x86_64-gcc` - Note to use `mingw32-make` in place of just `make` For Linux specifically: - Xlib (Fedora: `libX11-devel`) - XI2 dev (Fedora: `libXi-devel`) - SDL2 dev (Fedora: `SDL2-devel`) - SDL\_mixer 2 dev (Fedora: `SDL2_mixer-devel`) ### Compiling ```sh # deps copy-paste for fedora $ dnf install libX11-devel libXi-devel SDL2-devel SDL2_mixer-devel $ git clone https://git.windblume.net/pub/nick/clak $ make ``` To build the boards: ```sh $ cd board $ make ``` ## Licence [BSD 2-Clause](./LICENCE)