Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
619e161
Feat: Add support for H81 with 0171 PID
DenysMb May 2, 2024
07df636
Runs with Qt 6.7
John-Gee Jun 28, 2024
d7a8237
Add support for RKM75 (Wired and 2.4G)
pespinel Jul 31, 2024
5423f90
Update keymaps
pespinel Jul 31, 2024
75de56a
Support for RKS70
rh-iatanaso Aug 12, 2024
5a9adab
Add the correct keyboard
rh-iatanaso Aug 14, 2024
2bcb9a2
feat: created a default keyboard loader function
randyttruong Dec 25, 2024
75635c2
Merge pull request #1 from randyttruong/chore/default-prof-loader-fn
BachenbergS Sep 4, 2025
5a551e7
Merge pull request #2 from John-Gee/master
BachenbergS Sep 4, 2025
cb2c3b6
* removed build from git
BachenbergS Sep 4, 2025
28d98f0
fix von Chatgpt + Linter
BachenbergS Sep 4, 2025
07713d6
fixes for udev_write - v1
BachenbergS Sep 4, 2025
4cf7eff
added udevWriterProcess
BachenbergS Sep 4, 2025
52e2ec6
Fenster sollte jetzt geschlossen werden
BachenbergS Sep 4, 2025
0caf4c2
Revert "Fenster sollte jetzt geschlossen werden"
BachenbergS Sep 4, 2025
b1540c7
Merge pull request #3 from BachenbergS/feature/updates-from-others
BachenbergS Sep 4, 2025
8f44686
Merge pull request #4 from DenysMb/master
BachenbergS Sep 4, 2025
61c05f2
Merge pull request #5 from iatanasov/RKS70_support
BachenbergS Sep 4, 2025
ef09ca0
Merge pull request #6 from pespinel/rkm75
BachenbergS Sep 4, 2025
68116ab
* added new Key_102ND
BachenbergS Sep 8, 2025
d9bc9bf
fixed double bIndex
BachenbergS Sep 15, 2025
5cb13e6
* fixed Wayland crash
BachenbergS Sep 17, 2025
aa103c8
Translate german comments to english
BachenbergS Sep 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Thumbs.db
/.qmake.cache
/.qmake.stash
CMakeFiles/
build/

# qtcreator generated files
*.pro.user*
Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,15 @@ add_compile_definitions(
DEFAULT_ACCENT_BLUE=115
)

find_package(Qt6 6.5 COMPONENTS Quick Svg REQUIRED) # QTBUG-55199
find_package(Qt6 COMPONENTS Quick Svg Widgets REQUIRED)

# Qt Policy setzen, damit die Warnung verschwindet
qt_policy(SET QTP0001 NEW)

set(HIDAPI_WITH_LIBUSB FALSE)
set(BUILD_SHARED_LIBS FALSE)

add_subdirectory(hidapi)
add_subdirectory(src)

target_link_libraries(rangoli PRIVATE Qt6::Widgets)
189 changes: 189 additions & 0 deletions LINUX_PERMISSIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
# Linux Permissions for Rangoli Keyboard Mapper

## Problems and Solutions

### Problem 1: Segmentation Fault due to HID Permissions

On Linux, Rangoli may crash with a "Segmentation fault (core dumped)" when running without sudo while trying to access HID devices (keyboards). This happens because regular users don't have direct access to HID devices by default.

### Problem 2: Qt6 Wayland Menu Crash

On some Linux systems running Wayland, Rangoli may crash due to a Qt6 bug in menu creation. The program automatically detects this and falls back to X11 backend.

## Solution

The solution is to install udev rules that grant your user access to Rangoli keyboards without requiring sudo.

### Automatic Installation (Recommended)

1. **Run the installation script:**
```bash
./install-udev-rules.sh
```

2. **Unplug and replug your keyboard** or restart your system.

3. **Rangoli should now work without sudo and automatically handle Wayland compatibility.**

