如题,当我按下键盘上的一个按键后,事件响应多次,例如按下m键,则显示多个m,怎么实现?

解决方案 »

  1.   

    static int  = 0;void EventDealProgress(...)
    {
        // TODO: 事件处理    if( < 3)
        {
            ++;
         // fire the event
        }
        else
             = 0;
    }
      

  2.   

       private void Form1_Load(object sender, EventArgs e)
            {
                this.KeyPreview = true;
            }        private void Form1_KeyUp(object sender, KeyEventArgs e)
            {
                if (e.KeyData == Keys.K)
                {
                    SendKeys.Send("K");
                    SendKeys.Send("K");
                }
            }
      

  3.   

    M-77
    KeyPress事件中
                    int keyAscii = (int)e.KeyChar;                switch (keyAscii)
                    {
                        case 77:
                       
    }
      

  4.   


    这个要用到Hook了
    你得先监视下记事本或者所谓的其他程序
    拿到他的消息池然后监视到按键信息的时候用SendMessage发送消息