模拟“Windows"键和“+"放大键 [英] Simulate "Windows" key and "+" key to zoom in
问题描述
Windows 7(终于)具有内置的屏幕缩放功能.按住Windows"键,然后您可以使用+"键放大,使用-"键缩小.因此,我一直在尝试模拟这种组合.使用 AutoIt 我尝试过:
Windows 7 (finally) has built-in zoom feature for the screen. Hold down the "Windows" key and you can then use the "+" key to zoom in and the "-" key to zoom out. As a result I have been trying to simulate this combination. With AutoIt I have tried:
1)
Send("{LWINDOWN}" & "+" & "{LWINUP}")
2)
$x = Chr(43)
Send("{LWINDOWN}" & $x & "{LWINUP}")
3)
Send("#{+}") ;//works but it also sends "+" key
4)
Send("{LWINDOWN}")
Sleep(10)
Send("+",1)
Sleep(10)
Send("{LWINUP}")
这 4 个步骤都不起作用...
我实际上想在 c# 上使用此功能.如果我设法用 autoit 做到这一点,我可以用 c# 调用该脚本,所以我不介意语言.我也在模拟击键,因为我不知道如何使用 c# 放大.
I actually want to use this functionality on c#. If I manage to do it with autoit I could invoke that script with c# so I don't mind the langauage. I am also simulating keystrokes because I don't know how I will be able to zoom in using c#.
推荐答案
导入位于以下位置的库:
Import the library located at:
http://inputsimulator.codeplex.com/
然后做:
WindowsInput.InputSimulator.SimulateKeyDown
(WindowsInput.VirtualKeyCode.LWIN);
WindowsInput.InputSimulator.SimulateKeyPress
(WindowsInput.VirtualKeyCode.OEM_PLUS);
WindowsInput.InputSimulator.SimulateKeyUp
(WindowsInput.VirtualKeyCode.LWIN);
这篇关于模拟“Windows"键和“+"放大键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!