Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Keychron HE keyboards #307

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
69c807e
Input: xpad - improve name of 8BitDo controller 2dc8:3106
lbschenkel Jan 4, 2023
651a256
Input: xpad - add support for 8BitDo Ultimate bluetooth/hall effect v…
jdarn Apr 12, 2023
6d8bcec
Input: xpad - add support for wooting two he (arm)
ProjectSynchro Jun 28, 2023
4fce6ca
Input: xpad - add support for SCUF Instinct
WaferMouse Jul 2, 2023
7d2f171
Input: xpad - add Black Shark Green Ghost controller support
Nov 22, 2023
3880e06
Input: xpad - add Hori Racing Wheel Overdrive for Xbox Series X
Kikismine Oct 8, 2024
d0fb190
Input: xpad - add support for Nacon Pro Compact Model NC7271
javichz Oct 8, 2024
b99fe36
Input: xpad - add support for Xbox ONE liquid metal controller
laundrei Oct 8, 2024
d6ec2c8
Input: xpad - add USB ID for Nacon Revolution5 Pro
StMartin81 Oct 1, 2024
cdb911d
Input: xpad - added Turtle Beach Recon support
treus Nov 26, 2022
1a6a0ae
Input: xpad - add support for Nacon Evol-X Xbox One Controller
Matheos96 Dec 20, 2024
226caa7
Input: xpad - add support for PDP Mirror's Edge controller
Flatfire Nov 12, 2024
1292201
Input: xpad - add support for Thrustmaster ESWAP X2 ELDEN RING
fpetros1 Nov 17, 2024
c981866
xpad: print received packets if DEBUG_VERBOSE
dantob May 9, 2016
13f1c3b
add code to enable debug outputs
paroj Jul 5, 2015
4c5e998
add README.md
paroj Jun 24, 2015
52d580b
add stress_urb_out.sh
paroj Sep 27, 2015
76d4a5e
add PR template
paroj Dec 8, 2019
a185f88
add CI build
paroj Sep 5, 2022
5e751f7
input: xpad - Switch to workqueue for xpad360w button poweroff
DD3Boh Oct 22, 2022
83ec36a
Support KEY_RECORD for 8BitDo Pro 2...for Xbox
lbschenkel Jan 9, 2023
e3cafc2
Input: xpad - initialize 360 controllers
Oblomov Aug 14, 2021
5eaa115
Input: xpad - add support for GHL Xbox One controller
dynamix1337 Oct 22, 2022
65a9164
enable compilation on pre 6.1 kernels
paroj Oct 9, 2024
af6ff9b
Input: xpad - added unofficial Xbox 360 wireless receiver clone
niltonperimneto Jan 6, 2025
448c2ac
Add support for Keychron HE keyboards
Cryowatt Jan 12, 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
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!--
If you are adding support for a new generic xpad controller it is sufficient
to update the xpad_table[] array.
The type will be auto-detected in xpad_probe().
Updating the xpad_device[] array is only needed if the controller requires
additional flags like DANCEPAD_MAP_CONFIG to work.

If you are updating any of the above tables, make sure you keep the sorted!

To get attribution for your work when this goes upstream, make sure to use
a real name and a real email address as per:
https://www.kernel.org/doc/html/v4.10/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin
-->
19 changes: 19 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI Build
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
linux:
runs-on: ubuntu-22.04
steps:
- name: Install Dependencies
run: |
sudo apt update
sudo apt install -y dkms
- uses: actions/checkout@v2
- name: Build
run: |
sudo ln -s `pwd` /usr/src/xpad-0.4
sudo dkms install -m xpad -v 0.4
95 changes: 95 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/O5O514FGIG)

# Updated Xpad Linux Kernel Driver
Driver for the Xbox/ Xbox 360/ Xbox 360 Wireless/ Xbox One Controllers

This driver includes the latest changes in the upstream linux kernel and additionally carries the following staging changes:

* support for more compatible devices
* support for xbox360 class controllers, that need initialisation
* support Guitar Hero Live xbox one controller

## Xbox One Controllers
This driver is only used if you connect the controller via USB.

**Connecting via Bluetooth**
If you get past the pairing issues, the controller will operate in the [generic-HID bluetooth profile](https://en.wikipedia.org/wiki/List_of_Bluetooth_profiles#Human_Interface_Device_Profile_(HID)).
The xpad driver will not be used.

**Connecting via XBox One Wireless Adapter (WiFi)**
The adapter needs daemon in userspace, see: [medusalix/xow](https://github.com/medusalix/xow)
Opinion: rather get a controller that supports bluetooth.


# Installing
```
sudo git clone https://github.com/paroj/xpad.git /usr/src/xpad-0.4
sudo dkms install -m xpad -v 0.4
```
# Updating
```
cd /usr/src/xpad-0.4
sudo git fetch
sudo git checkout origin/master
sudo dkms remove -m xpad -v 0.4 --all
sudo dkms install -m xpad -v 0.4
```
# Removing
```
sudo dkms remove -m xpad -v 0.4 --all
sudo rm -rf /usr/src/xpad-0.4
```
# Usage
This driver creates three devices for each attached gamepad

1. /dev/input/js**N**
* example `jstest /dev/input/js0`
2. /sys/class/leds/xpad**N**/brightness
* example `echo COMMAND > /sys/class/leds/xpad0/brightness` where COMMAND is one of
* 0: off
* 1: all blink, then previous setting
* 2: 1/top-left blink, then on
* 3: 2/top-right blink, then on
* 4: 3/bottom-left blink, then on
* 5: 4/bottom-right blink, then on
* 6: 1/top-left on
* 7: 2/top-right on
* 8: 3/bottom-left on
* 9: 4/bottom-right on
* 10: rotate
* 11: blink, based on previous setting
* 12: slow blink, based on previous setting
* 13: rotate with two lights
* 14: persistent slow all blink
* 15: blink once, then previous setting
3. the generic event device
* example `fftest /dev/input/by-id/usb-*360*event*`

# Debugging
As a regular unpriveledged user

Setup console to display kernel log.
`dmesg --level=debug --follow`

Open a new console and access the device with jstest.
`jstest /dev/input/jsX`

Interact with the device and observe that data packets recieved from device are printed to kernel log.
```
[ 3968.772128] xpad-dbg: 00000000: 20 00 b5 0e 00 00 00 00 00 00 0c 03 04 fd 6c 01 40 fe 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3968.772135] xpad-dbg: 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3968.804137] xpad-dbg: 00000000: 20 00 b6 0e 00 00 00 00 00 00 0c 03 04 fd 6c 01 fc fd 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3968.804145] xpad-dbg: 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3969.152120] xpad-dbg: 00000000: 20 00 b7 0e 00 00 00 00 00 00 0c 03 04 fd 6c 01 b8 fd 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3969.152129] xpad-dbg: 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
```

Save dmesg buffer and attach to bug report, don't forget to describe button sequences in bug report.
`dmesg --level=debug > dmesg.txt`

Ctrl+C to close interactive console sessions when finished.

# Sending Upstream

1. `git format-patch --cover-letter upstream..master`
2. `git send-email --to xxx *.patch`
10 changes: 10 additions & 0 deletions stress_urb_out.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
# stress test irq_urb_out. provokes URB request dropping.
# script by Laura Abbott
# see: http://www.spinics.net/lists/linux-input/msg40477.html

while true; do
for i in $(seq 0 5); do
echo $i > /sys/class/leds/xpad0/subsystem/xpad0/brightness
done
done
Loading