adbsshdeck 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- adbsshdeck-0.1.1.dist-info/LICENSE +21 -0
- adbsshdeck-0.1.1.dist-info/METADATA +136 -0
- adbsshdeck-0.1.1.dist-info/RECORD +29 -0
- adbsshdeck-0.1.1.dist-info/WHEEL +5 -0
- adbsshdeck-0.1.1.dist-info/entry_points.txt +2 -0
- adbsshdeck-0.1.1.dist-info/top_level.txt +1 -0
- devicedeck/__init__.py +4 -0
- devicedeck/__main__.py +4 -0
- devicedeck/app.py +45 -0
- devicedeck/config.py +130 -0
- devicedeck/services/__init__.py +1 -0
- devicedeck/services/adb_devices.py +74 -0
- devicedeck/services/commands.py +96 -0
- devicedeck/services/remote_clients.py +84 -0
- devicedeck/session.py +52 -0
- devicedeck/ui/__init__.py +1 -0
- devicedeck/ui/app_icon.py +46 -0
- devicedeck/ui/combo_utils.py +45 -0
- devicedeck/ui/first_run_dialog.py +107 -0
- devicedeck/ui/icon_utils.py +144 -0
- devicedeck/ui/main_window.py +691 -0
- devicedeck/ui/preferences_dialog.py +122 -0
- devicedeck/ui/session_login_dialog.py +795 -0
- devicedeck/ui/styles.py +1021 -0
- devicedeck/ui/tabs/__init__.py +1 -0
- devicedeck/ui/tabs/file_explorer_tab.py +3680 -0
- devicedeck/ui/tabs/scrcpy_tab.py +770 -0
- devicedeck/ui/tabs/terminal_tab.py +1192 -0
- devicedeck/ui/win_scrcpy_hotkey.py +76 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"""Windows: global hotkeys to stop scrcpy when the mirror steals focus (e.g. fullscreen)."""
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
SCRCPY_HOTKEY_ID = 0x4A42
|
|
6
|
+
SCRCPY_HOTKEY_ID2 = 0x4A43
|
|
7
|
+
|
|
8
|
+
_MOD_CONTROL = 0x0002
|
|
9
|
+
_MOD_ALT = 0x0001
|
|
10
|
+
_MOD_NOREPEAT = 0x4000
|
|
11
|
+
_VK_F12 = 0x7B
|
|
12
|
+
_VK_END = 0x23
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _register_one(hwnd: int, hid: int, vk: int) -> bool:
|
|
16
|
+
if sys.platform != "win32" or not hwnd:
|
|
17
|
+
return False
|
|
18
|
+
try:
|
|
19
|
+
import ctypes
|
|
20
|
+
|
|
21
|
+
return bool(
|
|
22
|
+
ctypes.windll.user32.RegisterHotKey(
|
|
23
|
+
int(hwnd), hid, _MOD_CONTROL | _MOD_ALT | _MOD_NOREPEAT, vk
|
|
24
|
+
)
|
|
25
|
+
)
|
|
26
|
+
except Exception:
|
|
27
|
+
return False
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def register_scrcpy_stop_hotkey(hwnd: int) -> bool:
|
|
31
|
+
"""Register Ctrl+Alt+F12 and Ctrl+Alt+End — either can stop the mirror from anywhere."""
|
|
32
|
+
ok_f12 = _register_one(hwnd, SCRCPY_HOTKEY_ID, _VK_F12)
|
|
33
|
+
ok_end = _register_one(hwnd, SCRCPY_HOTKEY_ID2, _VK_END)
|
|
34
|
+
return bool(ok_f12 or ok_end)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def unregister_scrcpy_stop_hotkey(hwnd: int) -> None:
|
|
38
|
+
if sys.platform != "win32":
|
|
39
|
+
return
|
|
40
|
+
try:
|
|
41
|
+
import ctypes
|
|
42
|
+
|
|
43
|
+
user32 = ctypes.windll.user32
|
|
44
|
+
user32.UnregisterHotKey(int(hwnd), SCRCPY_HOTKEY_ID)
|
|
45
|
+
user32.UnregisterHotKey(int(hwnd), SCRCPY_HOTKEY_ID2)
|
|
46
|
+
except Exception:
|
|
47
|
+
pass
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def is_windows_hotkey_message(event_type, message) -> bool:
|
|
51
|
+
"""Return True if this is WM_HOTKEY for one of our scrcpy stop ids."""
|
|
52
|
+
if sys.platform != "win32":
|
|
53
|
+
return False
|
|
54
|
+
try:
|
|
55
|
+
if hasattr(event_type, "data"):
|
|
56
|
+
et = bytes(event_type.data()).decode("latin1", errors="ignore")
|
|
57
|
+
else:
|
|
58
|
+
et = bytes(event_type).decode("latin1", errors="ignore")
|
|
59
|
+
except Exception:
|
|
60
|
+
try:
|
|
61
|
+
et = str(event_type)
|
|
62
|
+
except Exception:
|
|
63
|
+
return False
|
|
64
|
+
if "windows_generic_MSG" not in et and "windows_dispatcher_MSG" not in et:
|
|
65
|
+
return False
|
|
66
|
+
try:
|
|
67
|
+
import ctypes
|
|
68
|
+
from ctypes import wintypes
|
|
69
|
+
|
|
70
|
+
msg = ctypes.cast(int(message), ctypes.POINTER(wintypes.MSG)).contents
|
|
71
|
+
if msg.message != 0x0312:
|
|
72
|
+
return False
|
|
73
|
+
wp = int(msg.wParam)
|
|
74
|
+
return wp in (SCRCPY_HOTKEY_ID, SCRCPY_HOTKEY_ID2)
|
|
75
|
+
except Exception:
|
|
76
|
+
return False
|