Virtu/Virtu/Services/KeyboardService.cs
Sean Fausett ee4c69dddf Added support for keyboard shift key down as game port button 2 [TN9].
Refactored memory to use peripheral cards; added place holder for NoSlotClock.

--HG--
extra : convert_revision : svn%3Affd33b8c-2492-42e0-bdc5-587b920b7d6d/trunk%4050808
2010-08-27 23:46:11 +00:00

42 lines
1.2 KiB
C#

namespace Jellyfish.Virtu.Services
{
public abstract class KeyboardService : MachineService
{
protected KeyboardService(Machine machine) :
base(machine)
{
}
public abstract bool IsKeyDown(int key);
public virtual void Update() // main thread
{
if (IsResetKeyDown)
{
if (!_resetKeyDown)
{
_resetKeyDown = true; // entering reset; pause until key released
Machine.Pause();
Machine.Reset();
}
}
else if (_resetKeyDown)
{
_resetKeyDown = false; // leaving reset
Machine.Unpause();
}
}
public bool IsAnyKeyDown { get; protected set; }
public bool IsControlKeyDown { get; protected set; }
public bool IsShiftKeyDown { get; protected set; }
public bool IsOpenAppleKeyDown { get; protected set; }
public bool IsCloseAppleKeyDown { get; protected set; }
protected bool IsResetKeyDown { get; set; }
private bool _resetKeyDown;
}
}