Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
### [Current changes]
- _

### [15.0.4][May 11, 2022]
- **[Improve]** Added plus button support in keystroke action

### [15.0.3][May 08, 2022]
- **[Change]** Removed printing the whole traceback of error

Expand Down
32 changes: 22 additions & 10 deletions Framework/Built_In_Automation/Desktop/Windows/BuiltInFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@ def Keystroke_For_Element(data_set):
left = left.strip().lower()
if "action" in mid.lower():
if left == "keystroke keys":
keystroke_value = right.lower() # Store keystroke
keystroke_value = right.strip().lower() # Store keystroke
elif left == "keystroke chars":
keystroke_char = right
if "parameter"in mid.lower():
Expand Down Expand Up @@ -1776,14 +1776,21 @@ def Keystroke_For_Element(data_set):
keystroke_value, count = keystroke_value.split(",")
count = int(count.strip())
keys = keystroke_value.split("+")
keys = [x.strip() for x in keys]
for i in range(len(keys)):
keys[i] = keys[i].strip()
if keys[i] == "plus":
keys[i] = "+"
elif keys[i] == "minus":
keys[i] = "-"
elif keys[i] == "comma":
keys[i] = ","

for i in range(count):
gui.hotkey(*keys) # Send keypress (as individual values using the asterisk)
CommonUtil.ExecLog(sModuleInfo, "Successfully entered keystroke", 1)
return "passed"

elif method_name=='autoit':
elif method_name == 'autoit':
try:
if keystroke_char != "":
autoit.send(keystroke_char)
Expand All @@ -1794,26 +1801,31 @@ def Keystroke_For_Element(data_set):
return CommonUtil.Exception_Handler(sys.exc_info(), None, errMsg)

count = 1
keystroke_value = keystroke_value
if "," in keystroke_value:
keystroke_value, count = keystroke_value.split(",")
count = int(count.strip())
keys = keystroke_value.split("+")
keys = [x.strip() for x in keys]
for i in range(len(keys)):
keys[i] = keys[i].strip()
if keys[i] == "plus":
keys[i] = "+"
elif keys[i] == "minus":
keys[i] = "-"
elif keys[i] == "comma":
keys[i] = ","

send_key = ""
for i in range(len(keys)):
if i == len(keys)-1:
send_key += '{' + keys[i] + ' ' + str(count) + '}'
else:
upper = keys[i].upper()
if upper == 'SHIFT':
if keys[i] == 'shift':
send_key += '+'
elif upper == 'CTRL':
elif keys[i] == 'ctrl':
send_key += '^'
elif upper == 'ALT':
elif keys[i] == 'alt':
send_key += '!'
elif upper == 'WIN':
elif keys[i] == 'win':
send_key += '#'
# print(send_key)
autoit.send(send_key)
Expand Down
4 changes: 2 additions & 2 deletions Framework/Version.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[ZeuZ Python Version]
version = 15.0.3
version = 15.0.4
[Release Date]
date = May 08, 2022
date = May 11, 2022