fix: add GKD Pixel 2 support. Thanks for the assist theycallmeboxy!

This commit is contained in:
Brandon T. Kowalski
2026-04-06 00:35:10 -04:00
parent b1dc81e6a7
commit e493b9d037
3 changed files with 41 additions and 1 deletions
+5
View File
@@ -21,6 +21,7 @@ const (
DeviceMiyooMini Device = "MIYOOMINI"
DeviceMiyooFlip Device = "MIYOOFLIP"
DeviceTrimui Device = "TRIMUI"
DevicePixel Device = "PIXEL"
DeviceUnknown Device = "UNKNOWN"
)
@@ -38,6 +39,8 @@ func DetectDevice() Device {
return DeviceMiyooFlip
case "TRIMUI":
return DeviceTrimui
case "PIXEL":
return DevicePixel
default:
logger.Warn("Unknown Spruce device type", "value", os.Getenv(DeviceType))
return DeviceUnknown
@@ -58,6 +61,8 @@ func GetInputMappingBytesForDevice(device Device) ([]byte, error) {
filename = "input_mappings/miyoo.json"
case DeviceA30:
filename = "input_mappings/a30.json"
case DevicePixel:
filename = "input_mappings/gkd_pixel_2.json"
default:
// TrimUI, Miyoo Flip, and unknown devices use standard SDL controller input
return nil, nil
@@ -0,0 +1,25 @@
{
"keyboard_map": {},
"controller_button_map": {
"0": 5,
"1": 6,
"10": 11,
"11": 1,
"12": 2,
"13": 3,
"14": 4,
"2": 7,
"3": 8,
"4": 14,
"5": 15,
"6": 13,
"9": 9
},
"controller_hat_map": {},
"joystick_axis_map": {},
"joystick_button_map": {
"6": 10,
"7": 12
},
"joystick_hat_map": {}
}
+11 -1
View File
@@ -25,12 +25,22 @@ case "$PLATFORM" in
############################################################
# Brick / SmartPro / SmartProS
############################################################
"Brick" | "SmartPro" | "SmartProS" )
"Brick" | "SmartPro" | "SmartProS")
export LD_LIBRARY_PATH="$CUR_DIR/grout/lib64:$LD_LIBRARY_PATH"
export SPRUCE_DEVICE="TRIMUI"
./grout64
;;
############################################################
# GKD Pixel 2
############################################################
"Pixel2")
export LD_LIBRARY_PATH="$CUR_DIR/grout/lib64:$LD_LIBRARY_PATH"
export SPRUCE_DEVICE="PIXEL"
./grout64
;;
############################################################
# Miyoo Flip
############################################################