using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DxLibDLL;
namespace DesignProject
{
class KeyBoard
{
private byte[] data;
private byte[] dataOld;
public KeyBoard()
{
this.data = new byte[256];
this.dataOld = new byte[256];
}
public bool Push(int Key)
{
if (this.data[Key] == 1)
{
return (true);
}
return (false);
}
public bool PushMoment(int Key)
{
if ((this.data[Key] == 1) && (this.dataOld[Key] == 0))
{
return (true);
}
return (false);
}
public bool Leave(int Key)
{
if (this.data[Key] == 0)
{
return (true);
}
return (false);
}
public bool LeaveMoment(int Key)
{
if ((this.data[Key] == 0) && (this.dataOld[Key] == 1))
{
return (true);
}
return (false);
}
public void Update()
{
this.dataOld = this.data;
//GetHitKeyStateAllの引数他の修正が必要
DX.GetHitKeyStateAll(out this.data);
}
}
}
最終更新:2010年12月08日 20:06