Add the ITPROTECH MK series (8808) as a third pad family
Confirmed on the MK-09 (8808:660a, 9 keys): the vendor's .NET configurator was decompiled for the wire format and every frame was then written to a real pad and read back. Keys, media keys and multikey sequences are supported; lighting from the command line. The firmware acts on every other output report, so each report is sent twice (as the vendor software does) and every write is verified by reading the key back. The app now keeps one state file per pad and starts with a known layout for a known USB id, and the editor asks the backend whether a binding fits before offering to write it. The actions listener and the udev rule cover every supported vendor. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
20
install.sh
20
install.sh
@@ -22,7 +22,13 @@ BIN="$HOME/.local/bin"
|
||||
DESKTOP="$DATA/applications/macropad.desktop"
|
||||
ICON="$DATA/icons/hicolor/scalable/apps/macropad.svg"
|
||||
RULE="/etc/udev/rules.d/60-macropad.rules"
|
||||
RULE_LINE='KERNEL=="hidraw*", ATTRS{idVendor}=="1189", TAG+="uaccess"'
|
||||
# One line per pad family the app supports. CH57x (1189), SayoDevice (8089),
|
||||
# ITPROTECH MK series (8808). Keep in step with macropad_gui/backends.
|
||||
RULE_LINES=(
|
||||
'KERNEL=="hidraw*", ATTRS{idVendor}=="1189", TAG+="uaccess"'
|
||||
'KERNEL=="hidraw*", ATTRS{idVendor}=="8089", TAG+="uaccess"'
|
||||
'KERNEL=="hidraw*", ATTRS{idVendor}=="8808", TAG+="uaccess"'
|
||||
)
|
||||
|
||||
if [ -t 1 ]; then
|
||||
O=$'\e[38;5;208m'; G=$'\e[32m'; R=$'\e[31m'; B=$'\e[1m'; D=$'\e[2m'; X=$'\e[0m'
|
||||
@@ -191,7 +197,11 @@ fi
|
||||
|
||||
# -------------------------------------------------------------- 4. permission
|
||||
step "Letting the app talk to the pad"
|
||||
if [ -f "$RULE" ] && grep -qF "$RULE_LINE" "$RULE"; then
|
||||
have_all_rules() {
|
||||
[ -f "$RULE" ] || return 1
|
||||
for line in "${RULE_LINES[@]}"; do grep -qF "$line" "$RULE" || return 1; done
|
||||
}
|
||||
if have_all_rules; then
|
||||
ok "permission rule already in place"
|
||||
else
|
||||
say " Linux doesn't let apps write to USB devices by default. This adds one"
|
||||
@@ -199,9 +209,9 @@ else
|
||||
say " ${D}It writes: $RULE${X}"
|
||||
if ask "Add it now? This asks for your password."; then
|
||||
sudo mkdir -p "$(dirname "$RULE")"
|
||||
printf '%s\n' "# MacroPad: let the logged-in user configure 1189:8840 macro pads." \
|
||||
printf '%s\n' "# MacroPad: let the logged-in user configure the macro pads it supports." \
|
||||
"# Must sort before 73-seat-late.rules, which is where uaccess takes effect." \
|
||||
"$RULE_LINE" | sudo tee "$RULE" >/dev/null
|
||||
"${RULE_LINES[@]}" | sudo tee "$RULE" >/dev/null
|
||||
if command -v udevadm >/dev/null; then
|
||||
sudo udevadm control --reload-rules || true
|
||||
sudo udevadm trigger --subsystem-match=hidraw || true
|
||||
@@ -217,7 +227,7 @@ fi
|
||||
for f in /etc/udev/rules.d/*.rules; do
|
||||
[ -e "$f" ] || continue
|
||||
[ "$f" = "$RULE" ] && continue
|
||||
if grep -qiE 'idVendor\}=="1189"' "$f" 2>/dev/null && grep -q uaccess "$f"; then
|
||||
if grep -qiE 'idVendor\}=="(1189|8089|8808)"' "$f" 2>/dev/null && grep -q uaccess "$f"; then
|
||||
base="$(basename "$f")"
|
||||
if [[ ! "$base" < "73-seat-late.rules" ]]; then
|
||||
say " ${D}Note: $f also mentions this pad but is read too late to do"
|
||||
|
||||
Reference in New Issue
Block a user