How to raise an event on MS word Keypress

后端 未结 1 1805
予麋鹿
予麋鹿 2020-12-19 08:08

I am developing a MS-Word addon in which my code has to get access to the letters the user is entering through the keyboard.

private void ThisDocument_Start         


        
相关标签:
1条回答
  • 2020-12-19 08:43

    Microsoft doesn't expose a key down event natively, but there's a workaround.

    I implemented keyboard checking with help from the article linked below:

    http://www.switchonthecode.com/tutorials/winforms-accessing-mouse-and-keyboard-state

    This gives you a static method called IsKeyDown, implementing and invoking a delegate you can subscribe to should be fairly straight forward.

    0 讨论(0)
提交回复
热议问题