steam-deck-tools/SteamController/Settings.cs

89 lines
2.7 KiB
C#
Raw Normal View History

2022-12-02 11:27:45 +01:00
using System.ComponentModel;
using System.Configuration;
namespace SteamController
{
[Category("Settings")]
[TypeConverter(typeof(ExpandableObjectConverter))]
internal sealed partial class Settings : ApplicationSettingsBase
{
public static readonly Settings Default = (Settings)Synchronized(new Settings());
public Settings()
{
PropertyChanged += delegate
{
Save();
};
}
[UserScopedSetting]
[DefaultSettingValue("False")]
[BrowsableAttribute(false)]
public bool EnableSteamDetection
{
get { return ((bool)(this["EnableSteamDetection"])); }
set { this["EnableSteamDetection"] = value; }
}
2022-12-04 20:32:23 +01:00
[UserScopedSetting]
2022-12-02 11:27:45 +01:00
[DefaultSettingValue("Desktop")]
2022-12-04 20:32:23 +01:00
[Description("Default profile used when going back to Desktop mode")]
[BrowsableAttribute(true)]
public ProfilesSettings.Helpers.ProfileName DefaultProfile
2022-12-02 11:27:45 +01:00
{
2022-12-04 20:32:23 +01:00
get { return ((ProfilesSettings.Helpers.ProfileName)(this["DefaultProfile"])); }
set { this["DefaultProfile"] = value; }
2022-12-02 11:27:45 +01:00
}
2022-12-04 20:39:00 +01:00
public enum ScrollMode : int
{
DownScrollUp = -1,
DownScrollDown = 1
}
[UserScopedSetting]
[DefaultSettingValue("DownScrollDown")]
[Description("Scroll direction for right pad and joystick.")]
[BrowsableAttribute(true)]
public ScrollMode ScrollDirection
{
get { return ((ScrollMode)(this["ScrollDirection"])); }
set { this["ScrollDirection"] = value; }
}
public enum SteamControllerConfigsMode
{
DoNotTouch,
Overwrite
}
[UserScopedSetting]
[BrowsableAttribute(true)]
[DefaultSettingValue("Overwrite")]
[Description("This does replace Steam configuration for controllers to prevent double inputs. " +
"Might require going to Steam > Settings > Controller > Desktop to apply " +
"'SteamController provided empty configuration'.")]
public SteamControllerConfigsMode SteamControllerConfigs
{
get { return ((SteamControllerConfigsMode)(this["SteamControllerConfigs"])); }
set { this["SteamControllerConfigs"] = value; }
}
[UserScopedSetting]
[BrowsableAttribute(true)]
[DefaultSettingValue("True")]
[Description("Show Touch Keyboard or CTRL+WIN+O")]
public bool ShowTouchKeyboard
{
get { return ((bool)(this["ShowTouchKeyboard"])); }
set { this["ShowTouchKeyboard"] = value; }
}
2022-12-02 11:27:45 +01:00
public override string ToString()
{
return "";
}
}
}