mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Add keyboard adjustment support
This commit is contained in:
@ -13,6 +13,7 @@ using osu.Framework.Input.Events;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Game.Input.Bindings;
|
||||
using osuTK.Graphics;
|
||||
using osuTK.Input;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
@ -78,6 +79,24 @@ namespace osu.Game.Overlays.Toolbar
|
||||
globalVolume.BindValueChanged(v => volumeBar.ResizeHeightTo((float)v.NewValue, 200, Easing.OutQuint), true);
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(KeyDownEvent e)
|
||||
{
|
||||
switch (e.Key)
|
||||
{
|
||||
case Key.Up:
|
||||
focusForAdjustment();
|
||||
volume?.Adjust(GlobalAction.IncreaseVolume);
|
||||
return true;
|
||||
|
||||
case Key.Down:
|
||||
focusForAdjustment();
|
||||
volume?.Adjust(GlobalAction.IncreaseVolume, -1);
|
||||
return true;
|
||||
}
|
||||
|
||||
return base.OnKeyDown(e);
|
||||
}
|
||||
|
||||
protected override bool OnScroll(ScrollEvent e)
|
||||
{
|
||||
focusForAdjustment();
|
||||
|
Reference in New Issue
Block a user