R/Ryujinx.Profiler/ProfilerKeyboardHandler.cs
Alex Barney b2b736abc2 Misc cleanup (#708)
* Fix typos

* Remove unneeded using statements

* Enforce var style more

* Remove redundant qualifiers

* Fix some indentation

* Disable naming warnings on files with external enum names

* Fix build

* Mass find & replace for comments with no spacing

* Standardize todo capitalization and for/if spacing
2019-07-02 04:39:22 +02:00

28 lines
654 B
C#

using OpenTK.Input;
namespace Ryujinx.Profiler
{
public struct ProfilerButtons
{
public Key ToggleProfiler;
}
public class ProfilerKeyboardHandler
{
public ProfilerButtons Buttons;
private KeyboardState _prevKeyboard;
public ProfilerKeyboardHandler(ProfilerButtons buttons)
{
Buttons = buttons;
}
public bool TogglePressed(KeyboardState keyboard) => !keyboard[Buttons.ToggleProfiler] && _prevKeyboard[Buttons.ToggleProfiler];
public void SetPrevKeyboardState(KeyboardState keyboard)
{
_prevKeyboard = keyboard;
}
}
}