コード例 #1
0
ファイル: SendKey.py プロジェクト: olve/Bristow
def send_key_to_windows_with_title(key, regex, send_to_children=False):
	windows = WindowsTools.enum_windows(regex)
	for HWND in windows:
		_send_key(key, HWND)
		if send_to_children:
			child_windows = WindowsTools.enum_child_windows(window)
			for window in child_windows:
				_send_key(key, window)
コード例 #2
0
ファイル: SendKey.py プロジェクト: olve/Bristow
def send_key(key, HWND, send_to_children=False):
	"""Send a simulated keypress to a window.

	Keyword arguments:
	key -- ID of the key you want to send (decimal)
	HWND -- The window handle of the target window
	send_to_children -- if True, the keypress will be sent to all child-windows of the parent

	"""
	_send_key(key, HWND)
	if send_to_children:
		child_windows = WindowsTools.enum_child_windows(HWND)
		for window in child_windows:
			_send_key(key, window)
コード例 #3
0
ファイル: SendKey.py プロジェクト: olve/Bristow
def send_key(key, HWND, send_to_children=False):
	"""Send a simulated keypress to a window.

	Keyword arguments:
	key -- The Key ID (examples: "Space", "Numpad0", "B")
	HWND -- The window handle of the target window
	send_to_children -- if True, the keypress will be sent to all child-windows of the parent

	"""
	_send_key(key, HWND)
	if send_to_children:
		child_windows = WindowsTools.enum_child_windows(HWND)
		for window in child_windows:
			_send_key(key, window)
コード例 #4
0
ファイル: SendKey.py プロジェクト: olve/Bristow
def send_key_to_windows_with_title(key, regex, send_to_children=False):
	"""Send a simulated keypress to all windows with titles matching a regular expression

	Keyword arguments:
	key -- ID of the key you want to send (decimal)
	regex -- The regular expression to search with
	send_to_children -- if True, the keypress will be sent to all child-windows of the parent

	"""
	windows = WindowsTools.enum_windows(regex)
	for HWND in windows:
		_send_key(key, HWND)
		if send_to_children:
			child_windows = WindowsTools.enum_child_windows(window)
			for window in child_windows:
				_send_key(key, window)