Skip to content

Commit

Permalink
feat(CapabilityMap): add capability mapping and translation support
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowApex committed Mar 8, 2024
1 parent ed05794 commit 9e80da2
Show file tree
Hide file tree
Showing 23 changed files with 1,709 additions and 314 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 15 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,28 @@ install: build ## Install inputplumber to the given prefix (default: PREFIX=/usr
$(PREFIX)/share/dbus-1/system.d/$(DBUS_NAME).conf
install -D -m 644 rootfs/usr/lib/systemd/system/$(NAME).service \
$(PREFIX)/lib/systemd/system/$(NAME).service
install -D -m 644 rootfs/usr/share/$(NAME)/devices/steam_deck.yaml \
$(PREFIX)/share/$(NAME)/devices/steam_deck.yaml
install -D -m 644 -t $(PREFIX)/share/$(NAME)/devices/ \
rootfs/usr/share/$(NAME)/devices/*
install -D -m 644 -t $(PREFIX)/share/$(NAME)/schema/ \
rootfs/usr/share/$(NAME)/schema/*
install -D -m 644 -t $(PREFIX)/share/$(NAME)/capability_maps/ \
rootfs/usr/share/$(NAME)/capability_maps/*
install -D -m 644 -t $(PREFIX)/share/$(NAME)/profiles/ \
rootfs/usr/share/$(NAME)/profiles/*

@echo ""
@echo "Install completed. Enable service with:"
@echo "Install completed. Enable service with:"
@echo " systemctl enable --now $(NAME)"

.PHONY: uninstall
uninstall: ## Uninstall inputplumber
rm $(PREFIX)/bin/$(NAME)
rm $(PREFIX)/share/dbus-1/system.d/$(DBUS_NAME).conf
rm $(PREFIX)/lib/systemd/system/$(NAME).service
rm $(PREFIX)/share/$(NAME)/devices/steam_deck.yaml
rm -rf $(PREFIX)/share/$(NAME)/devices/
rm -rf $(PREFIX)/share/$(NAME)/schema/
rm -rf $(PREFIX)/share/$(NAME)/capability_maps/
rm -rf $(PREFIX)/share/$(NAME)/profiles/

##@ Development

Expand All @@ -77,7 +87,7 @@ run: setup debug ## Build and run

.PHONY: clean
clean: ## Remove build artifacts
rm -rf target
rm -rf target dist .cache

.PHONY: format
format: ## Run rustfmt on all source files
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../schema/capability_map_v1.json
# Schema version number
version: 1

Expand All @@ -13,12 +14,49 @@ id: oxp3
# List of mapped events that are activated by a specific set of activation keys.
mapping:
- name: Turbo
from: keyboard
source_capabilities:
- Keyboard:Key:LeftCtrl
- Keyboard:Key:LeftAlt
- Keyboard:Key:LeftMeta
target_capability: Gamepad:Button:Base
source_events:
- keyboard: KeyLeftCtrl
- keyboard: KeyLeftAlt
- keyboard: KeyLeftMeta
target_event:
gamepad:
button: QuickAccess
- name: KB (Short Press)
source_events:
- keyboard: KeyRightCtrl
- keyboard: KeyLeftMeta
- keyboard: KeyO
target_event:
gamepad:
button: Keyboard
- name: Orange Button (Short Press)
source_events:
- keyboard: KeyLeftMeta
- keyboard: KeyD
target_event:
gamepad:
button: Guide
- name: Orange Button (Long Press)
source_events:
- keyboard: KeyLeftMeta
- keyboard: KeyG
target_event:
gamepad:
button: QuickAccess2
- name: Turbo + Orange Button
source_events:
- keyboard: KeyLeftMeta
- keyboard: KeySysrq
target_event:
gamepad:
button: Screenshot
- name: KB + Orange Button
source_events:
- keyboard: KeyRightCtrl
- keyboard: KeyRightAlt
- keyboard: KeyDelete
target_event:
keyboard: KeyF13

# List of events to filter from the source devices
filtered_events: []
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ target_devices:
- mouse
- keyboard

# The ID of a device event mapping in the 'event_maps' folder
event_map_id: oxp2
# The ID of a device event mapping in the 'capability_maps' folder
capability_map_id: oxp2
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ target_devices:
- mouse
- keyboard

# The ID of a device event mapping in the 'event_maps' folder
event_map_id: oxp1
# The ID of a device event mapping in the 'capability_maps' folder
capability_map_id: oxp1
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ target_devices:
- mouse
- keyboard

# The ID of a device event mapping in the 'event_maps' folder
event_map_id: oxp3
# The ID of a device event mapping in the 'capability_maps' folder
capability_map_id: oxp3
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,3 @@ target_devices:
- gamepad
- mouse
- keyboard

# The ID of a device event mapping in the 'event_maps' folder
event_map_id: deck
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,3 @@ target_devices:
- gamepad
- mouse
- keyboard

# The ID of a device event mapping in the 'event_maps' folder
event_map_id: xb360
30 changes: 0 additions & 30 deletions rootfs/usr/share/inputplumber/devices/xbox360.yaml

This file was deleted.

45 changes: 0 additions & 45 deletions rootfs/usr/share/inputplumber/event_maps/onexplayer_type3.yaml

This file was deleted.

Loading

0 comments on commit 9e80da2

Please sign in to comment.