mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 16:43:52 +09:00
Move all OsuGame events to OsuAction
This commit is contained in:
@ -12,6 +12,10 @@ namespace osu.Game.Input
|
|||||||
{
|
{
|
||||||
{ Key.F8, OsuAction.ToggleChat },
|
{ Key.F8, OsuAction.ToggleChat },
|
||||||
{ Key.F9, OsuAction.ToggleSocial },
|
{ Key.F9, OsuAction.ToggleSocial },
|
||||||
|
{ new[] { Key.LControl, Key.LAlt, Key.R }, OsuAction.ResetInputSettings },
|
||||||
|
{ new[] { Key.LControl, Key.T }, OsuAction.ToggleToolbar },
|
||||||
|
{ new[] { Key.LControl, Key.O }, OsuAction.ToggleSettings },
|
||||||
|
{ new[] { Key.LControl, Key.D }, OsuAction.ToggleDirect },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,8 @@ namespace osu.Game.Input
|
|||||||
|
|
||||||
public static implicit operator KeyCombination(string stringRepresentation) => new KeyCombination(stringRepresentation);
|
public static implicit operator KeyCombination(string stringRepresentation) => new KeyCombination(stringRepresentation);
|
||||||
|
|
||||||
|
public static implicit operator KeyCombination(Key[] keys) => new KeyCombination(keys);
|
||||||
|
|
||||||
public override string ToString() => Keys.Select(k => ((int)k).ToString()).Aggregate((s1, s2) => $"{s1},{s2}");
|
public override string ToString() => Keys.Select(k => ((int)k).ToString()).Aggregate((s1, s2) => $"{s1},{s2}");
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,6 +6,10 @@ namespace osu.Game.Input
|
|||||||
public enum OsuAction
|
public enum OsuAction
|
||||||
{
|
{
|
||||||
ToggleChat,
|
ToggleChat,
|
||||||
ToggleSocial
|
ToggleSocial,
|
||||||
|
ResetInputSettings,
|
||||||
|
ToggleToolbar,
|
||||||
|
ToggleSettings,
|
||||||
|
ToggleDirect
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using OpenTK.Input;
|
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Game.Graphics.UserInterface.Volume;
|
using osu.Game.Graphics.UserInterface.Volume;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -266,16 +265,7 @@ namespace osu.Game
|
|||||||
case OsuAction.ToggleSocial:
|
case OsuAction.ToggleSocial:
|
||||||
social.ToggleVisibility();
|
social.ToggleVisibility();
|
||||||
return true;
|
return true;
|
||||||
}
|
case OsuAction.ResetInputSettings:
|
||||||
}
|
|
||||||
|
|
||||||
if (state.Keyboard.ControlPressed)
|
|
||||||
{
|
|
||||||
switch (args.Key)
|
|
||||||
{
|
|
||||||
case Key.R:
|
|
||||||
if (state.Keyboard.AltPressed)
|
|
||||||
{
|
|
||||||
var sensitivity = frameworkConfig.GetBindable<double>(FrameworkSetting.CursorSensitivity);
|
var sensitivity = frameworkConfig.GetBindable<double>(FrameworkSetting.CursorSensitivity);
|
||||||
|
|
||||||
sensitivity.Disabled = false;
|
sensitivity.Disabled = false;
|
||||||
@ -284,18 +274,13 @@ namespace osu.Game
|
|||||||
|
|
||||||
frameworkConfig.Set(FrameworkSetting.ActiveInputHandlers, string.Empty);
|
frameworkConfig.Set(FrameworkSetting.ActiveInputHandlers, string.Empty);
|
||||||
return true;
|
return true;
|
||||||
}
|
case OsuAction.ToggleToolbar:
|
||||||
break;
|
|
||||||
case Key.T:
|
|
||||||
Toolbar.ToggleVisibility();
|
Toolbar.ToggleVisibility();
|
||||||
return true;
|
return true;
|
||||||
case Key.O:
|
case OsuAction.ToggleSettings:
|
||||||
settings.ToggleVisibility();
|
settings.ToggleVisibility();
|
||||||
return true;
|
return true;
|
||||||
case Key.D:
|
case OsuAction.ToggleDirect:
|
||||||
if (state.Keyboard.ShiftPressed || state.Keyboard.AltPressed)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
direct.ToggleVisibility();
|
direct.ToggleVisibility();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user