Skip to content

fix error & refactor #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 18, 2021
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
2 changes: 1 addition & 1 deletion .idea/Python_JEAutoControl.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

127 changes: 36 additions & 91 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
import ctypes


def check_key_is_press(keycode: int):
def check_key_is_press(keycode: [int, str]):
if type(keycode) is int:
temp = ctypes.windll.user32.GetKeyState(keycode)
else:
temp = ctypes.windll.user32.GetKeyState(ord(keycode))
if temp > 1:
return True
return False
5 changes: 2 additions & 3 deletions je_auto_control/wrapper/platform_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@
from je_auto_control.windows.core.utils.win32_vk import win32_keyY
from je_auto_control.windows.core.utils.win32_vk import win32_keyZ
from je_auto_control.windows.keyboard import win32_ctype_keyboard_control
from je_auto_control.windows.keyboard import win32_keyboard_check
from je_auto_control.windows.mouse import win32_ctype_mouse_control
from je_auto_control.windows.mouse.win32_ctype_mouse_control import win32_mouse_left
from je_auto_control.windows.mouse.win32_ctype_mouse_control import win32_mouse_middle
Expand All @@ -179,6 +178,7 @@
from je_auto_control.windows.mouse.win32_ctype_mouse_control import win32_mouse_x2
from je_auto_control.windows.screen import win32_screen
from je_auto_control.windows.record.win32_record import win32_recorder
from je_auto_control.windows.core.utils import win32_keypress_check

elif sys.platform in ["darwin"]:
from je_auto_control.osx.core.utils.osx_vk import osx_key_a, osx_key_A
Expand Down Expand Up @@ -284,7 +284,6 @@
from je_auto_control.osx.screen import osx_screen
from je_auto_control.osx.keyboard import osx_keyboard
from je_auto_control.osx.keyboard import osx_keyboard_check
from je_auto_control.osx.record.osx_record import osx_recorder

elif sys.platform in ["linux", "linux2"]:
from je_auto_control.linux_with_x11.core.utils.x11_linux_vk import x11_linux_key_backspace
Expand Down Expand Up @@ -697,7 +696,7 @@
"mouse_x2": win32_mouse_x2
}
keyboard = win32_ctype_keyboard_control
keyboard_check = win32_keyboard_check
keyboard_check = win32_keypress_check
mouse = win32_ctype_mouse_control
screen = win32_screen
recorder = win32_recorder
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="je_auto_control",
version="0.0.66",
version="0.0.69",
author="JE-Chen",
author_email="zenmailman@gmail.com",
description="auto testing",
Expand Down
2 changes: 2 additions & 0 deletions todo.je
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
check ide refactor
refactor