Skip to content

Commit

Permalink
fix(AllyX): Add Ally X Support
Browse files Browse the repository at this point in the history
TODO:
- Rumble
- CC/AC/Paddles
  • Loading branch information
pastaq committed Jul 27, 2024
1 parent b545cd9 commit 4df5646
Show file tree
Hide file tree
Showing 22 changed files with 1,260 additions and 54 deletions.
4 changes: 2 additions & 2 deletions rootfs/usr/share/inputplumber/capability_maps/ally_type1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mapping:
- keyboard: KeyF16
target_event:
gamepad:
button: Guide #Select
button: Guide
- name: Control Center (Long)
source_events:
- keyboard: KeyLeftCtrl
Expand All @@ -32,7 +32,7 @@ mapping:
- keyboard: KeyProg1
target_event:
gamepad:
button: QuickAccess #Start
button: QuickAccess
- name: Armory Crate (Long)
source_events:
- keyboard: KeyF17
Expand Down
57 changes: 57 additions & 0 deletions rootfs/usr/share/inputplumber/devices/50-rog_ally_x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
# Schema version number
version: 1

# The type of configuration schema
kind: CompositeDevice

# Name of the composite device mapping
name: ASUS ROG Ally X

# Only allow a single source device per composite device of this type.
single_source: false

# Only use this profile if *any* of the given matches matches. If this list is
# empty, then the source devices will *always* be checked.
# /sys/class/dmi/id/product_name
matches:
- dmi_data:
board_name: RC72LA
sys_vendor: ASUSTeK COMPUTER INC.

# One or more source devices to combine into a single virtual device. The events
# from these devices will be watched and translated according to the key map.
source_devices:
- group: gamepad
hidraw:
vendor_id: 0x0b05
product_id: 0x1b4c
interface_num: 5
- group: gamepad
unique: false
blocked: true
evdev:
name: "{ASUSTeK Computer Inc. N-KEY Device, Asus Keyboard}"
handler: event*
phys_path: usb-0000:64:00.3-2/input5
#- group: keyboard
# unique: false
# evdev:
# name: Asus Keyboard
# phys_path: usb-0000:64:00.3-2/input[0-2]
- group: imu
iio:
name: bmi323-imu
mount_matrix:
x: [-1, 0, 0]
y: [0, 0, -1]
z: [0, 1, 0]

# The target input device(s) that the virtual device profile can use
target_devices:
- xbox-elite
- mouse
- keyboard

# The ID of a device event mapping in the 'event_maps' folder
capability_map_id: aly1
38 changes: 20 additions & 18 deletions rootfs/usr/share/inputplumber/schema/capability_map_v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,41 +260,43 @@
"button": {
"type": "string",
"enum": [
"South",
"East",
"North",
"West",
"Start",
"Select",
"Guide",
"QuickAccess",
"QuickAccess2",
"Keyboard",
"Screenshot",
"DPadUp",
"C",
"DPadDown",
"DPadLeft",
"DPadRight",
"DPadUp",
"East",
"Guide",
"Keyboard",
"LeftBumper",
"LeftTop",
"LeftTrigger",
"LeftPaddle1",
"LeftPaddle2",
"LeftPaddle3",
"LeftStick",
"LeftStickTouch",
"LeftTouchpadTouch",
"LeftTop",
"LeftTouchpadPress",
"LeftTouchpadTouch",
"LeftTrigger",
"North",
"QuickAccess",
"QuickAccess2",
"RightBumper",
"RightTop",
"RightTrigger",
"RightPaddle1",
"RightPaddle2",
"RightPaddle3",
"RightStick",
"RightStickTouch",
"RightTop",
"RightTouchpadPress",
"RightTouchpadTouch",
"RightTouchpadPress"
"RightTrigger",
"Screenshot",
"Select",
"South",
"Start",
"West",
"Z"
]
},
"trigger": {
Expand Down
3 changes: 2 additions & 1 deletion src/drivers/lego/event.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Events that can be emitted by the Steam Deck controller
/// Events that can be emitted by the Legion Go controller
#[derive(Clone, Debug)]
pub enum Event {
Button(ButtonEvent),
Expand Down Expand Up @@ -157,3 +157,4 @@ pub enum StatusEvent {
RightControllerMode0(StatusInput),
RightControllerMode1(StatusInput),
}

1 change: 1 addition & 0 deletions src/drivers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ pub mod iio_imu;
pub mod lego;
pub mod opineo;
pub mod steam_deck;
pub mod xpad_uhid;
4 changes: 2 additions & 2 deletions src/drivers/opineo/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ impl Driver {
//log::trace!("---- End Report ----");

// Update the state
let old_dinput_state = self.update_touchpad_state(input_report);
let old_state = self.update_touchpad_state(input_report);

// Translate the state into a stream of input events
let events = self.translate_touch(old_dinput_state);
let events = self.translate_touch(old_state);

Ok(events)
}
Expand Down
Loading

0 comments on commit 4df5646

Please sign in to comment.