### Manual Installation

If you prefer to install the udev rules manually:

1. **Copy the udev rules:**
```bash
sudo cp udev/99-rangoli-keyboards.rules /etc/udev/rules.d/
sudo chmod 644 /etc/udev/rules.d/99-rangoli-keyboards.rules
```

2. **Reload udev rules:**
```bash
sudo udevadm control --reload-rules
sudo udevadm trigger
```

3. **Add your user to the appropriate group (for SSH access):**
```bash
# Ubuntu/Debian:
sudo usermod -aG plugdev $USER

# Fedora/RHEL/CentOS:
sudo usermod -aG input $USER
```

4. **Log out and log back in** (or restart your system).

5. **Unplug and replug your keyboard.**

## Supported Devices

The udev rules support all Rangoli keyboards with vendor ID `258a`. This includes all currently supported models.

## Troubleshooting

### Rangoli still crashes

1. **Check if udev rules are installed:**
```bash
ls -la /etc/udev/rules.d/99-rangoli-keyboards.rules
```

2. **Check your group membership:**
```bash
groups $USER
```
You should see `plugdev` (Ubuntu/Debian) or `input` (Fedora/RHEL) in the list.

3. **Check if your keyboard is detected:**
```bash
lsusb | grep 258a
```

4. **Restart your system** instead of just unplugging the keyboard.

### For SSH/Remote Access

If you want to use Rangoli over SSH:

1. **Make sure you're in the appropriate group:**
```bash
# Ubuntu/Debian:
groups $USER | grep plugdev

# Fedora/RHEL:
groups $USER | grep input
```

2. **If not, add yourself:**
```bash
# Ubuntu/Debian:
sudo usermod -aG plugdev $USER

# Fedora/RHEL:
sudo usermod -aG input $USER
```

3. **Log out and log back in:**
```bash
exit # End SSH session
# Then reconnect via SSH
```

### Debugging

To check if the udev rules are working:

1. **Monitor udev events:**
```bash
sudo udevadm monitor --property
```

2. **Unplug and replug your keyboard** and observe the output.

3. **Check device properties:**
```bash
# Find your device
lsusb | grep 258a

# Check udev properties (replace X:Y with Bus:Device)
udevadm info -a -p $(udevadm info -q path -n /dev/bus/usb/X/Y)
```

## Technical Details

### What the udev rules do

The [`udev/99-rangoli-keyboards.rules`](udev/99-rangoli-keyboards.rules) file contains rules that:

1. **Identify all HID devices with vendor ID 258a**
2. **Add TAG+="uaccess"** - Grants access for physically present users
3. **Set GROUP="plugdev"/"input", MODE="660"** - Enables access for group members (important for SSH)

### Why 99-rangoli-keyboards.rules?

- **99-** ensures our rules run after standard system rules
- **rangoli-keyboards** makes the file's purpose clear
- **.rules** is the required extension for udev rules

### Security Considerations

This solution:
- ✅ Only grants access to Rangoli keyboards (vendor ID 258a)
- ✅ Requires physical access or plugdev group membership
- ✅ Follows Linux security standards
- ✅ Avoids the need to run as root

## Alternative Solutions

### Temporary Solution (not recommended)

You can temporarily run Rangoli with sudo:
```bash
sudo ./build/src/rangoli
```

**Disadvantages:**
- Security risk (program runs as root)
- Inconvenient (requires sudo every time)
- Can cause file permission issues

### System-wide Permission (not recommended)

You could grant all users access to all HID devices, but this is a security risk.

## Support

If you continue to have problems:

1. **Check system logs:**
```bash
journalctl -f
```

2. **Run Rangoli in debug mode** (if available)

3. **Create an issue** with the following information:
- Linux distribution and version
- Output of `lsusb | grep 258a`
- Output of `groups $USER`
- Contents of `/etc/udev/rules.d/99-rangoli-keyboards.rules`
- Relevant system logs
Loading