Windowsで言う
GetAsyncKeyStateのような関数はありませんか?