aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: b2662f5474261fef5d3ecaab3edde76ece709004 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# clak

Another Meccha / mechanical-sound...

## Usage

```sh
$ ./clak <board name>
```

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)