2012-02-01 65 views
0

如何模擬單個按鍵這裏描述如何模擬Ctrl-S組合鍵?

How can I programmatically generate keypress events in C#?

但我怎麼能模擬按Ctrl - 小號組合?

+0

我不認爲這是可能的,請參閱 http://stackoverflow.com/questions/1278347/programatically-set- the-keyboard-modifiers-wpf – SvenG 2012-02-01 14:52:28

+0

你能否向我澄清,哪些答案不起作用,爲什麼在你的鏈接問題中? – kenny 2012-02-01 15:01:51

+0

接受的答案只適用於單個按鍵。我需要檢測組合鍵(Ctrl和S)。 – vkrzv 2012-02-01 15:16:40

回答

0

在CodePlex上這個庫可以模擬多個按鍵
Windows Input Simulator

InputSimulator.SimulateModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_S);