This commit is contained in:
2026-10-27 18:57:14 +01:00
parent f45596a7e3
commit 5410ed2ae5
9 changed files with 258 additions and 178 deletions

View File

@@ -3,7 +3,6 @@
![C++17](https://img.shields.io/badge/C%2B%2B-17-00599C?logo=cplusplus&logoColor=white)
![GTK 4](https://img.shields.io/badge/GTK-4-7FE719?logo=gtk&logoColor=black)
![GLib/GIO](https://img.shields.io/badge/GLib%2FGIO-D--Bus-4A86CF)
![libusb](https://img.shields.io/badge/libusb-1.0-c8a200)
![xkbcommon](https://img.shields.io/badge/xkbcommon-layout--aware-6E4C13)
![i18n](https://img.shields.io/badge/i18n-de%20%7C%20en%20%7C%20es%20%7C%20fr-blueviolet)
![systemd](https://img.shields.io/badge/systemd-user%20service-30D475?logo=systemd&logoColor=white)
@@ -32,7 +31,6 @@ Documentation and source comments are written in English.
- pkg-config
- gettext (for translations, `msgfmt`)
- GTK 4 development files
- libusb 1.0 development files (for the daemon)
- libxkbcommon development files (for the daemon's layout handling)
- GLib/GIO development files (for the GUI ↔ daemon D-Bus channel; `libgtk-4-dev`
already pulls them in, but they are needed for `make daemon` on its own)
@@ -41,11 +39,11 @@ Documentation and source comments are written in English.
```bash
sudo apt update
sudo apt install -y build-essential gettext libgtk-4-dev libusb-1.0-0-dev libxkbcommon-dev libglib2.0-dev
sudo apt install -y build-essential gettext libgtk-4-dev libxkbcommon-dev libglib2.0-dev
```
Afterwards `pkg-config --modversion gtk4`, `pkg-config --modversion libusb-1.0`
and `pkg-config --modversion gio-2.0` should print versions.
Afterwards `pkg-config --modversion gtk4` and `pkg-config --modversion xkbcommon`
should print versions.
## Setting up the project
@@ -181,7 +179,8 @@ The daemon reads G1–G9 from the keyboard and replays the configured action
./gkeymapper-daemon /path/to.conf # or an explicit file
```
- It reaches the keyboard through libusb (raw USB HID, vendor interface 1) and
- It reads the keyboard's vendor interface through the kernel's hidraw
interface (interface 1) and
creates a virtual keyboard via `/dev/uinput`. Both need access for your user;
`make install` ships a udev rule (`TAG+="uaccess"`) for that. On Linux Mint the
device already has such an ACL, otherwise install the rule or add your user to
@@ -391,7 +390,7 @@ shared/keymap.{h,cpp} # layout-aware key lookups (xkbcommon), GUI + daemon
shared/ipc_ids.h # app id + D-Bus names shared by GUI and daemon
daemon/main.cpp # event loop: read G-keys, run the action
daemon/device_tables.{h,cpp} # per-model raw HID report tables (G910)
daemon/g910_device.{h,cpp} # libusb access to the vendor interface
daemon/g910_device.{h,cpp} # hidraw access to the vendor interface
daemon/uinput_keyboard.{h,cpp}# virtual keyboard for "key" mappings
daemon/action.{h,cpp} # dispatch "key" / "command" / "disabled" / "keyhold"
daemon/config_watch.{h,cpp} # inotify watch on mappings.conf (auto-reload)