mirror of
https://github.com/rommapp/grout.git
synced 2026-04-23 06:54:36 +00:00
fix: add GKD Pixel 2 support. Thanks for the assist theycallmeboxy!
This commit is contained in:
@@ -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": {}
|
||||
}
|
||||
@@ -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
|
||||
############################################################
|
||||
|
||||
Reference in New Issue
Block a user