Skip to content

Commit

Permalink
restore comment line and change the param of delay_before_keys
Browse files Browse the repository at this point in the history
  • Loading branch information
laracroft37 committed Nov 29, 2024
1 parent 81b27c5 commit 91dffbe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions guibot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ class GlobalConfig(type):
a class object, i.e. a metaclass instance.
"""

# Operational parameters shared between all instances.
# operational parameters shared between all instances
_drag_delay = 0.5
_drop_delay = 0.5
_keys_delay = 0.2
_rescan_speed_on_find = 0.2
_wait_for_animations = False
_smooth_mouse_drag = True
Expand Down
3 changes: 2 additions & 1 deletion guibot/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,9 @@ def __configure_backend(
self.params[category] = {}
self.params[category]["backend"] = backend
self.params[category]["toggle_delay"] = 0.05
self.params[category]["click_delay"] = 0.01
self.params[category]["click_delay"] = 0.1
self.params[category]["type_delay"] = 0.1
self.params[category]["keys_delay"] = 0.2
log.log(9, "%s %s\n", category, self.params[category])

def configure_backend(
Expand Down
8 changes: 4 additions & 4 deletions guibot/region.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ def press_keys(self, keys: str | list[str]) -> "Region":
self.press_keys(['a', 'b', 3])
"""
keys_list = self._parse_keys(keys)
time.sleep(self.params["control"]["type_delay"])
time.sleep(self.params["control"]["keys_delay"])
self.dc_backend.keys_press(keys_list)
return self

Expand All @@ -1050,7 +1050,7 @@ def press_at(
"""
keys_list = self._parse_keys(keys, target_or_location)
match = self.click(target_or_location)
time.sleep(self.params["control"]["type_delay"])
time.sleep(self.params["control"]["keys_delay"])
self.dc_backend.keys_press(keys_list)
return match

Expand Down Expand Up @@ -1172,7 +1172,7 @@ def type_text(self, text: list[str] | str, modifiers: list[str] = None) -> "Regi
typing special keys.
"""
text_list = self._parse_text(text)
time.sleep(self.params["control"]["type_delay"])
time.sleep(self.params["control"]["keys_delay"])
if modifiers is not None:
if isinstance(modifiers, str):
modifiers = [modifiers]
Expand All @@ -1198,7 +1198,7 @@ def type_at(
match = None
if target_or_location is not None:
match = self.click(target_or_location)
time.sleep(self.params["control"]["type_delay"])
time.sleep(self.params["control"]["keys_delay"])
if modifiers is not None:
if isinstance(modifiers, str):
modifiers = [modifiers]
Expand Down

0 comments on commit 91dffbe

Please sign in to comment.