コード例 #1
0
        protected override void GameKeyDown(XKeyboardEventArgs args)
        {
            if (!m_bkeydown)
            {
                Console.WriteLine("按下键:" + args.GetKey());
                m_bkeydown = true;
            }

            if (args.GetKey() == XKeys.Escape)
            {
                SetGameOver(true);
            }
        }
コード例 #2
0
 protected override void GameKeyUp(XKeyboardEventArgs args)
 {
     Console.WriteLine("释放键:" + args.GetKey());
     m_bkeydown = false;
 }