Windowsにはゲーム用のコントローラとしてジョイスティック(ゲームパッドとも呼ばれます)を使用することが出来ます。 ジョイスティックを使用することでPCに不慣れな人でも、直感的な操作で入力を行う事が可能です。ジョイスティックを制御するプログラムを書くにはDirectXを使用することが多いのですが、残念ながらC#(というか.Net Framework)を使用したジョイスティック制御プログラムの情報は少ないです。 そこで今回は、VisualStudio 2010で、C#からDirectXのDirectInputの機能を使用して、ジョイスティックを利用できるようにします。 開発環境 確認に使用した環境は以下の通りです。 OS: Windows7 x64 IDE: VisualStidio 2010 Professional DirectX SDK: DirectX SDK(Jun 2010)