enum EInputMode {
	k_EInputModeUnknown = 0;
	k_EInputModeMouse = 1;
	k_EInputModeController = 2;
	k_EInputModeMouseAndController = 3;
}

enum EControllerElementType {
	k_EControllerElementTypeNone = -1;
	k_EControllerElementTypeThumb = 0;
	k_EControllerElementTypeButtonSteam = 1;
	k_EControllerElementTypeJoystickLeft = 2;
	k_EControllerElementTypeButtonJoystickLeft = 3;
	k_EControllerElementTypeJoystickRight = 4;
	k_EControllerElementTypeButtonJoystickRight = 5;
	k_EControllerElementTypeDPad = 6;
	k_EControllerElementTypeButtonA = 7;
	k_EControllerElementTypeButtonB = 8;
	k_EControllerElementTypeButtonX = 9;
	k_EControllerElementTypeButtonY = 10;
	k_EControllerElementTypeButtonSelect = 11;
	k_EControllerElementTypeButtonStart = 12;
	k_EControllerElementTypeButtonTriggerLeft = 13;
	k_EControllerElementTypeButtonTriggerRight = 14;
	k_EControllerElementTypeButtonBumperLeft = 15;
	k_EControllerElementTypeButtonBumperRight = 16;
	k_EControllerElementTypeButtonMacro0 = 17;
	k_EControllerElementTypeButtonMacro1 = 18;
	k_EControllerElementTypeButtonMacro2 = 19;
	k_EControllerElementTypeButtonMacro3 = 20;
	k_EControllerElementTypeButtonMacro4 = 21;
	k_EControllerElementTypeButtonMacro5 = 22;
	k_EControllerElementTypeButtonMacro6 = 23;
	k_EControllerElementTypeButtonMacro7 = 24;
	k_EControllerElementTypeTrackpadCenter = 25;
	k_EControllerElementTypeTrackpadLeft = 26;
	k_EControllerElementTypeTrackpadRight = 27;
	k_EControllerElementTypeMax = 28;
}

message CVirtualControllerElement {
	optional .EControllerElementType type = 1 [default = k_EControllerElementTypeNone];
	optional bool visible = 2;
	optional float x_position = 3;
	optional float y_position = 4;
	optional float x_scale = 5 [default = 1];
	optional float y_scale = 6 [default = 1];
}

message CVirtualControllerLayout {
	optional int32 layout_version = 1;
	optional int32 actionset_id = 2;
	repeated .CVirtualControllerElement elements = 4;
}

message CVirtualControllerLayouts {
	repeated .CVirtualControllerLayout layouts = 1;
	optional .EInputMode input_mode = 2 [default = k_EInputModeUnknown];
}

message CVirtualControllerConfig {
	message Control {
		optional string name = 1;
		optional string icon = 2;
		optional int32 input_source = 3;
		optional int32 input_mode = 4;
		optional int32 input_element = 5;
		optional int32 output_gamepad = 6;
		optional int32 output_keyboard = 7;
		optional int32 output_mouse = 8;
		optional string icon_foreground = 9;
		optional string icon_background = 10;
	}

	message ActionSet {
		optional int32 id = 1;
		optional int32 parent_id = 2;
		optional string name = 3;
		repeated .CVirtualControllerConfig.Control controls = 4;
	}

	optional string name = 1;
	repeated .CVirtualControllerConfig.ActionSet actionsets = 2;
}

message CVirtualControllerLayoutPackage {
	optional uint32 appid = 1;
	optional uint32 revision = 2;
	optional .CVirtualControllerConfig config = 3;
	optional .CVirtualControllerLayouts layouts = 4;
}

message CVirtualControllerGlobalConfig {
	optional bool feedback_enabled = 1;
}

