C# 클래스 ATGTestInput.Input

Provides methods for sending mouse and keyboard input
파일 보기 프로젝트 열기: geeksree/cSharpGeeks

공개 메소드들

메소드 설명
GetAsyncKeyState ( Key key ) : bool

Checks whether the specified key is currently up or down

MoveTo ( AutomationElement el ) : void

Move the mouse to an element.

MoveTo ( Point pt ) : void

Move the mouse to a point.

pt are in pixels that are relative to desktop origin.

MoveToAndClick ( AutomationElement el ) : void

Move the mouse to an element and click on it. The primary mouse button will be used this is usually the left button except if the mouse buttons are swaped.

MoveToAndClick ( Point pt ) : void

Move the mouse to a point and click. The primary mouse button will be used this is usually the left button except if the mouse buttons are swaped.

pt are in pixels that are relative to desktop origin.

SendKeyboardInput ( Key key, bool press ) : void

Inject keyboard input into the system

SendMouseInput ( double x, double y, int data, SendMouseInputFlags flags ) : void

Inject pointer input into the system

x, y are in pixels. If Absolute flag used, are relative to desktop origin.

SendUnicodeKeyboardInput ( char key, bool press ) : void

Injects a unicode character as keyboard input into the system

SendUnicodeString ( string data ) : void

Injects a string of Unicode characters using simulated keyboard input It should be noted that this overload just sends the whole string with no pauses, depending on the recieving applications input processing it may not be able to keep up with the speed, resulting in corruption or loss of the input data.

SendUnicodeString ( string data, int sleepFrequency, int sleepLength ) : void

Injects a string of Unicode characters using simulated keyboard input with user defined timing.

SetValue ( AutomationElement element, string value ) : void

This is a hyrbird of the ValuePattern.SetValue code extracted from the UI Automation sources NOTE: Requires the ability to set focus to the current automation element

비공개 메소드들

메소드 설명
GetWindowHandleFromAutomationElement ( AutomationElement element ) : IntPtr

Gets WindowHandle from an AutomationElement

Input ( ) : System.Globalization
InternalSendUnicodeString ( string data, int sleepFrequency, int sleepLength ) : void
IsBitSet ( int flags, int bit ) : bool

Is bit set?

IsExtendedKey ( Key key ) : bool
SendKeyboardInput ( Key key ) : void

Helper: Sends the up and down keyboard input

SendKeyboardInput ( Key key, int millisecondDelay ) : void

Helper: Sends the up and down keyboard input

SendKeyboardInput ( string keyCombination ) : void

Does a look up of the string in keyCombination, converts the string to a Keys enum, and then sends the results to SendKeyboardInput().

SendKeyboardInput ( string keyCombination, int millisecondDelay ) : void

Does a look up of the string in keyCombination, converts the string to a Keys enum, and then sends the results to SendKeyboardInput().

SendKeyboardInputVK ( byte vk, bool press ) : void

메소드 상세

GetAsyncKeyState() 공개 정적인 메소드

Checks whether the specified key is currently up or down
public static GetAsyncKeyState ( Key key ) : bool
key Key The Key to check
리턴 bool

MoveTo() 공개 정적인 메소드

Move the mouse to an element.
If there is not clickable point for the element
public static MoveTo ( AutomationElement el ) : void
el System.Windows.Automation.AutomationElement The element that the mouse will move to
리턴 void

MoveTo() 공개 정적인 메소드

Move the mouse to a point.
pt are in pixels that are relative to desktop origin.
public static MoveTo ( Point pt ) : void
pt Point The point that the mouse will move to.
리턴 void

MoveToAndClick() 공개 정적인 메소드

Move the mouse to an element and click on it. The primary mouse button will be used this is usually the left button except if the mouse buttons are swaped.
If there is not clickable point for the element
public static MoveToAndClick ( AutomationElement el ) : void
el System.Windows.Automation.AutomationElement The element to click on
리턴 void

MoveToAndClick() 공개 정적인 메소드

Move the mouse to a point and click. The primary mouse button will be used this is usually the left button except if the mouse buttons are swaped.
pt are in pixels that are relative to desktop origin.
public static MoveToAndClick ( Point pt ) : void
pt Point The point to click at
리턴 void

SendKeyboardInput() 공개 정적인 메소드

Inject keyboard input into the system
public static SendKeyboardInput ( Key key, bool press ) : void
key Key indicates the key pressed or released. Can be one of the constants defined in the Key enum
press bool true to inject a key press, false to inject a key release
리턴 void

SendMouseInput() 공개 정적인 메소드

Inject pointer input into the system
x, y are in pixels. If Absolute flag used, are relative to desktop origin.
public static SendMouseInput ( double x, double y, int data, SendMouseInputFlags flags ) : void
x double x coordinate of pointer, if Move flag specified
y double y coordinate of pointer, if Move flag specified
data int wheel movement, or mouse X button, depending on flags
flags SendMouseInputFlags flags to indicate which type of input occurred - move, button press/release, wheel move, etc.
리턴 void

SendUnicodeKeyboardInput() 공개 정적인 메소드

Injects a unicode character as keyboard input into the system
public static SendUnicodeKeyboardInput ( char key, bool press ) : void
key char indicates the key to be pressed or released. Can be any unicode character
press bool true to inject a key press, false to inject a key release
리턴 void

SendUnicodeString() 공개 정적인 메소드

Injects a string of Unicode characters using simulated keyboard input It should be noted that this overload just sends the whole string with no pauses, depending on the recieving applications input processing it may not be able to keep up with the speed, resulting in corruption or loss of the input data.
public static SendUnicodeString ( string data ) : void
data string The unicode string to be sent
리턴 void

SendUnicodeString() 공개 정적인 메소드

Injects a string of Unicode characters using simulated keyboard input with user defined timing.
public static SendUnicodeString ( string data, int sleepFrequency, int sleepLength ) : void
data string The unicode string to be sent
sleepFrequency int How many characters to send between sleep calls
sleepLength int How long, in milliseconds, to sleep for at each sleep call
리턴 void

SetValue() 공개 정적인 메소드

This is a hyrbird of the ValuePattern.SetValue code extracted from the UI Automation sources NOTE: Requires the ability to set focus to the current automation element
public static SetValue ( AutomationElement element, string value ) : void
element System.Windows.Automation.AutomationElement
value string
리턴 void