diff --git a/auto_bot.py b/auto_bot.py index 0d548a3..00946fa 100644 --- a/auto_bot.py +++ b/auto_bot.py @@ -1,9 +1,23 @@ import json import os import random +import sys import time -import pydirectinput +import math +import ctypes +import cv2 +import numpy as np +import win32gui +import win32api +import win32con +# 开启 DPI 意识 +try: + ctypes.windll.shcore.SetProcessDpiAwareness(1) +except Exception: + ctypes.windll.user32.SetProcessDPIAware() + +from hardware_control import hw_ctrl from game_state import parse_game_state from stuck_handler import StuckHandler @@ -11,6 +25,84 @@ from stuck_handler import StuckHandler KEY_TAB = '3' KEY_LOOT = '4' # 假设你在游戏里设置了互动按键为 F KEY_ATTACK = '2' # 假设你的主攻击技能是 1 +WIN_TITLE = "魔兽世界" + +def _config_base(): + if getattr(sys, 'frozen', False): + return os.path.dirname(sys.executable) + return os.path.dirname(os.path.abspath(__file__)) + +class CursorManager: + """通过图像识别判断鼠标图标类型""" + def __init__(self): + self.templates = {} + self.handle_cache = {} + self._load_templates() + + def _load_templates(self): + # 强制使用纯相对路径,由 Python 自动处理 CWD,完美避开中文路径编码问题 + cursor_dir = os.path.join('images', 'cursor') + files = {'Point': 'Point.PNG', 'Attack': 'Attack.PNG', 'LootAll': 'LootAll.PNG', 'Skin': 'Skin.PNG'} + for name, fname in files.items(): + path = os.path.join(cursor_dir, fname) + if os.path.exists(path): + try: + # 使用 numpy 读取二进制流再解码 + img_array = np.fromfile(path, dtype=np.uint8) + img = cv2.imdecode(img_array, cv2.IMREAD_UNCHANGED) + if img is not None: + if img.shape[2] == 3: + img = cv2.cvtColor(img, cv2.COLOR_BGR2BGRA) + self.templates[name] = img + except Exception as e: + print(f">>> [CursorMgr] 加载 {fname} 失败: {e}") + else: + print(f">>> [CursorMgr] 找不到文件: {path}") + + def get_type(self, hcursor): + if not hcursor or hcursor == 0: return 'Other', 0.0 + if hcursor in self.handle_cache: return self.handle_cache[hcursor] + res = self._identify(hcursor) + self.handle_cache[hcursor] = res + return res + + def _identify(self, hcursor): + import win32ui + try: + width, height = 48, 48 + hdc = win32gui.GetDC(0) + dc = win32ui.CreateDCFromHandle(hdc) + memdc = dc.CreateCompatibleDC() + bitmap = win32ui.CreateBitmap() + bitmap.CreateCompatibleBitmap(dc, width, height) + memdc.SelectObject(bitmap) + win32gui.DrawIconEx(memdc.GetSafeHdc(), 0, 0, hcursor, width, height, 0, 0, win32con.DI_NORMAL) + bits = bitmap.GetBitmapBits(True) + target = np.frombuffer(bits, dtype='uint8').reshape(height, width, 4) + memdc.DeleteDC() + win32gui.ReleaseDC(0, hdc) + + best_name = 'Other' + max_score = 0.0 + + scales = [0.8, 1.0, 1.2] + for name, temp in self.templates.items(): + t_h, t_w = temp.shape[:2] + for s in scales: + s_w, s_h = int(t_w * s), int(t_h * s) + if s_w > width or s_h > height: continue + res_temp = cv2.resize(temp, (s_w, s_h)) + res = cv2.matchTemplate(target, res_temp, cv2.TM_CCOEFF_NORMED) + _, score, _, _ = cv2.minMaxLoc(res) + if score > max_score: + max_score = score + best_name = name + + if max_score > 0.2: + print(f">>>> [雷达识别] 目标: {best_name} | 最高分: {max_score:.3f}") + return best_name, max_score + except Exception: + return 'Other', 0.0 def load_attack_loop(path): """从 JSON 加载攻击循环配置。支持 hp_below_percent/hp_key、mp_below_percent/mp_key(0=不启用)""" @@ -36,8 +128,12 @@ def load_attack_loop(path): class AutoBot: - def __init__(self, waypoints=None, attack_loop_path=None, skinning_wait_sec=None): + def __init__(self, waypoints=None, attack_loop_path=None, skinning_wait_sec=None, enable_mouse_loot=True): self.last_tab_time = 0 + self.last_interaction_time = 0 + self.last_target_hp = 0 + self._has_braked_for_target = False + self._was_in_combat_or_target = False self.is_running = True self.attack_loop_config = load_attack_loop(attack_loop_path) self.tab_no_target_count = 0 # 连续按 Tab 仍无目标的次数,满 5 次则转向 @@ -45,18 +141,101 @@ class AutoBot: self.target_acquired_time = None # 本次获得目标的时间(目前仅用于调试/保留接口) self.last_turn_end_time = 0 # 最近一次结束 A/D 转向的时间,供卡死检测排除 self.skinning_wait_sec = float(skinning_wait_sec) if skinning_wait_sec is not None else 1.5 + self.enable_mouse_loot = enable_mouse_loot + self.cursor_mgr = CursorManager() def execute_disengage_loot(self): """从有战斗/目标切换到完全脱战的瞬间,执行拾取 + 剥皮。""" try: - # 拾取 - pydirectinput.press(KEY_LOOT) - time.sleep(0.5) - # 剥皮 - pydirectinput.press(KEY_LOOT) - time.sleep(self.skinning_wait_sec) + # 1. 拟人化鼠标扫雷补漏拾取 + if self.enable_mouse_loot: + self.mouse_sweep_loot() + else: + hw_ctrl.press(KEY_LOOT) + time.sleep(0.5) + # 2. 剥皮动作 + hw_ctrl.press(KEY_LOOT) + time.sleep(self.skinning_wait_sec + 0.5) except Exception: pass + + def mouse_sweep_loot(self): + """支持图标识别的高精度扫雷拾取。""" + if random.random() < 0.1: return False + hwnd = win32gui.FindWindow(None, WIN_TITLE) + if not hwnd: return False + + try: + rect = win32gui.GetWindowRect(hwnd) + left, top, right, bottom = rect + center_x = left + (right - left) // 2 + center_y = top + (bottom - top) // 2 + + # 1. 强制“角落校准”采样 + win32api.SetCursorPos((left + 50, top + 50)) + time.sleep(0.2) + _, default_hcursor, _ = win32gui.GetCursorInfo() + + # 2. 获取扫瞄路径点位 + path_points = [] + path_file = "loot_path.json" + if os.path.exists(path_file): + with open(path_file, 'r') as f: + path_points = json.load(f) + else: + # 降级方案:生成拟人化半椭圆 + x_scale, y_scale = 1.8, 0.8 + for r in range(50, (bottom-top)//2, 40): + angles = range(180, 360, 5) if (r//40)%2==0 else range(360, 180, -5) + for a in angles: + rad = math.radians(a) + path_points.append((int(r * math.cos(rad) * x_scale), int(r * math.sin(rad) * y_scale))) + + # 3. 开始沿路径扫瞄 + start_time = time.time() + looted_positions = [] + + for dx, dy in path_points: + if time.time() - start_time > 15.0: break + + target_x = center_x + dx + random.randint(-5, 5) + target_y = center_y + dy + random.randint(-5, 5) + + if not (left+10 < target_x < right-10 and top+10 < target_y < bottom-10): continue + if any(math.dist((target_x, target_y), pos) < 30 for pos in looted_positions): continue + + win32api.SetCursorPos((target_x, target_y)) + time.sleep(0.02) + + _, hcursor, _ = win32gui.GetCursorInfo() + if hcursor != 0 and hcursor != default_hcursor: + # 识别图标 + ctype_name, score = self.cursor_mgr.get_type(hcursor) + if score > 0.7 and ctype_name in ['LootAll', 'Skin']: + print(f">>> [扫雷] 识别成功: {ctype_name} (得分: {score:.3f}), 执行右键点击") + hw_ctrl.right_click() + looted_positions.append((target_x, target_y)) + + # 根据类型等待 + ws = 1.3 if ctype_name == 'LootAll' else self.skinning_wait_sec + time.sleep(ws) + + # 等待指针恢复 + w_start = time.time() + while time.time() - w_start < 0.8: + _, ch, _ = win32gui.GetCursorInfo() + check_name, _ = self.cursor_mgr.get_type(ch) + if check_name == 'Point': break + time.sleep(0.1) + time.sleep(random.uniform(0.1, 0.2)) + elif score > 0.4: + print(f">>> [扫雷] 疑似图标: {ctype_name} (得分: {score:.3f} < 门槛 0.7)") + + win32api.SetCursorPos((center_x, center_y)) + return True + except Exception as e: + print(f">>> [扫雷拾取] 出错: {e}") + return False def execute_combat_logic(self, state): if self.attack_loop_config: @@ -65,74 +244,86 @@ class AutoBot: return hp = state.get('hp') if hp is not None and cfg.get('hp_below_percent') and cfg.get('hp_key') and hp < cfg['hp_below_percent']: - pydirectinput.press(cfg['hp_key']) + hw_ctrl.press(cfg['hp_key']) time.sleep(0.2) mp = state.get('mp') if mp is not None and cfg.get('mp_below_percent') and cfg.get('mp_key') and mp < cfg['mp_below_percent']: - pydirectinput.press(cfg['mp_key']) + hw_ctrl.press(cfg['mp_key']) time.sleep(0.2) # 每次攻击前选中目标 - pydirectinput.press(KEY_LOOT) + # hw_ctrl.press(KEY_LOOT) for step in cfg['steps']: key = step.get('key') or KEY_ATTACK delay = float(step.get('delay', 0.5)) - pydirectinput.press(key) + hw_ctrl.press(key) time.sleep(delay) return # 默认:模拟手动按键的节奏 if random.random() < 0.3: - pydirectinput.press(KEY_ATTACK) + hw_ctrl.press(KEY_ATTACK) time.sleep(0.5) def execute_logic(self, state): current_time = time.time() + target_hp = state.get('target_hp', 0) + + effective_target = bool(state['target'] and target_hp > 0) + in_combat_or_target = bool(state['combat'] or effective_target) + + if in_combat_or_target: + self.target_acquired_time = (self.target_acquired_time or current_time) + self.tab_no_target_count = 0 + + if effective_target: + is_new_target = (target_hp > self.last_target_hp + 5) + if is_new_target: + self._has_braked_for_target = False + + # 1. 刹车逻辑 + if not self._has_braked_for_target and 0 < target_hp < self.last_target_hp: + hw_ctrl.keyDown('s') + time.sleep(0.05) + hw_ctrl.keyUp('s') + self._has_braked_for_target = True + + # 2. 交互逻辑 + cooldown = 2.0 if not state['combat'] else 6.0 + if is_new_target or (current_time - self.last_interaction_time > cooldown): + hw_ctrl.press(KEY_LOOT) + self.last_interaction_time = current_time + self.last_target_hp = target_hp + if state['combat']: + self.execute_combat_logic(state) + + self._was_in_combat_or_target = True + return + else: + if self._was_in_combat_or_target: + self.execute_disengage_loot() + self._was_in_combat_or_target = False + self.last_tab_time = current_time + 1.0 + self.last_target_hp = 0 + self._has_braked_for_target = False + return + + self._was_in_combat_or_target = False + self.last_target_hp = 0 + self._has_braked_for_target = False - # --- 场景 1:没有目标,按 Tab 选怪;连续 5 次无目标则随机左/右转再重试 --- - if not state['target']: - self.execute_disengage_loot() - self.target_acquired_time = None # 脱战/无目标时清零 - self.stuck_handler.reset() # 避免脱战期间保留上次站桩的计时,导致重新选到目标立刻误判卡死 self.tab_no_target_count = min(self.tab_no_target_count, 5) if self.tab_no_target_count >= 5: - # 随机左转或右转一段时间,再重新获取目标 - turn_key = random.choice(["a", "d"]) # a=左转, d=右转 - pydirectinput.keyDown(turn_key) + turn_key = random.choice(["a", "d"]) + hw_ctrl.keyDown(turn_key) time.sleep(random.uniform(0.3, 0.6)) - pydirectinput.keyUp(turn_key) + hw_ctrl.keyUp(turn_key) self.tab_no_target_count = 0 self.last_tab_time = current_time - self.last_turn_end_time = current_time # 供卡死检测排除刚转向的一小段时间 - elif current_time - self.last_tab_time > random.uniform(0.5, 1.2): - pydirectinput.press(KEY_TAB) + self.last_turn_end_time = current_time + elif current_time - self.last_tab_time > random.uniform(0.8, 1.5): + hw_ctrl.press(KEY_TAB) self.last_tab_time = current_time self.tab_no_target_count += 1 - else: - self.tab_no_target_count = 0 # 有目标时清零 - # 跑向怪阶段的卡死检测:只在目标血量为 100% 时认为是在“刚刚开怪、接近怪物”,避免残血目标也触发跑向怪卡死逻辑 - target_hp = state.get('target_hp') - if target_hp >= 100: - try: - if self.stuck_handler.check_stuck(state, self.last_turn_end_time): - print(">>> [自动打怪] 可能卡住障碍物,执行脱困") - self.stuck_handler.resolve_stuck() - self.stuck_handler.reset() - return - except Exception: - pass - - # --- 场景 2:有目标且不在战斗中,按交互键 --- - if state['target'] and not state['combat']: - if random.random() < 0.3: # 只有 30% 的循环频率触发按键,模拟真人频率 - pydirectinput.press(KEY_LOOT) - - # --- 场景 3:有目标且在战斗中,自动按技能 --- - elif state['target'] and state['combat']: - self.execute_combat_logic(state) - - # --- 场景 3:脱战且有可拾取物(需要你在 Lua 增加拾取位,见下文) --- - # if not state['in_combat'] and state['has_loot']: - # pydirectinput.press(KEY_LOOT) # 在 main 循环中使用:从 game_state 获取 state if __name__ == "__main__": @@ -155,4 +346,4 @@ if __name__ == "__main__": bot.execute_logic(state) time.sleep(0.1) except KeyboardInterrupt: - print("\n已停止。") \ No newline at end of file + print("\n已停止。") diff --git a/auto_bot_move.py b/auto_bot_move.py index 7461949..d62a71f 100644 --- a/auto_bot_move.py +++ b/auto_bot_move.py @@ -3,8 +3,11 @@ import os import random import sys import time -import pydirectinput - +import math +import ctypes +import cv2 +import numpy as np +from hardware_control import hw_ctrl from game_state import parse_game_state, load_layout_config from coordinate_patrol import CoordinatePatrol from death_manager import DeathManager @@ -20,6 +23,7 @@ DEFAULT_EAT_MAX_WAIT_SEC = 30.0 # 巡逻点配置文件 WAYPOINTS_FILE = 'waypoints.json' +WIN_TITLE = "魔兽世界" # 默认巡逻航点(waypoints.json 不存在或无效时使用) DEFAULT_WAYPOINTS = [(23.8, 71.0), (27.0, 79.0), (31.0, 72.0)] @@ -81,6 +85,88 @@ def load_attack_loop(path): return None +class CursorManager: + """通过图像识别判断鼠标图标类型""" + def __init__(self): + self.templates = {} + self.handle_cache = {} # 句柄 -> 类型缓存 + self._load_templates() + + def _load_templates(self): + # 强制使用纯相对路径,不带盘符前缀,由 Python 自动处理 CWD + cursor_dir = os.path.join('images', 'cursor') + files = { + 'Point': 'Point.PNG', + 'Attack': 'Attack.PNG', + 'LootAll': 'LootAll.PNG', + 'Skin': 'Skin.PNG' + } + for name, fname in files.items(): + path = os.path.join(cursor_dir, fname) + # 记录尝试读取的路径 + if os.path.exists(path): + try: + # 使用 np.fromfile 读取为字节流,再解码,完美避开 OpenCV 的 imread 编码 Bug + img_array = np.fromfile(path, dtype=np.uint8) + img = cv2.imdecode(img_array, cv2.IMREAD_UNCHANGED) + if img is not None: + if img.shape[2] == 3: + img = cv2.cvtColor(img, cv2.COLOR_BGR2BGRA) + self.templates[name] = img + except Exception as e: + print(f">>> [CursorMgr] 加载 {fname} 失败: {e}") + else: + print(f">>> [CursorMgr] 找不到文件: {path}") + + def get_type(self, hcursor): + if not hcursor or hcursor == 0: return 'Other', 0.0 + if hcursor in self.handle_cache: return self.handle_cache[hcursor] + res = self._identify(hcursor) + self.handle_cache[hcursor] = res + return res + + def _identify(self, hcursor): + import win32ui + try: + # 捕获 48x48 区域,留出缩放空间 + width, height = 48, 48 + hdc = win32gui.GetDC(0) + dc = win32ui.CreateDCFromHandle(hdc) + memdc = dc.CreateCompatibleDC() + bitmap = win32ui.CreateBitmap() + bitmap.CreateCompatibleBitmap(dc, width, height) + memdc.SelectObject(bitmap) + win32gui.DrawIconEx(memdc.GetSafeHdc(), 0, 0, hcursor, width, height, 0, 0, win32con.DI_NORMAL) + bits = bitmap.GetBitmapBits(True) + target = np.frombuffer(bits, dtype='uint8').reshape(height, width, 4) + memdc.DeleteDC() + win32gui.ReleaseDC(0, hdc) + + best_name = 'Other' + max_score = 0.0 + + # 多尺度匹配:尝试 0.8, 1.0, 1.2 倍缩放,解决 UI 缩放问题 + scales = [0.8, 1.0, 1.2] + for name, temp in self.templates.items(): + t_h, t_w = temp.shape[:2] + for s in scales: + s_w, s_h = int(t_w * s), int(t_h * s) + if s_w > width or s_h > height: continue + + res_temp = cv2.resize(temp, (s_w, s_h)) + res = cv2.matchTemplate(target, res_temp, cv2.TM_CCOEFF_NORMED) + _, score, _, _ = cv2.minMaxLoc(res) + if score > max_score: + max_score = score + best_name = name + + if max_score > 0.2: + print(f">>>> [雷达识别] 目标: {best_name} | 最高分: {max_score:.3f}") + return best_name, max_score + except Exception as e: + return 'Other', 0.0 + + class AutoBotMove: def __init__( self, @@ -96,14 +182,20 @@ class AutoBotMove: resurrection_waypoints_path=None, release_spirit_key=None, resurrect_key=None, + enable_mouse_loot=True, ): self.last_tab_time = 0 + self.last_interaction_time = 0 # 记录上一次按互动键的时间 + self.last_target_hp = 0 # 记录上一次的目标血量 + self._has_braked_for_target = False # 是否已经执行过刹车 self.is_running = True self.is_moving = False self.target_acquired_time = None # 本次获得目标的时间,用于仅在做「跑向怪」时做卡死检测 # 记录上一帧是否处于战斗/有目标,用于检测“刚刚脱战”的瞬间 self._was_in_combat_or_target = False self.skinning_wait_sec = float(skinning_wait_sec) if skinning_wait_sec is not None else 1.5 + self.enable_mouse_loot = enable_mouse_loot + self.cursor_mgr = CursorManager() self.food_key = (food_key or DEFAULT_FOOD_KEY).strip().lower() or DEFAULT_FOOD_KEY self.eat_hp_threshold = int(eat_hp_threshold) if eat_hp_threshold is not None else DEFAULT_EAT_HP_THRESHOLD self.eat_max_wait_sec = float(eat_max_wait_sec) if eat_max_wait_sec is not None else DEFAULT_EAT_MAX_WAIT_SEC @@ -161,15 +253,102 @@ class AutoBotMove: def execute_disengage_loot(self): """从有战斗/目标切换到完全脱战的瞬间,执行拾取 + 剥皮。""" try: - # 拾取 - pydirectinput.press(KEY_LOOT) - time.sleep(0.5) - # 剥皮 - pydirectinput.press(KEY_LOOT) - time.sleep(self.skinning_wait_sec) + # 1. 拟人化鼠标扫雷补漏拾取(根据开关决定是否执行) + if self.enable_mouse_loot: + self.mouse_sweep_loot() + else: + # 关闭扫雷时,执行基础的交互拾取 + hw_ctrl.press(KEY_LOOT) + time.sleep(0.5) + + # 2. 最后补漏剥皮(针对脚下尸体) + # hw_ctrl.press(KEY_LOOT) + # time.sleep(self.skinning_wait_sec + 0.5) except Exception: pass + def mouse_sweep_loot(self): + """支持图标识别的高精度扫雷拾取。""" + if random.random() < 0.1: return False + hwnd = win32gui.FindWindow(None, WIN_TITLE) + if not hwnd: return False + + try: + rect = win32gui.GetWindowRect(hwnd) + left, top, right, bottom = rect + center_x = left + (right - left) // 2 + center_y = top + (bottom - top) // 2 + + # 1. 强制“角落校准”采样 + win32api.SetCursorPos((left + 50, top + 50)) + time.sleep(0.2) + _, default_hcursor, _ = win32gui.GetCursorInfo() + + # 2. 获取扫瞄路径点位 + path_points = [] + path_file = get_config_path("loot_path.json") + if os.path.exists(path_file): + with open(path_file, 'r') as f: + path_points = json.load(f) + else: + # 降级方案:生成半椭圆点位 + x_scale, y_scale = 1.8, 0.8 + for r in range(50, (bottom-top)//2, 40): + angles = range(180, 360, 5) if (r//40)%2==0 else range(360, 180, -5) + for a in angles: + rad = math.radians(a) + path_points.append((int(r * math.cos(rad) * x_scale), int(r * math.sin(rad) * y_scale))) + + # 3. 开始沿路径扫瞄 + start_time = time.time() + looted_positions = [] + + for dx, dy in path_points: + if time.time() - start_time > 15.0: break + + target_x = center_x + dx + random.randint(-5, 5) + target_y = center_y + dy + random.randint(-5, 5) + + if not (left+10 < target_x < right-10 and top+10 < target_y < bottom-10): continue + if any(math.dist((target_x, target_y), pos) < 30 for pos in looted_positions): continue + + win32api.SetCursorPos((target_x, target_y)) + time.sleep(0.02) + + _, hcursor, _ = win32gui.GetCursorInfo() + if hcursor != 0 and hcursor != default_hcursor: + # 识别图标类型 + ctype_name, score = self.cursor_mgr.get_type(hcursor) + + if score > 0.7 and ctype_name in ['LootAll', 'Skin']: + print(f">>> [扫雷] 识别成功: {ctype_name} (得分: {score:.3f}), 执行右键点击") + hw_ctrl.right_click() + looted_positions.append((target_x, target_y)) + + # 根据图标类型决定等待时间 + wait_sec = 1.3 if ctype_name == 'LootAll' else self.skinning_wait_sec + time.sleep(wait_sec) + + # 等待指针恢复 + wait_start = time.time() + while time.time() - wait_start < 0.8: + _, curr_h, _ = win32gui.GetCursorInfo() + check_name, _ = self.cursor_mgr.get_type(curr_h) + if check_name == 'Point': break + time.sleep(0.1) + time.sleep(random.uniform(0.1, 0.2)) + elif score > 0.4: + # 记录一下高分但未达到门槛的识别,方便调试 + print(f">>> [扫雷] 疑似图标: {ctype_name} (得分: {score:.3f} < 门槛 0.7)") + + if self._should_stop(): break + + win32api.SetCursorPos((center_x, center_y)) + return True + except Exception as e: + print(f">>> [扫雷拾取] 出错: {e}") + return False + def execute_combat_logic(self, state): if self.attack_loop_config: cfg = self.attack_loop_config @@ -177,29 +356,29 @@ class AutoBotMove: return hp = state.get('hp') if hp is not None and cfg.get('hp_below_percent') and cfg.get('hp_key') and hp < cfg['hp_below_percent']: - pydirectinput.press(cfg['hp_key']) + hw_ctrl.press(cfg['hp_key']) time.sleep(0.2) mp = state.get('mp') if mp is not None and cfg.get('mp_below_percent') and cfg.get('mp_key') and mp < cfg['mp_below_percent']: - pydirectinput.press(cfg['mp_key']) + hw_ctrl.press(cfg['mp_key']) time.sleep(0.2) # 每次攻击前选中目标 - # pydirectinput.press(KEY_LOOT) + # hw_ctrl.press(KEY_LOOT) for step in cfg['steps']: key = step.get('key') or KEY_ATTACK delay = float(step.get('delay', 0.5)) - pydirectinput.press(key) + hw_ctrl.press(key) time.sleep(delay) return # 默认:模拟手动按键的节奏 if random.random() < 0.3: - pydirectinput.press(KEY_ATTACK) + hw_ctrl.press(KEY_ATTACK) def _start_eating(self): """开始就地吃面包恢复。""" self._eating_started_at = time.time() - pydirectinput.press(self.food_key) + hw_ctrl.press(self.food_key) def _should_keep_eating(self, state) -> bool: """ @@ -250,7 +429,8 @@ class AutoBotMove: self.patrol_controller.reset_stuck() # 勾选"包满炉石回城":按炉石后触发停止回调 if self.logistics_manager.bag_full_hearthstone: - self.logistics_manager.use_hearthstone_and_stop() + get_state_fn = (lambda: None if self._should_stop() else parse_game_state()) + self.logistics_manager.use_hearthstone_and_stop(get_state=get_state_fn) if callable(getattr(self, '_on_hearthstone_stop', None)): self._on_hearthstone_stop() return @@ -261,7 +441,9 @@ class AutoBotMove: # 3. 战斗/有目标:停止移动,执行攻击逻辑;仅在「跑向怪」短窗口内做卡死检测 effective_target = self._is_effective_target(state) + # 核心修改:只要还在战斗中,就不算“完全脱战”,即使当前没目标(可能正在 Tab 找下一个) in_combat_or_target = bool(state['combat'] or effective_target) + if in_combat_or_target: # 被动进战时立即打断进食等待,转入正常战斗流程 self._eating_started_at = None @@ -271,41 +453,52 @@ class AutoBotMove: self.patrol_controller.stop_all() self.is_moving = False self.patrol_controller.reset_stuck() - # 跑向怪阶段的卡死检测:只在目标血量为 100% 时认为是在“刚刚开怪、接近怪物”,避免残血目标也触发跑向怪卡死逻辑 - target_hp = state.get('target_hp') - if effective_target and target_hp is not None and target_hp >= 100: - try: - if self.patrol_controller.stuck_handler.check_stuck( - state, self.patrol_controller.last_turn_end_time - ): - print(">>> [战斗] 跑向怪时可能卡住障碍物,执行脱困") - self.patrol_controller.stop_all() - self.patrol_controller.stuck_handler.resolve_stuck() - self.patrol_controller.reset_stuck() - return - except Exception: - pass - # 只有在“有效目标”成立时才真正执行攻击按键 + + # 只有在有“活的目标”时才执行攻击和交互 if effective_target: - self.execute_combat_logic(state) + target_hp = state.get('target_hp', 0) + if target_hp > 0: + now = time.time() + # 识别是否切换了新目标(血量跳变) + is_new_target = (target_hp > self.last_target_hp + 5) + if is_new_target: + self._has_braked_for_target = False + + # 1. 掉血刹车逻辑:第一次发现目标掉血且正在移动,按一下 S 停住 + if not self._has_braked_for_target and 0 < target_hp < self.last_target_hp: + hw_ctrl.keyDown('s') + time.sleep(0.05) + hw_ctrl.keyUp('s') + self._has_braked_for_target = True + + # 2. 交互键(KEY_LOOT)按键策略: + cooldown = 2.0 if not state['combat'] else 6.0 + if is_new_target or (now - self.last_interaction_time > cooldown): + hw_ctrl.press(KEY_LOOT) + self.last_interaction_time = now + + self.last_target_hp = target_hp + # 执行正常的攻击循环 + self.execute_combat_logic(state) + else: + self.last_target_hp = 0 + self._has_braked_for_target = False + self._was_in_combat_or_target = True return else: - # 从“有战斗/目标”切换到“完全脱战”的瞬间:尝试智能接回前方最近巡逻点 + # 只有当 state['combat'] 和 effective_target 均为 False 时,才执行脱战逻辑 if self._was_in_combat_or_target: - # 执行脱战拾取 + # 此时已彻底脱战,执行拾取 self.execute_disengage_loot() - x, y = state.get('x'), state.get('y') - if x is not None and y is not None: - try: - current_pos = (float(x), float(y)) - # max_ahead: 前方查看 10 个点;max_dist: 最大允许接入距离 10 - self.patrol_controller.snap_to_forward_waypoint( - current_pos, max_ahead=10, max_dist=10.0, skip_current=True - ) - except Exception: - pass - self.target_acquired_time = None # 脱战/无目标时清零,下次获得目标再计时 + + # 扫尾动作执行完后,本 tick 强制结束,防止立即按下 Tab + self._was_in_combat_or_target = False + self.target_acquired_time = None + self.last_tab_time = time.time() + 1.0 # 给找怪增加 1 秒额外冷却 + return + + self.target_acquired_time = None self._was_in_combat_or_target = False # 4. 脱战低血量:就地吃面包(最多等待 30 秒或回满) @@ -325,7 +518,7 @@ class AutoBotMove: # 5. 顺便每隔几秒按一下 Tab(主动找怪) if not effective_target and (time.time() - self.last_tab_time > 2.0): - pydirectinput.press(KEY_TAB) + hw_ctrl.press(KEY_TAB) self.last_tab_time = time.time() # 在 main 循环中使用:从 game_state 获取 state @@ -351,4 +544,4 @@ if __name__ == "__main__": bot.execute_logic(state) time.sleep(0.1) except KeyboardInterrupt: - print("\n已停止。") \ No newline at end of file + print("\n已停止。") diff --git a/build.spec b/build.spec index 18bbbbe..4e7c130 100644 --- a/build.spec +++ b/build.spec @@ -16,7 +16,6 @@ a = Analysis( binaries=[], datas=added_files, hiddenimports=[ - 'pydirectinput', 'pygetwindow', 'PIL', 'PIL._tkinter_finder', diff --git a/build_wow_multikey.spec b/build_wow_multikey.spec index 762ad1f..ad80b0c 100644 --- a/build_wow_multikey.spec +++ b/build_wow_multikey.spec @@ -20,7 +20,7 @@ a = Analysis( 'game_state', 'auto_bot_move', 'auto_bot', 'recorder', 'coordinate_patrol', 'death_manager', 'logistics_manager', 'stuck_handler', 'player_movement', 'player_position', - 'pydirectinput', 'pygetwindow', 'pyautogui', 'PIL', + 'pygetwindow', 'pyautogui', 'PIL', 'flight_mode', ], hookspath=[], diff --git a/combat_loops/DK.json b/combat_loops/DK.json index 901db7f..d752b61 100644 --- a/combat_loops/DK.json +++ b/combat_loops/DK.json @@ -3,7 +3,7 @@ "trigger_chance": 0.5, "steps": [ { - "key": "4", + "key": "1", "delay": 0.5 }, { diff --git a/ddl/chm_output/CheckZoom.html b/ddl/chm_output/CheckZoom.html new file mode 100644 index 0000000..a563046 --- /dev/null +++ b/ddl/chm_output/CheckZoom.html @@ -0,0 +1,15 @@ + + + + +豸ʱᴴ̵˵ + + + +

豸ʱᴴ̵˵

+

ļģʹô豸ĺʱܻᴴ̣CheckZoom*.exeڻȡDPIйصϢȡDPIϢƶͻȡĺӰ졣ᴴ̣˵̵ļֳһͲᴴ̣
+ 1.WIN10µİ汾ֻмϵWIN10汾ᴴ̣ᡣ
+2.WIN8.1ǰϵͳDPIǰϵͳ֪ʱ򣬴豸IJУDPIģʽʹϵͳDPI֪ÿʾDPI֪WIN8.1WIN8.1ԺϵͳDPIǰÿʾDPI֪ʱ򣬴豸IJУDPIģʽʹÿʾDPI֪
+3.豸IJУDPIģʽʹ“DPI”ʱҪƶͻȡĺģʽƵģԿ豸ĺ˵

+ + \ No newline at end of file diff --git a/ddl/chm_output/DPI.html b/ddl/chm_output/DPI.html new file mode 100644 index 0000000..ad4413c --- /dev/null +++ b/ddl/chm_output/DPI.html @@ -0,0 +1,17 @@ + + + + +DPI + + + +

DPI

+

DPIͼÿӢ糤ڵص˵ļᵽDPIʾDPIDPIҪŪˡıDPIӦóĴڡwindowsϵͳʾDPIԼã“Ļֱ”“ʾ”ҵãͬϵͳõ˵е죬磺WIN7“ŴСıĿ”WIN10“ıӦõĿĴС”WIN10汾в죬Щ汾ܲһ

+

windowsΪ˼ϳDPIжãWIN8.1ǰ“DPI֪”“ϵͳDPI֪”֣WIN8.1ʼΪֶ֧ʾͬDPI“ÿʾDPI֪”ͬDPI֪Dzͬġÿ̿ԵԼDPI֪ģWIN10ÿ߳òͬDPI֪ġ

+

“DPI֪”Ϊ˼ݲ֧DPIŵijϵͳԶ򴰿ļúܲʾDPI100%ʱֻģĻйصAPIʾزһһӦϵ

+

“ϵͳDPI֪”WIN8.1ǰĻйصAPIʾһһӦϵWIN8.1ʼʾʾDPIͬ򴰿ʾлģĻйصAPIʾزһһӦϵ

+

“ÿʾDPI֪”ĻйصAPIʾһһӦϵ

+

ʾDPI100%ʱDPI֪УĻйصAPIʾضһһӦϵ

+ + \ No newline at end of file diff --git a/ddl/chm_output/FontZoom.txt b/ddl/chm_output/FontZoom.txt new file mode 100644 index 0000000..852ed9c Binary files /dev/null and b/ddl/chm_output/FontZoom.txt differ diff --git a/ddl/chm_output/QA/css/mystyle.css b/ddl/chm_output/QA/css/mystyle.css new file mode 100644 index 0000000..48ef556 --- /dev/null +++ b/ddl/chm_output/QA/css/mystyle.css @@ -0,0 +1,6 @@ +@charset "gb2312"; +body{font-size:16px; font-family:Verdana,"";} +h1{text-align:center;} +p{text-indent:2em;} +.boldfont{font-weight:bold;} +.redfont {color: #FF0000;} \ No newline at end of file diff --git a/ddl/chm_output/QA/使用windows远程桌面时无效.html b/ddl/chm_output/QA/使用windows远程桌面时无效.html new file mode 100644 index 0000000..75ffeea --- /dev/null +++ b/ddl/chm_output/QA/使用windows远程桌面时无效.html @@ -0,0 +1,14 @@ + + + + +ʹwindowsԶʱЧ + + + +

ʹwindowsԶʱЧ

+

Ҫ˵

+

1.Զ汾IJʹúӡҪԶֺ֧ӣһDzֵ֧ġԼ̼ãԳԼԶ沢еúӲꡣ

+

2.ʹԶ鿴һ̨ϲӵǿʵֵġֵIJΪʹwindowsԴԶ棬windowsԴԶֻһûʣԶ̵¼ˣͻ޷ʹõԶ

+ + \ No newline at end of file diff --git a/ddl/chm_output/QA/创建对象失败.html b/ddl/chm_output/QA/创建对象失败.html new file mode 100644 index 0000000..f932608 --- /dev/null +++ b/ddl/chm_output/QA/创建对象失败.html @@ -0,0 +1,14 @@ + + + + +ʧ + + + +

ʧ

+

1.עdllǷɹʧܶעdll⣬ɲοעdllʧĽ

+

2.עdllļ32λ64λļҪijͬϵͳ޹ء

+

3.dllļǷC̣C̺ܶļΪȨиƣȫıأЩԭ׵dllעʧܣԲƼC̡

+ + \ No newline at end of file diff --git a/ddl/chm_output/QA/找不到dll文件或函数.html b/ddl/chm_output/QA/找不到dll文件或函数.html new file mode 100644 index 0000000..2460bba --- /dev/null +++ b/ddl/chm_output/QA/找不到dll文件或函数.html @@ -0,0 +1,14 @@ + + + + +Ҳdllļ + + + +

Ҳdllļ

+

1.dllļǷźû߳еdllļ·ǷȷֻʹdllļԷڳļ·¡

+

2.dllļǷȷ32λ32λdllļ64λ64λdllļϵͳͬԡ顢TC32λɵСҲ32λġ

+

3.麯еĺǷȷĸ߶˿ո

+ + \ No newline at end of file diff --git a/ddl/chm_output/QA/是否需要注册dll文件.html b/ddl/chm_output/QA/是否需要注册dll文件.html new file mode 100644 index 0000000..20b897d --- /dev/null +++ b/ddl/chm_output/QA/是否需要注册dll文件.html @@ -0,0 +1,13 @@ + + + + +ǷҪעdllļ + + + +

ǷҪעdllļ

+

ģ֧comӿںͱ׼dllӿ(ϵͳAPIͬӿ)ʹcomӿںҪעᣬʹñ׼dllӿںעᡣ +

+ + \ No newline at end of file diff --git a/ddl/chm_output/QA/注册dll失败.html b/ddl/chm_output/QA/注册dll失败.html new file mode 100644 index 0000000..edc75d9 --- /dev/null +++ b/ddl/chm_output/QA/注册dll失败.html @@ -0,0 +1,13 @@ + + + + +עdllʧ + + + +

עdllʧ

+

1.dllļ·Ƿȷ

+

2.regsvr32עᣬҪעõregsvr3232λ64λģҪ뱻עdllͬ32λϵͳеregsvr3232λġ64λϵͳregsvr3232λ64λڲͬļУ32λregsvr32ͨ“C:\Windows\SysWow64”ļУ64λregsvr32ͨ“C:\Windows\Sytem32”ļС

+ + \ No newline at end of file diff --git a/ddl/chm_output/QA/电脑USB插口不够用.html b/ddl/chm_output/QA/电脑USB插口不够用.html new file mode 100644 index 0000000..d8c7f56 --- /dev/null +++ b/ddl/chm_output/QA/电脑USB插口不够用.html @@ -0,0 +1,12 @@ + + + + +USBڲ + + + +

USBڲ

+

Ϥ˲˵ǻЩ˲֪һ¡ʹusb hubҲusbչusbڵ裬ӿԲʹãĵ̺Ϻܶ๺ƽ̨עһusb hubƣֻڳ磬ֲӻĹĺܵͣusb hubϲӹĽϴusb豸ֻҪusb hubϲ˼ʮӣusb hubǷҪӵԴûرҪ

+ + \ No newline at end of file diff --git a/ddl/chm_output/QA/相对鼠标、相对移动、绝对鼠标、绝对移动的区别.html b/ddl/chm_output/QA/相对鼠标、相对移动、绝对鼠标、绝对移动的区别.html new file mode 100644 index 0000000..d119138 --- /dev/null +++ b/ddl/chm_output/QA/相对鼠标、相对移动、绝对鼠标、绝对移动的区别.html @@ -0,0 +1,13 @@ + + + + +ꡢƶꡢƶ + + + +

ꡢƶꡢƶ

+

;Ӳƶķʽһʵ궼꣬Ŀǰûʵо깦ܡļ޸޸ģʽ

+

ƶ;ƶǺܡƶƶָĻꡣƶƶĻƶǰĻIJֵƶΧᵼʵƶֵС䡣ƶ;ƶûбȻϵʵ־ƶʵƶ

+ + \ No newline at end of file diff --git a/ddl/chm_output/QA/调用模块中的函数时报堆栈错误.html b/ddl/chm_output/QA/调用模块中的函数时报堆栈错误.html new file mode 100644 index 0000000..1c61714 --- /dev/null +++ b/ddl/chm_output/QA/调用模块中的函数时报堆栈错误.html @@ -0,0 +1,13 @@ + + + + +ģеĺʱջ + + + +

ģеĺʱջ

+

1.dll汾Ƿȷͬ汾dllЩʱͨdll汾ű仯ʱ

+

2.麯ǷȷҪ糣64λ32λŪˡ

+ + \ No newline at end of file diff --git a/ddl/chm_output/QA/鼠标移动模式如何设置.html b/ddl/chm_output/QA/鼠标移动模式如何设置.html new file mode 100644 index 0000000..101515e --- /dev/null +++ b/ddl/chm_output/QA/鼠标移动模式如何设置.html @@ -0,0 +1,16 @@ + + + + +ƶģʽ + + + +

ƶģʽ

+

ƶģʽͨHKMSetModeSetModeãֵΪ2ʱģʽֵƶģʽɶHKMMoveToHKMMoveRHKMoveR2MoveToMoveRMoveR2ãHKMMoveRPMoveRPЧƶģʽģʽֵľֵӦ˵ԿHKMSetModeSetModeĺ˵עֵһҲǶֵϣλ㣩ֵֵܼ

+

1.Ĭֵ0ûʹHKMSetModeSetModeƶģʽʱֵ߹켣ƶͣʱӼ١

+

2.ƶߺͼӼ٣ģ˹ƶֻ׷ٶȡʹģʽֵ5(1ƶģʽ4ƶģʽ)ҪעǣʹֵʱҪʹHKMMoveToHKMoveR2MoveToMoveR2ʱȷֻûʹ“ָ뾫ȷ”“ѡָƶٶ”м䣨ƶĻı1:1ʱʹãwin10ĻDpiҪ100%

+

3.ƶߵ޼Ӽ١ʹģʽֵ12(4ƶģʽ8ģʽ)20(4ƶģʽ16ģʽ)ģʽͶģʽԿHKMSetModeSetMode˵ҪעǣʹֵʱҪʹHKMMoveToHKMoveR2MoveToMoveR2ʱҪȷֻûʹ“ָ뾫ȷ”“ѡָƶٶ”м䣨ƶĻı1:1ʱʹãwin10ĻDpiҪ100%

+

4.ƶ“ļ޸”þʹãʹģʽֵ2ƶʹþʹHKMSetModeSetModeƶģʽΪƶģʽʹHKMMoveToHKMoveR2MoveToMoveR2ƶģʽʹá޸õ“”“+”HKMMoveRMoveRЧHKMMoveR2MoveR2á

+ + \ No newline at end of file diff --git a/ddl/chm_output/ReadMe.html b/ddl/chm_output/ReadMe.html new file mode 100644 index 0000000..364a21b --- /dev/null +++ b/ddl/chm_output/ReadMe.html @@ -0,0 +1,19 @@ + + + + + + + + +

+

ļģӲϵָָм

+

ļӻֻһUSBڣڵԵҲļӻѹоƬESD˲ƷȶԺʹ֧޸USBӿϢָ֧¹̼

+

ļ׵IJģۼƶֹ߶ģֶ֧ϵͳdpiźͶʾ

+

ϵͳ֧֣windows7ԺIJϵͳ32λϵͳ64λϵͳ

+

֧֣֧32λ64λ

+

ߣ

+361
+QQȺ78281374֤Ϣhkm + + \ No newline at end of file diff --git a/ddl/chm_output/SimulationMethod.html b/ddl/chm_output/SimulationMethod.html new file mode 100644 index 0000000..e10888a --- /dev/null +++ b/ddl/chm_output/SimulationMethod.html @@ -0,0 +1,16 @@ + + + + +ֶģȵ˵ + + + +

ֶģȵ˵

+

ļģĬöģֶģЩΪijЩԭûаֶΪãҪ߶ģֶҪ޸ã޸ĵ£
+1.ƫƺHKMSetMousePosMaxOffsetSetMousePosMaxOffsetĬƫΪ0ƫƣƶʱÿζȷƶͬһ꣬Ҫóָ㸽,Ҫָ֮ƫ3ǶҪʵȷ̫СͲʵ̫пܳĿ귶Χ
+2.ƶֵȲ´β֮ҪиʱʱҪʱʱHKMDelayRndDelayRndͬʱСֵDzͬͬļʱСֵҵIJ100븽ͬļʱֵһ㣬130롣ͬˣСֵв죬Ǹοֵ
+3.ַģʽúHKMSetModeSetModeĬ0ģʽ1ģʽָܸӰСЩ2ģʽ3ģʽ֡ĸַʱֶһ
+4.ӵVIDֵǼ곧ģеĻԽ޸ijʵ̻곧ֵʹ“ļ޸”޸ġԿӲϢ˵

+ + \ No newline at end of file diff --git a/ddl/chm_output/SpeedMethod.html b/ddl/chm_output/SpeedMethod.html new file mode 100644 index 0000000..ce3b09b --- /dev/null +++ b/ddl/chm_output/SpeedMethod.html @@ -0,0 +1,18 @@ + + + + +ٶȵķ + + + +

ٶȵķ

+

Ӱٶȵ֪£

+

1.ͼ̰ʱӰ죬ʹHKMSetKeyIntervalSetKeyIntervalHKMSetMouseIntervalSetMouseInterval޸ġ

+

2.ƶٶӰ죬ʹHKMSetMouseSpeedSetMouseSpeed޸ġ

+

3.ƶģʽӰ죬ʹHKMSetModeSetMode޸ġ

+

4.ʱӰ죬ʱ“ļ޸”޸ģļӻһ̼1.10ʼ֧֣汾͵Ҫ˹ܿԼ̼

+

5.CPUʹ̫ʱҲӰٶȡ

+

6.ٶȻܶࡣ

+ + \ No newline at end of file diff --git a/ddl/chm_output/UsageMethod.html b/ddl/chm_output/UsageMethod.html new file mode 100644 index 0000000..2d4a155 --- /dev/null +++ b/ddl/chm_output/UsageMethod.html @@ -0,0 +1,36 @@ + + + + +ʹ÷ + + + +

ʹ˵

+

ļͨwyhkm.dllģƣ֧windows7ԺIJϵͳwyhkm.dllĵֱ֧׼dllӿںcomӿڡwyhkm.dllģ32λ64λ֣32λ32λģ飬64λ64λģ顣

+

׼dllӿڵĵúϵͳAPIһͲ˵ˡ

+

comӿںͳcomӿڵdllһñģҲעᣬٴ

+

COMӿڵ

+

1.ע᣺

+

עַע᷽ע᷽ע᷽дעܵ°ȫ߱⡣ע᷽дעûЩ⣬ֻڵǰЧµĽҪעᡣ

+

1)ע᷽ͬһ̨ϣģļ·仯ʱֻҪעһμɡ
+ ע᱾ģʹregsvr32ҲֱӵñģDllRegisterServerӿڡ
+ ע᱾ģvbs(ԱȨ)
+ Set wshshell = CreateObject("wscript.shell")
+ wshshell.run "regsvr32 /s ""D:\Plugin\wyhkm.dll"""
+ ޹ԱȨעģ£
+ Set wshshell = CreateObject("wscript.shell")
+ wshshell.run "regsvr32 /s /n /i:user ""D:\Plugin\wyhkm.dll"""

+

ע⣺64λϵͳʹõ32λģ飬˫ֱvbsļ64λűִִУᵼʧܡC:\Windows\SysWOW64\cmd.exeٵvbsģˡ

+

2)ע᷽ģDllInstallһ32λ1ڶ32/64λ2(32λģ32λ64λģ64λ)ֵڵ0ʱעɹvbsֱ֧ӵdllĵͲˡ

+

2.

+

+ ģеĺʹǰȴʹöú
+ ģĶvbs£
+Set wyhkm=CreateObject("wyp.hkm")

+

úӣעᣩ
+ Set wyhkm=CreateObject("wyp.hkm")
+ ver = wyhkm.GetVersion()
+ MsgBox "ģ汾" & Hex(ver), 4096

+ + \ No newline at end of file diff --git a/ddl/chm_output/UseIntoVMWare.html b/ddl/chm_output/UseIntoVMWare.html new file mode 100644 index 0000000..0ac49ef --- /dev/null +++ b/ddl/chm_output/UseIntoVMWare.html @@ -0,0 +1,29 @@ + + + + +VMWareʹõķ + + + +

VMWareʹõķ

+

VMWareͬ汾Щ죬VMWare 14Ϊ

+

1.

+

VMWareĬϲʾ,޷Ӻ,:

+

1)ʱVMWareУҪӺӵҪδ״̬Ȱرա

+

2)VMWareУѡҪӺӵȻVMWare˵ѡ->ãڵ“”Իе“Ӳ”ѡУѡ“USB”ѡұߵ“ʾUSB豸”ѡٵԻ“ȷ”ť
+
+

+

ЩãVMWare֧ӺˣûԶӺӣҪֶϣ£

+

1
+

+

2)VMWareУѡҪӺӵȻVMWare˵ѡ->ƶ豸->ӵIJƷ->(Ͽ )ӵIJƷƿ׵Ĺ߲鿴
+

+

2.

+

ļӿвӿеļ꣬Ҳвӿеļꡣ

+

2.1в

+

ڲǰãʹúӿеļͬͲ˵ˡ

+

2.2в

+

вӿеļʱƶһʹúӿеļͬƶָҪʹþ(ֻƶʱҪ)ļӻһ̼1.2.0ſʼ֧־꣬Ĭδʹúӵ׹߿ģʱҪʹHKMSetModeSetModeƶģʽҪʹHKMSetAbsMouseScrnResSetAbsMouseScrnResĻֱʣеĻֱǶ٣Ϊ٣ƶ᲻׼ȷ

+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/BSTR.html b/ddl/chm_output/com_fun/BSTR.html new file mode 100644 index 0000000..fbb221b --- /dev/null +++ b/ddl/chm_output/com_fun/BSTR.html @@ -0,0 +1,20 @@ + + + + +BSTR + + + + + + + + + + + + +
BSTR
һְϢַ
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/CheckPressedKeys.html b/ddl/chm_output/com_fun/CheckPressedKeys.html new file mode 100644 index 0000000..3d45566 --- /dev/null +++ b/ddl/chm_output/com_fun/CheckPressedKeys.html @@ -0,0 +1,55 @@ + + + + +CheckPressedKeys + + + + + + + + + + + + + + + + + + + + + + + + +
CheckPressedKeys 鰴
̡Щ¡ڳǰЩ̻ļijԭ򱻰δеĴϿˣʵ߼ϲδӰļ̡ȼһ¡
1ģʽ32λĹʽȡֵһʱȡ0Ҫͬʱʹöֵɽֵ㡣ȡֵ
+ + + + + + + + + + + + + +
ֵ˵
1صַĵϢȫӢĵϢ
2صַµϢֻµļ̼
ֵBSTR͡δ⵽бµļ“OK”ַ⵽бµļرµļϢʧܣؿַ
vbs
Dim str
+ str=wyhkm.CheckPressedKeys(1)
+ If str=vbNullString Then
+     MsgBox "ʧ",4096
+     wscript.quit
+ End If
+ If str="OK" Then
+     MsgBox "鵽" & str & "£ǰδ߼̹ϣӰΪ˻ָǣ볢µЩ",4096
+     wscript.quit
+ End If
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/Close.html b/ddl/chm_output/com_fun/Close.html new file mode 100644 index 0000000..7df095a --- /dev/null +++ b/ddl/chm_output/com_fun/Close.html @@ -0,0 +1,43 @@ + + + + +Close + + + + + + + + + + + + + + + + + + + + + + + + +
Close ر豸
رOpen򿪵豸вʱʹô˺ر豸ͷռõԴ
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+    wscript.quit
+ End If
+ 'ִв
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/DelayRnd.html b/ddl/chm_output/com_fun/DelayRnd.html new file mode 100644 index 0000000..43c3f8d --- /dev/null +++ b/ddl/chm_output/com_fun/DelayRnd.html @@ -0,0 +1,46 @@ + + + + +DelayRnd + + + + + + + + + + + + + + + + + + + + + + + + +
DelayRnd ʱ
һ趨ʱ䷶ΧʱʹOpen豸ſʹ
1ʱ䣺32λλ롣
+ 2ʱ䣺32λλ롣ʱʱʱʱǹ̶ֵ
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ wyhkm.LeftDown
+ wyhkm.DelayRnd 90,120
+ wyhkm.LeftUp
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/EnableOSMouseAccelerate.html b/ddl/chm_output/com_fun/EnableOSMouseAccelerate.html new file mode 100644 index 0000000..bed9608 --- /dev/null +++ b/ddl/chm_output/com_fun/EnableOSMouseAccelerate.html @@ -0,0 +1,33 @@ + + + + +EnableOSMouseAccelerate + + + + + + + + + + + + + + + + + + + + + + + + +
EnableOSMouseAccelerate ͣϵͳ
ֹͣϵͳٹܡϵͳٹϵͳе“ָ뾫ȷ”Ĭǿġƶʱϵͳи죬ƶʱϵͳиϵͳеƶ벻ǹ̶ı
1Ƿֵȡtrueʱϵͳ٣ȡfalseʱֹͣϵͳ١
+2Ƿ񱣴棺ֵȡtrueʱϵͳȻЧȡfalseʱϵͳָá
ֵֵɹtrueʧܷfalse
vbs
EnableOSMouseAccelerate(false,false)
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/GetCursorPos.html b/ddl/chm_output/com_fun/GetCursorPos.html new file mode 100644 index 0000000..b14ff97 --- /dev/null +++ b/ddl/chm_output/com_fun/GetCursorPos.html @@ -0,0 +1,48 @@ + + + + +GetCursorPos + + + + + + + + + + + + + + + + + + + + + + + + +
GetCursorPos
òϵͳеꡣʹOpen豸ſʹ
1꣺ͣ32λַڽꡣ
+ 2꣺ͣ32λַڽꡣ
ֵֵɹtrueʧܷfalse
vbs
Dim DevId,x,y
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.GetCursorPos(x,y) Then
+     MsgBox "ʧ\n",4096
+    wscript.quit
+ End If
+ MsgBox "꣺"&CStr(x)&","&CStr(y),4096
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/GetCursorPos2.html b/ddl/chm_output/com_fun/GetCursorPos2.html new file mode 100644 index 0000000..6c18d98 --- /dev/null +++ b/ddl/chm_output/com_fun/GetCursorPos2.html @@ -0,0 +1,52 @@ + + + + +GetCursorPos2 + + + + + + + + + + + + + + + + + + + + + + + + +
GetCursorPos2
òϵͳеꡣGetCursorPosȫֻͬΪ˽Բֲַ֧⡣ʹOpen豸ſʹ
 
ֵ32λ16λǺ꣬16λꡣ
vbs
Function GetX(pos)
+     GetX=CInt("&h" & Hex(pos And &h0000FFFF&))
+ End Function
+
+Function GetY(pos)
+    GetY=CInt((pos And &hFFFF0000&)/&h10000&)
+End Function
+
+ Dim DevId,pos
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ pos=wyhkm.GetCursorPos2()
+ MsgBox "꣺"&CStr(GetX(pos))&","&CStr(GetY(pos)),4096
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/GetDevInfo.html b/ddl/chm_output/com_fun/GetDevInfo.html new file mode 100644 index 0000000..6b33f3f --- /dev/null +++ b/ddl/chm_output/com_fun/GetDevInfo.html @@ -0,0 +1,86 @@ + + + + +GetDevInfo + + + + + + + + + + + + + + + + + + + + + + + + +
GetDevInfo 豸Ϣ
ļӵ豸Ϣļӻһִ֧˺ʹOpen豸ſʹ
1ţ32λҪȡϢšȡֵ£
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
˵
1豸͡ļӻһ1ļӻ2
2̼汾ֵУ0-15λ޶ţ16-23λǸ汾ţ24-31λ汾š
3ʱ䡣ֵǴͨ߸λʼеĺϵ͸λ㡣ϵͳʱʱʱ侫Ȳߣ
4ͨʱ䡣ֵǴͨ翪ʼеĺϵ㣬λ㡣ϵͳʱʱʱ侫Ȳߣ
6λ
7״̬豸δӷ-1豸׼з0״̬1༭״̬2ֹ״̬3
8USB豸ӿڵVIDֵ
9USB豸ӿڵPIDֵ
10USB豸ӿڵ豸汾ֵ
+2Ƿ꣺ֵȡfalseʱԶ豸Ϣͬʱмģʽģʽ豸üģʽ豸ϢȡtrueʱԶ豸Ϣͬʱмģʽģʽ豸ģʽ豸Ϣ
ֵ32λֵɲ1
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ MsgBox "ļӹ̼汾ţ" & Hex(wyhkm.GetDevInfo(2,false)),4096
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/GetDevString.html b/ddl/chm_output/com_fun/GetDevString.html new file mode 100644 index 0000000..3957876 --- /dev/null +++ b/ddl/chm_output/com_fun/GetDevString.html @@ -0,0 +1,58 @@ + + + + +GetDevString + + + + + + + + + + + + + + + + + + + + + + + + +
GetDevString 豸ַ
豸صַʹOpen豸ſʹ
1ţ32λҪȡַšȡֵ£
+ + + + + + + + + + + + + +
ֵ˵
1
2Ʒ
+2Ƿ꣺ֵȡfalseʱԶ豸ַͬʱмģʽģʽ豸üģʽ豸ַȡtrueʱԶ豸ַͬʱмģʽģʽ豸ģʽ豸ַ
ֵ BSTR͡ʧܷؿַ
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ MsgBox "ļ̣" & wyhkm.GetDevString(1,false),4096
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/GetError.html b/ddl/chm_output/com_fun/GetError.html new file mode 100644 index 0000000..11311f4 --- /dev/null +++ b/ddl/chm_output/com_fun/GetError.html @@ -0,0 +1,131 @@ + + + + +GetError + + + + + + + + + + + + + + + + + + + + + + + + +
GetError ô
ô롣Ҫô豸йغִкִиúִ豸йغḲ֮ǰֵʹOpen豸ſʹ
 
ֵ32λ16λǴ룬16λǴšУ0dzɹ57344ϵͳ룬ϵͳAPI“GetLastError”õֵֵͬĽͿ΢վ鿴ڻ57344Ĵ£
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ֵ˵ֵ˵
0000(0)ɹE020(57376)豸ʧ
E001(57345)ʧE021(57377)ͨʧ
E002(57346)ЧIJE022(57378)޷Ȩ
E003(57347)ЧָE023(57379)ʱ
E004(57348)ЧĶE024(57380)Ӧʧ
E005(57349)ЧijʼֵE025(57381)
E006(57350)ЧE026(57382)ȡDPIϢʧ
E007(57351)̫E027(57383)ȡʧ
E008(57352)ַ̫E028(57384)豸ʧ
E009(57353)̫СE029(57385)豸ʱ
E00A(57354)֧  
E00B(57355)Ѵ  
E00C(57356)ϵͳ  
vbs
+
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+wyhkm.MoveR 100,50
+MsgBox "룺" & wyhkm.GetError(),4096
+wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/GetKeyboardLEDState.html b/ddl/chm_output/com_fun/GetKeyboardLEDState.html new file mode 100644 index 0000000..cbe7c11 --- /dev/null +++ b/ddl/chm_output/com_fun/GetKeyboardLEDState.html @@ -0,0 +1,67 @@ + + + + +GetKeyboardLEDState + + + + + + + + + + + + + + + + + + + + + + + + +
GetKeyboardLEDState üLED״̬
üNum LockCaps LockScroll LockƵ״̬ʹOpen豸ſʹ
1̵ƣ32λȡֵ£
+ + + + + + + + + + + + + + + + + +
ֵ˵
0Num Lock
1Caps Lock
2Scroll Lock
ֵֵtrue𷵻false
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ If + wyhkm.GetKeyboardLEDState(0) Then
+     MsgBox "NumLock",4096
+ Else
+     MsgBox "NumLock",4096
+ End If +
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/GetKeyboardMode.html b/ddl/chm_output/com_fun/GetKeyboardMode.html new file mode 100644 index 0000000..de9116b --- /dev/null +++ b/ddl/chm_output/com_fun/GetKeyboardMode.html @@ -0,0 +1,61 @@ + + + + +GetKeyboardMode + + + + + + + + + + + + + + + + + + + + + + + + +
GetKeyboardMode ģʽ
ļӵļģʽļӻĹ̼汾ڵ1.1.0ִ֧˺ʹOpen豸ſʹ
 
ֵ32λģʽʧܷ-1ɹֵ£
+ + + + + + + + + + + + + + + + + +
ֵ˵
0޼
1ͨ
5Ϸ
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ MsgBox "ģʽ" & CStr(wyhkm.GetKeyboardMode()),4096
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/GetMouseMode.html b/ddl/chm_output/com_fun/GetMouseMode.html new file mode 100644 index 0000000..4c3cc53 --- /dev/null +++ b/ddl/chm_output/com_fun/GetMouseMode.html @@ -0,0 +1,73 @@ + + + + +GetMouseMode + + + + + + + + + + + + + + + + + + + + + + + + +
GetMouseMode ģʽ
ļӵģʽļӻһĹ̼汾ڵ1.2.0ִ֧˺ʹOpen豸ſʹ
 
ֵ32λģʽʧܷ-1ɹֵ£
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ֵ˵
0
1
2
3+
5Ϸ
7Ϸ+
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ MsgBox "ģʽ" & CStr(wyhkm.GetMouseMode()),4096
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/GetOSMouseSpeed.html b/ddl/chm_output/com_fun/GetOSMouseSpeed.html new file mode 100644 index 0000000..5135dc6 --- /dev/null +++ b/ddl/chm_output/com_fun/GetOSMouseSpeed.html @@ -0,0 +1,32 @@ + + + + +GetOSMouseSpeed + + + + + + + + + + + + + + + + + + + + + + + + +
GetOSMouseSpeed ϵͳٶ
ϵͳٶȡϵͳٶϵͳе“ѡָƶٶ”õƶٶϵͳƶٶȵı
 
ֵ32λɹʱֵķΧ1-20ֵԽϵͳеٶԽ죬ϵͳĬֵ10ʧܷ0
vbs
MsgBox "ϵͳٶȣ" & wyhkm.GetOSMouseSpeed(),4096
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/GetSerialNumber.html b/ddl/chm_output/com_fun/GetSerialNumber.html new file mode 100644 index 0000000..99f3d23 --- /dev/null +++ b/ddl/chm_output/com_fun/GetSerialNumber.html @@ -0,0 +1,43 @@ + + + + +GetSerialNumber + + + + + + + + + + + + + + + + + + + + + + + + +
GetSerialNumber к
ļӵкšʹOpen豸ſʹ
1Ƿ꣺ֵȡfalseʱԶ豸кţͬʱмģʽģʽ豸üģʽ豸кšȡtrueʱԶ豸кţͬʱмģʽģʽ豸ģʽ豸кš
ֵ32λ
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ MsgBox "ļкţ" & Hex(wyhkm.GetSerialNumber(false)),4096
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/GetVersion.html b/ddl/chm_output/com_fun/GetVersion.html new file mode 100644 index 0000000..b5d7e67 --- /dev/null +++ b/ddl/chm_output/com_fun/GetVersion.html @@ -0,0 +1,32 @@ + + + + +GetVersion + + + + + + + + + + + + + + + + + + + + + + + + +
GetVersion õǰģ汾
õǰģ汾
 
ֵ32λ0-15λ޶ţ16-23λǸ汾ţ24-31λ汾š
vbs
MsgBox "汾ţ" & Hex(wyhkm.GetVersion()),4096
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/IsKeyBusy.html b/ddl/chm_output/com_fun/IsKeyBusy.html new file mode 100644 index 0000000..ee24316 --- /dev/null +++ b/ddl/chm_output/com_fun/IsKeyBusy.html @@ -0,0 +1,47 @@ + + + + +IsKeyBusy + + + + + + + + + + + + + + + + + + + + + + + + +
IsKeyBusy жϼǷæ
жļӵļǷæʹOpen豸ſʹ
 
ֵֵætrueзfalse
vbs

Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ If wyhkm.IsKeyBusy() Then
+     MsgBox "ļӼ̷æ",4096
+ Else
+     MsgBox "ļӼ̿",4096
+ End If
+ wyhkm.Close

+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/IsKeyDown.html b/ddl/chm_output/com_fun/IsKeyDown.html new file mode 100644 index 0000000..d7feaee --- /dev/null +++ b/ddl/chm_output/com_fun/IsKeyDown.html @@ -0,0 +1,47 @@ + + + + +IsKeyDown + + + + + + + + + + + + + + + + + + + + + + + + +
IsKeyDown жϼǷ
жļӵļ̵ļǷ¡ʹOpen豸ſʹ
1ͣ32λBSTRͣʹ32λʹBSTR͡Ͱɲ鿴
ֵֵ·trueû»ʧܷfalse
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ wyhkm.KeyDown "Alt"
+ MsgBox "Alt״̬:" & CStr(wyhkm.IsKeyDown("Alt"))
+ wyhkm.DelayRnd 90,120
+ wyhkm.KeyUp "Alt"
+ MsgBox "Alt״̬:" & CStr(wyhkm.IsKeyDown("Alt"))
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/IsMouseBusy.html b/ddl/chm_output/com_fun/IsMouseBusy.html new file mode 100644 index 0000000..8484ca0 --- /dev/null +++ b/ddl/chm_output/com_fun/IsMouseBusy.html @@ -0,0 +1,47 @@ + + + + +IsMouseBusy + + + + + + + + + + + + + + + + + + + + + + + + +
IsMouseBusy жǷæ
жļӵǷæʹOpen豸ſʹ
 
ֵֵætrueзfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+If wyhkm.IsMouseBusy() Then
+    MsgBox "ļӼ̷æ",4096
+Else
+    MsgBox "ļӼ̿",4096
+End If
+wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/IsMouseButtonDown.html b/ddl/chm_output/com_fun/IsMouseButtonDown.html new file mode 100644 index 0000000..3183347 --- /dev/null +++ b/ddl/chm_output/com_fun/IsMouseButtonDown.html @@ -0,0 +1,65 @@ + + + + +IsMouseButtonDown + + + + + + + + + + + + + + + + + + + + + + + + +
IsMouseButtonDown жǷ
жļӵļǷ¡ʹOpen豸ſʹ
132λȡֵ¡
+ + + + + + + + + + + + + + + + + +
˵
0
1Ҽ
2м
ֵֵ·trueû»ʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+wyhkm.LeftDown
+MsgBox "״̬:" & CStr(wyhkm.IsMouseButtonDown(0))
+wyhkm.DelayRnd 90,120
+wyhkm.LeftUp
+MsgBox "״̬:" & CStr(wyhkm.IsMouseButtonDown(0))
+wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/IsOSMouseAccelerateEnabled.html b/ddl/chm_output/com_fun/IsOSMouseAccelerateEnabled.html new file mode 100644 index 0000000..6bc129b --- /dev/null +++ b/ddl/chm_output/com_fun/IsOSMouseAccelerateEnabled.html @@ -0,0 +1,36 @@ + + + + +IsOSMouseAccelerateEnabled + + + + + + + + + + + + + + + + + + + + + + + + +
IsOSMouseAccelerateEnabled жǷϵͳ
жǷϵͳٹܡϵͳٹϵͳе“ָ뾫ȷ”Ĭǿġƶʱϵͳи죬ƶʱϵͳиϵͳеƶ벻ǹ̶ı
 
ֵֵѿϵͳٷtrueδϵͳٷfalse
vbs
If IsOSMouseAccelerateEnabled() Then
+     MsgBox "ѿϵͳ",4096
+ Else
+     MsgBox "δϵͳ",4096
+ End If
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/IsOpen.html b/ddl/chm_output/com_fun/IsOpen.html new file mode 100644 index 0000000..5a3f67d --- /dev/null +++ b/ddl/chm_output/com_fun/IsOpen.html @@ -0,0 +1,65 @@ + + + + +IsOpen + + + + + + + + + + + + + + + + + + + + + + + + +
IsOpen ж豸Ƿ
ж豸ǷѾOpen򿪡
132λȡֵһҪͬʱʹöֵɽֵ㡣ȡֵ
+ + + + + + + + + + + + + + + + + +
ֵ˵
0ж豸Ƿ񱻴򿪣󡢼̻ģʽ豸ԣֵͬʱʹã
1жϼǷ񱻴򿪣߼ģʽ豸
2жǷ񱻴򿪣ģʽ豸
ֵֵѴ򿪷trueδ򿪷false
vbs

Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ If wyhkm.IsOpen(0) Then
+     MsgBox "ļѴ",4096
+ Else
+     MsgBox "ļδ",4096
+ End If
+ wyhkm.Close

+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/KeyDown.html b/ddl/chm_output/com_fun/KeyDown.html new file mode 100644 index 0000000..9f1a63f --- /dev/null +++ b/ddl/chm_output/com_fun/KeyDown.html @@ -0,0 +1,45 @@ + + + + +KeyDown + + + + + + + + + + + + + + + + + + + + + + + + +
KeyDown ̰
̵ļ¡ʹOpen豸ſʹ
1ͣ32λBSTRͣʹ32λʹBSTR͡Ͱɲ鿴ַ֧ϼϼİ“+”ӣ磺“Ctrl+C”
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ wyhkm.KeyDown "F1"
+ wyhkm.DelayRnd 90,120
+ wyhkm.KeyUp "F1"
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/KeyPress.html b/ddl/chm_output/com_fun/KeyPress.html new file mode 100644 index 0000000..6c7dbaa --- /dev/null +++ b/ddl/chm_output/com_fun/KeyPress.html @@ -0,0 +1,43 @@ + + + + +KeyPress + + + + + + + + + + + + + + + + + + + + + + + + +
KeyPress ̰
̵ļٵʹOpen豸ſʹṵ̈º͵ʱʹSetKeyInterval
1ͣ32λBSTRͣʹ32λʹBSTR͡Ͱɲ鿴ַ֧ϼϼİ“+”ӣ磺“Ctrl+C”
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+ wyhkm.KeyPress "F1"
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/KeyUp.html b/ddl/chm_output/com_fun/KeyUp.html new file mode 100644 index 0000000..18998fa --- /dev/null +++ b/ddl/chm_output/com_fun/KeyUp.html @@ -0,0 +1,46 @@ + + + + +KeyUp + + + + + + + + + + + + + + + + + + + + + + + + +
KeyUp ̵
̵ļʹOpen豸ſʹ
1ͣ32λBSTRͣʹ32λʹBSTR͡Ͱɲ鿴ַ֧ϼϼİ“+”ӣ磺“Ctrl+C”
ֵֵɹtrueʧܷfalse
vbs
+
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+wyhkm.KeyDown "F1"
+wyhkm.DelayRnd 90,120
+wyhkm.KeyUp "F1"
+wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/LeftClick.html b/ddl/chm_output/com_fun/LeftClick.html new file mode 100644 index 0000000..1af1dae --- /dev/null +++ b/ddl/chm_output/com_fun/LeftClick.html @@ -0,0 +1,43 @@ + + + + +LeftClick + + + + + + + + + + + + + + + + + + + + + + + + +
LeftClick
ʹOpen豸ſʹº͵ʱʹSetMouseInterval
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+ wyhkm.LeftClick
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/LeftDoubleClick.html b/ddl/chm_output/com_fun/LeftDoubleClick.html new file mode 100644 index 0000000..02b258a --- /dev/null +++ b/ddl/chm_output/com_fun/LeftDoubleClick.html @@ -0,0 +1,43 @@ + + + + +LeftDoubleClick + + + + + + + + + + + + + + + + + + + + + + + + +
LeftDoubleClick ˫
˫ʹOpen豸ſʹº͵ʱʹSetMouseInterval
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+wyhkm.LeftDoubleClick
+wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/LeftDown.html b/ddl/chm_output/com_fun/LeftDown.html new file mode 100644 index 0000000..cb7ef2b --- /dev/null +++ b/ddl/chm_output/com_fun/LeftDown.html @@ -0,0 +1,45 @@ + + + + +LeftDown + + + + + + + + + + + + + + + + + + + + + + + + +
LeftDown
¡ʹOpen豸ſʹ
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+ wyhkm.LeftDown
+ wyhkm.DelayRnd 90,120
+ wyhkm.LeftUp
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/LeftUp.html b/ddl/chm_output/com_fun/LeftUp.html new file mode 100644 index 0000000..e9cf2ad --- /dev/null +++ b/ddl/chm_output/com_fun/LeftUp.html @@ -0,0 +1,45 @@ + + + + +LeftUp + + + + + + + + + + + + + + + + + + + + + + + + +
LeftUp
ʹOpen豸ſʹ
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+wyhkm.LeftDown
+wyhkm.DelayRnd 90,120
+wyhkm.LeftUp
+wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/MiddleClick.html b/ddl/chm_output/com_fun/MiddleClick.html new file mode 100644 index 0000000..fdc4f28 --- /dev/null +++ b/ddl/chm_output/com_fun/MiddleClick.html @@ -0,0 +1,43 @@ + + + + +MiddleClick + + + + + + + + + + + + + + + + + + + + + + + + +
MiddleClick м
мʹOpen豸ſʹº͵ʱʹSetMouseInterval
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+wyhkm.MiddleClick
+wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/MiddleDoubleClick.html b/ddl/chm_output/com_fun/MiddleDoubleClick.html new file mode 100644 index 0000000..c230873 --- /dev/null +++ b/ddl/chm_output/com_fun/MiddleDoubleClick.html @@ -0,0 +1,43 @@ + + + + +MiddleDoubleClick + + + + + + + + + + + + + + + + + + + + + + + + +
MiddleDoubleClick м˫
м˫ʹOpen豸ſʹº͵ʱʹSetMouseInterval
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+wyhkm.MiddleDoubleClick
+wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/MiddleDown.html b/ddl/chm_output/com_fun/MiddleDown.html new file mode 100644 index 0000000..c6cc0a6 --- /dev/null +++ b/ddl/chm_output/com_fun/MiddleDown.html @@ -0,0 +1,45 @@ + + + + +MiddleDown + + + + + + + + + + + + + + + + + + + + + + + + +
MiddleDown м
м¡ʹOpen豸ſʹ
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+wyhkm.MiddleDown
+wyhkm.DelayRnd 90,120
+wyhkm.MiddleUp
+wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/MiddleUp.html b/ddl/chm_output/com_fun/MiddleUp.html new file mode 100644 index 0000000..0fc1d85 --- /dev/null +++ b/ddl/chm_output/com_fun/MiddleUp.html @@ -0,0 +1,45 @@ + + + + +MiddleUp + + + + + + + + + + + + + + + + + + + + + + + + +
MiddleUp м
мʹOpen豸ſʹ
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+wyhkm.MiddleDown
+wyhkm.DelayRnd 90,120
+wyhkm.MiddleUp
+wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/MouseWheel.html b/ddl/chm_output/com_fun/MouseWheel.html new file mode 100644 index 0000000..02e305a --- /dev/null +++ b/ddl/chm_output/com_fun/MouseWheel.html @@ -0,0 +1,43 @@ + + + + +MouseWheel + + + + + + + + + + + + + + + + + + + + + + + + +
MouseWheel
ֹʹOpen豸ſʹصúSetMode
132λǹֹϹ¹Ǹ
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ wyhkm.MouseWheel 3
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/MouseWheelP.html b/ddl/chm_output/com_fun/MouseWheelP.html new file mode 100644 index 0000000..e2302c7 --- /dev/null +++ b/ddl/chm_output/com_fun/MouseWheelP.html @@ -0,0 +1,43 @@ + + + + +MouseWheelP + + + + + + + + + + + + + + + + + + + + + + + + +
MouseWheelP
ײĹֹUSBײһιֹһĴ127(ֶοֵ3)ڸʹԼʵֹʹOpen豸ſʹصúSetMode
132λǹֹϹ¹Ǹ
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ wyhkm.MouseWheelP 3
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/MoveR.html b/ddl/chm_output/com_fun/MoveR.html new file mode 100644 index 0000000..92e68ca --- /dev/null +++ b/ddl/chm_output/com_fun/MoveR.html @@ -0,0 +1,44 @@ + + + + +MoveR + + + + + + + + + + + + + + + + + + + + + + + + +
MoveR ƶ
ƶʹOpen豸ſʹƶƶϵͳĬʹ٣ʵƶĻƶ벻ͬϵͳ㷨Ӱ죬ƶͬʱƶľҲǹ̶ġɹرϵͳ(ָ뾫ȷ)ƶ׼⡣صúSetMode
1꣺32λƶĺꡣ
+ 2꣺32λƶꡣ
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+wyhkm.MoveR 100,50
+wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/MoveR2.html b/ddl/chm_output/com_fun/MoveR2.html new file mode 100644 index 0000000..2782438 --- /dev/null +++ b/ddl/chm_output/com_fun/MoveR2.html @@ -0,0 +1,44 @@ + + + + +MoveR2 + + + + + + + + + + + + + + + + + + + + + + + + +
MoveR2 ƶ
ƶʹOpen豸ſʹMoveRϵͳĬϵӰƶ⣬ȱDzϵͳλصúSetModeSetAbsMouseScrnRes
1꣺32λƶĺꡣ
+ 2꣺32λƶꡣ
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+wyhkm.MoveR2 100,50
+wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/MoveRP.html b/ddl/chm_output/com_fun/MoveRP.html new file mode 100644 index 0000000..8875a13 --- /dev/null +++ b/ddl/chm_output/com_fun/MoveRP.html @@ -0,0 +1,44 @@ + + + + +MoveRP + + + + + + + + + + + + + + + + + + + + + + + + +
MoveRP ƶ
ײƶʹOpen豸ſʹUSBײһƶڸʹԼʵƶΪͨΪϷƶ벻ͬͨһƶ붼127(ƶ꣬Ļ)Ϸһƶ붼32767
1꣺32λƶĺꡣ
+ 2꣺32λƶꡣ
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ wyhkm.MoveRP 100,50
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/MoveTo.html b/ddl/chm_output/com_fun/MoveTo.html new file mode 100644 index 0000000..bf8a8ee --- /dev/null +++ b/ddl/chm_output/com_fun/MoveTo.html @@ -0,0 +1,44 @@ + + + + +MoveTo + + + + + + + + + + + + + + + + + + + + + + + + +
MoveTo ƶ
ƶָĻꡣʹOpen豸ſʹصúSetModeSetMousePosPrecisionSetMouseMoveTimeoutSetMousePosMaxOffsetSetAbsMouseScrnRes
1꣺32λҪƶĺꡣ
+ 2꣺32λҪƶꡣ
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+wyhkm.MoveTo 100,50
+wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/Open.html b/ddl/chm_output/com_fun/Open.html new file mode 100644 index 0000000..45d6cad --- /dev/null +++ b/ddl/chm_output/com_fun/Open.html @@ -0,0 +1,70 @@ + + + + +Open + + + + + + + + + + + + + + + + + + + + + + + + +
Open 豸
ļӣԱвٲ豸ʱӦùر豸ͷռõԴҪر豸ʹCloseʹʱעƶ𣩣ϵͳĻ÷仯ʱҪ´豸ȹر豸ٴ豸磺ĻֱʻĻDPI()仯ָٶȻ“ָ뾫ȷ”仯
1豸ID32λʹSearchDeviceSearchDevice2Ի
+ 2DPIģʽ32λƶMoveToMoveR2ͻ꣨GetCursorPosGetCursorPos2ʱʹõDPIģʽϵͳΪֳ֧ţʹ˲ͬ꣬ͬDPIģʽӦͬ㷽ʽDPIģʽеǰֶwindowsϵͳеģʽɲ΢˽ϸݣ漸ģʽı仯ȡֵ
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ֵ˵
0ÿʾDPI֪ģʽϵͳDPIúʾDPIӰ죬ÿʾһһӦģwindowsϵͳWIN8.1ʼִ֧ģʽWIN8.1ǰЧϵͳDPI֪
1ϵͳDPI֪WIN8.1ǰϵͳÿʾһһӦģWIN8.1WIN8.1ԺϵͳÿʾòͬDPIÿʾزһһӦϵֻһʾҿעص¼ûĹDPIÿʾػһһӦġ
2DPI֪ûдDPIʱ״̬̰ϵͳDPIʾDPI100%ʱ״̬ϵͳԿǣDPI100%ʱһDPI100%ʱᵼ³ģ
3DPIãģʽҪĿDzͷźִDPI̡ڷϵ£ЧÿʾDPI֪ڲϵ£DPI任޷ϵǣWIN8.1ǰϵͳϵͳDPI100%ߵǰĵDPI֪ϵͳDPI֪WIN8.1WIN8.1ԺϵͳʾDPI100%ʱǰĵDPI֪ÿʾDPI֪ʱ
4ǰĵDPI֪ݵǰľDPI֪
ֵֵɹtrueʧܷfalseWIN10ǰϵͳʧԭڰȫػϵͳȨ⵼DPIʧܣ԰Ѳ2Ϊ3ģDPIֽ֧⡣
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ 'ִв
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/Open2.html b/ddl/chm_output/com_fun/Open2.html new file mode 100644 index 0000000..c255a1a --- /dev/null +++ b/ddl/chm_output/com_fun/Open2.html @@ -0,0 +1,76 @@ + + + + +Open2 + + + + + + + + + + + + + + + + + + + + + + + + +
Open2 豸
ļӣԱвٲ豸ʱӦùر豸ͷռõԴҪر豸ʹCloseʹʱעƶ𣩣ϵͳĻ÷仯ʱҪ´豸ȹر豸ٴ豸磺ĻֱʻĻDPI()仯ָٶȻ“ָ뾫ȷ”仯
1һ豸ID32λʹSearchDeviceSearchDevice2Ի
+ 2ڶ豸ID32λʹSearchDeviceSearchDevice2Ի
+ 3DPIģʽ32λƶMoveToMoveR2ͻ꣨GetCursorPosGetCursorPos2ʱʹõDPIģʽϵͳΪֳ֧ţʹ˲ͬ꣬ͬDPIģʽӦͬ㷽ʽDPIģʽеǰֶwindowsϵͳеģʽɲ΢˽ϸݣ漸ģʽı仯ȡֵ
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ֵ˵
0ÿʾDPI֪ģʽϵͳDPIúʾDPIӰ죬ÿʾһһӦģwindowsϵͳWIN8.1ʼִ֧ģʽWIN8.1ǰЧϵͳDPI֪
1ϵͳDPI֪WIN8.1ǰϵͳÿʾһһӦģWIN8.1WIN8.1ԺϵͳÿʾòͬDPIÿʾزһһӦϵֻһʾҿעص¼ûĹDPIÿʾػһһӦġ
2DPI֪ûдDPIʱ״̬̰ϵͳDPIʾDPI100%ʱ״̬ϵͳԿǣDPI100%ʱһDPI100%ʱᵼ³ģ
3DPIãģʽҪĿDzͷźִDPI̡ڷϵ£ЧÿʾDPI֪ڲϵ£DPI任޷ϵǣWIN8.1ǰϵͳϵͳDPI100%ߵǰĵDPI֪ϵͳDPI֪WIN8.1WIN8.1ԺϵͳʾDPI100%ʱǰĵDPI֪ÿʾDPI֪ʱ
4ǰĵDPI֪ݵǰľDPI֪
ֵֵɹtrueʧܷfalseWIN10ǰϵͳʧԭڰȫػϵͳȨ⵼DPIʧܣ԰Ѳ3Ϊ3ģDPIֽ֧⡣
vbs
Dim DevId1,DevId2
+ DevId1=wyhkm.SearchDevice(&h1234&,&hABCD&,2)
+ If DevId1=-1 Then
+     MsgBox "δҵļ(ģʽ)",4096
+     wscript.quit
+ End If
+ DevId2=wyhkm.SearchDevice(&h1234&,&hABCD&,3)
+If DevId2=-1 Then
+    MsgBox "δҵļ(ģʽ)",4096
+    wscript.quit
+End If
+ If Not wyhkm.Open2(DevId1,DevId2,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ 'ִв
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/OutputString.html b/ddl/chm_output/com_fun/OutputString.html new file mode 100644 index 0000000..0b12e8f --- /dev/null +++ b/ddl/chm_output/com_fun/OutputString.html @@ -0,0 +1,43 @@ + + + + +OutputString + + + + + + + + + + + + + + + + + + + + + + + + +
OutputString ַ
ҪıĵطַʹOpen豸ſʹַģʽʹSetModeٶʹSetKeyInterval룬Ҫ޸ַģʽҪע⵱ǰ뷨е뷨֧룬޷ȫ޷⡣
BSTR͡Ҫַ
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ wyhkm.OutputString "ַ"
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/ReleaseKeyboard.html b/ddl/chm_output/com_fun/ReleaseKeyboard.html new file mode 100644 index 0000000..a1fbd5c --- /dev/null +++ b/ddl/chm_output/com_fun/ReleaseKeyboard.html @@ -0,0 +1,45 @@ + + + + +ReleaseKeyboard + + + + + + + + + + + + + + + + + + + + + + + + +
ReleaseKeyboard ͷż̰
ļм̰µļȫʹOpen豸ſʹ

ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ wyhkm.KeyDown "A"
+ wyhkm.DelayRnd 90,120
+ wyhkm.ReleaseKeyboard
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/ReleaseMouse.html b/ddl/chm_output/com_fun/ReleaseMouse.html new file mode 100644 index 0000000..9c3de68 --- /dev/null +++ b/ddl/chm_output/com_fun/ReleaseMouse.html @@ -0,0 +1,45 @@ + + + + +ReleaseMouse + + + + + + + + + + + + + + + + + + + + + + + + +
ReleaseMouse ͷ갴
ļ갴µļȫʹOpen豸ſʹ

ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+ wyhkm.LeftDown
+ wyhkm.DelayRnd 90,120
+ wyhkm.ReleaseMouse
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/RightClick.html b/ddl/chm_output/com_fun/RightClick.html new file mode 100644 index 0000000..7dfab84 --- /dev/null +++ b/ddl/chm_output/com_fun/RightClick.html @@ -0,0 +1,43 @@ + + + + +RightClick + + + + + + + + + + + + + + + + + + + + + + + + +
RightClick Ҽ
ҼʹOpen豸ſʹº͵ʱʹSetMouseInterval
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+wyhkm.RightClick
+wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/RightDoubleClick.html b/ddl/chm_output/com_fun/RightDoubleClick.html new file mode 100644 index 0000000..c121068 --- /dev/null +++ b/ddl/chm_output/com_fun/RightDoubleClick.html @@ -0,0 +1,43 @@ + + + + +RightDoubleClick + + + + + + + + + + + + + + + + + + + + + + + + +
RightDoubleClick Ҽ˫
Ҽ˫ʹOpen豸ſʹº͵ʱʹSetMouseInterval
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+wyhkm.RightDoubleClick
+wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/RightDown.html b/ddl/chm_output/com_fun/RightDown.html new file mode 100644 index 0000000..f09d3ac --- /dev/null +++ b/ddl/chm_output/com_fun/RightDown.html @@ -0,0 +1,45 @@ + + + + +RightDown + + + + + + + + + + + + + + + + + + + + + + + + +
RightDown Ҽ
Ҽ¡ʹOpen豸ſʹ
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+wyhkm.RightDown
+wyhkm.DelayRnd 90,120
+wyhkm.RightUp
+wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/RightUp.html b/ddl/chm_output/com_fun/RightUp.html new file mode 100644 index 0000000..fcf6320 --- /dev/null +++ b/ddl/chm_output/com_fun/RightUp.html @@ -0,0 +1,45 @@ + + + + +RightUp + + + + + + + + + + + + + + + + + + + + + + + + +
RightUp Ҽ
ҼʹOpen豸ſʹ
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+wyhkm.RightDown
+wyhkm.DelayRnd 90,120
+wyhkm.RightUp
+wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/SearchDevice.html b/ddl/chm_output/com_fun/SearchDevice.html new file mode 100644 index 0000000..79fd0de --- /dev/null +++ b/ddl/chm_output/com_fun/SearchDevice.html @@ -0,0 +1,56 @@ + + + + +SearchDevice + + + + + + + + + + + + + + + + + + + + + + + + +
SearchDevice 豸
ļӡ
1VID32λÿļӵֵܲһù߲鿴ֵΪ65536ʱԴҵļӵVIDΪֵ
+2PID32λÿļӵֵܲһù߲鿴ֵΪ65536ʱԴҵļӵPIDΪֵ
+3豸ģʽ32λòҵļӵģʽȡֵ£
+ + + + + + + + + + + + + + + + + + + + + +
ֵ˵
0ģʽ
1ģʽ
2ģʽ
3ģʽ
ֵ32λһʱ豸IDţֻԵǰģЧûҵʧܷ-1
vbs
MsgBox "豸ID:" & CStr(wyhkm.SearchDevice(&h1234&,&hABCD&,0)),4096
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/SearchDevice2.html b/ddl/chm_output/com_fun/SearchDevice2.html new file mode 100644 index 0000000..8a07fef --- /dev/null +++ b/ddl/chm_output/com_fun/SearchDevice2.html @@ -0,0 +1,57 @@ + + + + +SearchDevice2 + + + + + + + + + + + + + + + + + + + + + + + + +
SearchDevice2 豸
ļӡ
1VID32λÿļӵֵܲһù߲鿴ֵΪ65536ʱԴҵļӵVIDΪֵ
+2PID32λÿļӵֵܲһù߲鿴ֵΪ65536ʱԴҵļӵPIDΪֵ
+3кţ32λÿļӵֵһù߲鿴
+4豸ģʽ32λòҵļӵģʽȡֵ£
+ + + + + + + + + + + + + + + + + + + + + +
ֵ˵
0ģʽ
1ģʽ
2ģʽ
3ģʽ
ֵ32λһʱ豸IDţֻԵǰģЧûҵʧܷ-1
vbs
MsgBox "豸ID:" & CStr(wyhkm.SearchDevice2(&h1234&,&hABCD&,&h12345678&,1))
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/SearchDeviceAll.html b/ddl/chm_output/com_fun/SearchDeviceAll.html new file mode 100644 index 0000000..6ebe9a7 --- /dev/null +++ b/ddl/chm_output/com_fun/SearchDeviceAll.html @@ -0,0 +1,60 @@ + + + + +SearchDeviceAll + + + + + + + + + + + + + + + + + + + + + + + + +
SearchDeviceAll ȫ豸
ҷȫļӡ
1VID32λÿļӵֵܲһù߲鿴ֵΪ65536ʱԴҵļӵVIDΪֵ
+2PID32λÿļӵֵܲһù߲鿴ֵΪ65536ʱԴҵļӵPIDΪֵ
+4豸ģʽ32λòҵļӵģʽȡֵ£
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ֵ˵
0ģʽ
1ģʽ
2ģʽ
3ģʽ
4096BSTRַ
ֵͣǰȫBSTRͣɲ4ҵʱ豸IDţֻԵǰģЧǰȫ飬ԪDZ())δҵ豸ʧʱصİȫС0BSTRͣʽΪ“豸ID1|豸ID2|...”ʽδҵ豸ʧʱؿַ
vbs
MsgBox "豸ID:" & Join(wyhkm.SearchDeviceAll(&h1234&,&hABCD&,0),"|")
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/SetAbsMouseScrnRes.html b/ddl/chm_output/com_fun/SetAbsMouseScrnRes.html new file mode 100644 index 0000000..f8b4e33 --- /dev/null +++ b/ddl/chm_output/com_fun/SetAbsMouseScrnRes.html @@ -0,0 +1,44 @@ + + + + +SetAbsMouseScrnRes + + + + + + + + + + + + + + + + + + + + + + + + +
SetAbsMouseScrnRes þĻֱ
þƶʾĻֱʡʹOpen豸ſʹйغMoveToMoveR2
1ȣ32λ1Ͳ2ȡ0ʱĻֱΪǰϵͳʾĻֱʡ
+ 2߶ȣ32λ
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ wyhkm.SetAbsMouseScrnRes 800,600
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/SetDevDescInfo.html b/ddl/chm_output/com_fun/SetDevDescInfo.html new file mode 100644 index 0000000..68b17b4 --- /dev/null +++ b/ddl/chm_output/com_fun/SetDevDescInfo.html @@ -0,0 +1,69 @@ + + + + +SetDevDescInfo + + + + + + + + + + + + + + + + + + + + + + + + +
SetDevDescInfo 豸Ϣ
ļӵ豸ϢļӵUSBӿϢ豸Ϣı䣬ϵͳʶ豸ԶװҪȴӻʱʹãвҪγӣᵼϵͳװʧܡ޸ĺҪر豸ȴϵͳװɺٲҺʹ豸ЩܻܵӰ죬޷ļӻĹ̼汾ڵ1.2.0ִ֧˺ʹOpen豸ſʹ
1VID32λUSBӿڵIDֵķΧ0-65535ֵΪ65536ʱ޸ļVIDֵ
+ 2PID32λUSBӿڵIJƷIDֵķΧ0-65535ֵΪ65536ʱ޸ļPIDֵ
+ 3汾32λUSBӿڵ豸汾ֵķΧ0-65535ֵΪ65536ʱ޸ļӰ汾ֵ
+ 4ͣ32λBSTRͣUSBӿڵַ޸ʱʹ32λֵΪ1
+ 5Ʒͣ32λBSTRͣUSBӿڵIJƷòƷַ޸IJƷʱʹ32λֵΪ1
+ 6ģʽ32λȡֵ£
+ + + + + + + + + + + + + + + + + +
ֵ˵
0ȡʱá
1ʱãϵ磨USBӿͣγļӣָ
2ãϵ󲻻ָôƣϵֻ5Ρ
+ 7Ƿ꣺ֵȡfalseʱԶ豸Ϣͬʱмģʽģʽ豸üģʽ豸豸ϢȡtrueʱԶ豸Ϣͬʱмģʽģʽ豸ģʽ豸豸Ϣ
ֵֵɹtrueʧܷfalse
vbs
+
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+ //޸豸ϢPID޸
+ wyhkm.SetDevDescInfo &h1235&,&h10000&,&h0101&,1,"Mouse",1,false
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/SetKeyInterval.html b/ddl/chm_output/com_fun/SetKeyInterval.html new file mode 100644 index 0000000..a0fd650 --- /dev/null +++ b/ddl/chm_output/com_fun/SetKeyInterval.html @@ -0,0 +1,44 @@ + + + + +SetKeyInterval + + + + + + + + + + + + + + + + + + + + + + + + +
SetKeyInterval ðʱ
ṵ̈º͵֮ʱֻԵǰ豸ЧʱǸһΧڵֵҲóɹ̶ֵĬϰʱǸ100븽ֵʹOpen豸ſʹйغKeyPressOutputString
1ʱ䣺32λλ롣
+ 2ʱ䣺32λλ롣ʱʱʱʱǹ̶ֵ
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ wyhkm.SetKeyInterval 100,150
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/SetLightMode.html b/ddl/chm_output/com_fun/SetLightMode.html new file mode 100644 index 0000000..c610a91 --- /dev/null +++ b/ddl/chm_output/com_fun/SetLightMode.html @@ -0,0 +1,66 @@ + + + + +SetLightMode + + + + + + + + + + + + + + + + + + + + + + + + +
SetLightMode ָʾģʽ
ļӵָʾģʽļӻĹ̼汾ڵ1.1.0ִ֧˺ʹOpen豸ſʹ
1ģʽ޷32λȡֵ£
+ + + + + + + + + + + + + + + + + + + + + +
ֵ˵
0˸(Ĭģʽ)
1
2
8ģʽλӸλʱģʽ䣬ֵλʹ
+2Ƿ꣺ֵȡfalseʱԶָʾģʽͬʱмģʽģʽ豸üģʽ豸ָʾģʽȡtrueʱԶָʾģʽͬʱмģʽģʽ豸ģʽ豸ָʾģʽ
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ wyhkm.SetLightMode(1,false)
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/SetMode.html b/ddl/chm_output/com_fun/SetMode.html new file mode 100644 index 0000000..32ebeff --- /dev/null +++ b/ddl/chm_output/com_fun/SetMode.html @@ -0,0 +1,140 @@ + + + + +SetMode + + + + + + + + + + + + + + + + + + + + + + + + +
SetMode ģʽ
ļӵĹģʽֻԵǰ豸ЧʹOpen豸ſʹ
1ԣ32λ
+ 2ģʽ32λ
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
˵ģʽģʽ˵
2ƶķʽ0ǷƶĬģʽͨһֵѡͬʱѡֵûϡйغMoveToMoveRMoveR2ƶģʽֵ1ƶֻ׷ƶٶȣģֶƶʽ
2ƶֻͨƶǾƶƶֻʾƶʹúMoveToMoveR2ԾƶʽУҪļӿ“”ģʽ“+”ģʽע⣺MoveToûþƶҲʵ־ƶMoveR2þƶþʵƶ
4ƶģʽƶָֻûʹ“ָ뾫ȷ”“ѡָƶٶ”м䣨ƶĻı1:1win10Dpi100%ʱʹãƶвƶӰ죬ŵٶȿЩʹþƶʱЧMoveRЧ
0ģʽʼ٣١ʹÿƶʱЧ
8ģʽ޼Ӽ٣ʱήٶȡʹÿƶʱЧMoveToMoveR2ھƶͻƶģʽûʹʱЧ
16ģʽ޼Ӽ٣ʱٶȡʹÿƶʱЧMoveToMoveR2ھƶͻƶģʽûʹʱЧ
3ֹʽйغMouseWheel0ģֵֶķʽٶȽ(Ĭģʽ)
1ٹֻ׷ֹٶȣģֵֶķʽ
4ַ룬ͬڽַܵ벻ͬѡ˻յ룬йغOutputString0ANSIַ(Ĭģʽ)
1UNICODEַ
2ANSIַģʽ0IJǣ֡ĸͲַʱֶһٶȸ죬ܼ̻뷨š
3UNICODEַģʽ1IJǣ֡ĸͲַʱֶһٶȸ죬ܼ̻뷨š
4ʹüճַŵַʱٶȸҲ뷨Ӱ죬ȱǻдݺͲ֧ڡ
5ͬʽͬǵȴӵݱӲգϵͳѾ˸ݣʱϵͳæӲյϵͳ֮ʱһʱ϶̣1롣0ȫͬĬģʽ첽ͨһֵѡͬʱѡֵûϡйغKeyPressKeyDownKeyUpLeftClickRightClickMiddleClickXBtn1ClickXBtn2ClickLeftDoubleClickRightDoubleClickMiddleDoubleClickXBtn1DoubleClickXBtn2DoubleClickLeftDownRightDownMiddleDownXBtn1DownXBtn2DownLeftUpRightUpMiddleUpXBtn1UpXBtn2UpMoveRPMouseWheelPOutputString1첽ȴ̶ֱӷ
2첽ȴ궯ֱӷ
6ʱĸʷֲʽйغDelayRndKeyPressLeftClickRightClickMiddleClickXBtn1ClickXBtn2ClickLeftDoubleClickRightDoubleClickMiddleDoubleClickXBtn1DoubleClickXBtn2DoubleClickOutputString0ʱȷֲʱֵĸͬ(Ĭģʽ)
1ʱƫСֲʱֵԽСԽߣֵĸʽӽ0
7ʱʽйغDelayRndKeyPressLeftClickRightClickMiddleClickXBtn1ClickXBtn2ClickLeftDoubleClickRightDoubleClickMiddleDoubleClickXBtn1DoubleClickXBtn2DoubleClickOutputString0Ϣ(Ĭģʽ)
1Ϣ
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+ wyhkm.SetMode 2,1
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/SetMouseInterval.html b/ddl/chm_output/com_fun/SetMouseInterval.html new file mode 100644 index 0000000..8f6cf8d --- /dev/null +++ b/ddl/chm_output/com_fun/SetMouseInterval.html @@ -0,0 +1,44 @@ + + + + +SetMouseInterval + + + + + + + + + + + + + + + + + + + + + + + + +
SetMouseInterval ʱ
º͵֮ʱֻԵǰ豸ЧʱǸһΧڵֵҲóɹ̶ֵĬʱǸ100븽ֵʹOpen豸ſʹйغLeftClickRightClickMiddleClickLeftDoubleClickRightDoubleClickMiddleDoubleClick
1ʱ䣺32λλ롣
+ 2ʱ䣺32λλ롣ʱʱʱʱǹ̶ֵ
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+ wyhkm.SetMouseInterval 100,150
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/SetMouseMoveTimeout.html b/ddl/chm_output/com_fun/SetMouseMoveTimeout.html new file mode 100644 index 0000000..f66fcc8 --- /dev/null +++ b/ddl/chm_output/com_fun/SetMouseMoveTimeout.html @@ -0,0 +1,43 @@ + + + + +SetMouseMoveTimeout + + + + + + + + + + + + + + + + + + + + + + + + +
SetMouseMoveTimeout ƶʱʱ
ƶʱ䳬趨ʱʱֹͣƶfalseֻԵǰ豸ЧʹOpen豸ſʹغMoveTo
1ʱ䣺32λƶʱʱ䣬λ롣ȡֵΪ-1ʱȡʱʱơĬֵ10롣
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+ wyhkm.SetMouseMoveTimeout 50000
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/SetMousePosMaxOffset.html b/ddl/chm_output/com_fun/SetMousePosMaxOffset.html new file mode 100644 index 0000000..5ba3b5c --- /dev/null +++ b/ddl/chm_output/com_fun/SetMousePosMaxOffset.html @@ -0,0 +1,43 @@ + + + + +SetMousePosMaxOffset + + + + + + + + + + + + + + + + + + + + + + + + +
SetMousePosMaxOffset ƫ
ֶƶʱͨÿζ㵽ͬ꣬һΧģΪõƫֵֻԵǰ豸ЧʹOpen豸ſʹغMoveTo
1ƫƣ32λƫֵĬֵ0
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+ wyhkm.SetMousePosMaxOffset 2
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/SetMousePosPrecision.html b/ddl/chm_output/com_fun/SetMousePosPrecision.html new file mode 100644 index 0000000..7823baa --- /dev/null +++ b/ddl/chm_output/com_fun/SetMousePosPrecision.html @@ -0,0 +1,43 @@ + + + + +SetMousePosPrecision + + + + + + + + + + + + + + + + + + + + + + + + +
SetMousePosPrecision 꾫
ϵͳеƶٶȹʱ޷ȷÿأĿ긽ܾãʱҪ꾫ȣƶĿʱƫֻԵǰ豸ЧʹOpen豸ſʹغMoveToMoveR2
1ȣ32λƫĬֵ0
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+ wyhkm.SetMousePosPrecision 1
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/SetMouseSpeed.html b/ddl/chm_output/com_fun/SetMouseSpeed.html new file mode 100644 index 0000000..53a7bf9 --- /dev/null +++ b/ddl/chm_output/com_fun/SetMouseSpeed.html @@ -0,0 +1,43 @@ + + + + +SetMouseSpeed + + + + + + + + + + + + + + + + + + + + + + + + +
SetMouseSpeed ٶ
ƶٶȡõǼƶٶȵֵƶģʽMoveRPӰ졣ʹOpen豸ſʹйغMoveRMoveR2MoveTo
1ٶȣֵ޷32λȡֵΧ5-100ֵԽٶԽ죬Ĭֵ45ʹٶֵȫ̶ˣƶٶСΧƶģʽMoveRP⣩
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+ wyhkm.SetMouseSpeed 20
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/SetOSMouseSpeed.html b/ddl/chm_output/com_fun/SetOSMouseSpeed.html new file mode 100644 index 0000000..3514fbe --- /dev/null +++ b/ddl/chm_output/com_fun/SetOSMouseSpeed.html @@ -0,0 +1,33 @@ + + + + +SetOSMouseSpeed + + + + + + + + + + + + + + + + + + + + + + + + +
SetOSMouseSpeed ϵͳٶ
ϵͳٶȡϵͳٶϵͳе“ѡָƶٶ”õƶٶϵͳƶٶȵı
1ٶȣ32λֵķΧ1-20ֵԽϵͳеٶԽ죬ϵͳĬֵ10
+2Ƿ񱣴棺ֵȡtrueʱϵͳȻЧȡfalseʱϵͳָá
ֵֵɹtrueʧܷfalse
vbs
SetOSMouseSpeed(10,false)
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/SetResetMode.html b/ddl/chm_output/com_fun/SetResetMode.html new file mode 100644 index 0000000..89b9a69 --- /dev/null +++ b/ddl/chm_output/com_fun/SetResetMode.html @@ -0,0 +1,62 @@ + + + + +SetResetMode + + + + + + + + + + + + + + + + + + + + + + + + +
SetResetMode øλģʽ
ļӵʱλģʽʱλģʽʱλʹSetResetTimeļӻĹ̼汾ڵ1.1.0ִ֧˺ʹOpen豸ſʹ
1ģʽ32λȡֵ£
+ + + + + + + + + + + + + +
ֵ˵
0Ӳλ(Ĭģʽ)
1갴״̬λ
+ 2Ƿ꣺ֵȡfalseʱԶøλģʽͬʱмģʽģʽ豸üģʽ豸ĸλģʽȡtrueʱԶøλģʽͬʱмģʽģʽ豸ģʽ豸ĸλģʽ
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ wyhkm.SetResetMode(1,false)
+ Do
+     wyhkm.SetResetTime(1000,false)
+     wyhkm.DelayRnd(90,120)
+ Loop
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/SetResetTime.html b/ddl/chm_output/com_fun/SetResetTime.html new file mode 100644 index 0000000..bcfe5ee --- /dev/null +++ b/ddl/chm_output/com_fun/SetResetTime.html @@ -0,0 +1,48 @@ + + + + +SetResetTime + + + + + + + + + + + + + + + + + + + + + + + + +
SetResetTime øλʱ
ļӵʱλʱ䡣иʱʹøúʱ䵽˾ͻʹӸλʹʺӵļʹʱ¼ʱλʱʧЧҪʹøúáļʱ»ͨѶ쳣߳ͻȻ˳°µļ޷ȥЩ²κӷաֹͣļӲرʱλΪļ̺ǽӴһ㲻ָλļӻһִ֧˺ʹOpen豸ſʹ
+ ʺӵĺУGetVersion IsOpen Close SetMode SetKeyInterval SetMouseInterval SetAbsMouseScrnRes SetMouseMoveTimeout SetMousePosMaxOffset SetMousePosPrecision DelayRnd CheckPressedKeys IsOSMouseAccelerateEnabled EnableOSMouseAccelerate GetOSMouseSpeed SetOSMouseSpeedGetDevString
1ʱʱ䣺32λλ롣ȡ0ʱرʱλ0ʱСֵ50룬ֵ19Сʱ
+2Ƿ꣺ֵȡfalseʱԶʱλʱ䣬ͬʱмģʽģʽ豸üģʽ豸ʱλʱ䡣ȡtrueʱԶʱλʱ䣬ͬʱмģʽģʽ豸ģʽ豸ʱλʱ䡣
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ Do
+     wyhkm.SetResetTime(1000,false)
+     wyhkm.DelayRnd(90,120)
+ Loop
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/VerifyUserData.html b/ddl/chm_output/com_fun/VerifyUserData.html new file mode 100644 index 0000000..8bfc9c5 --- /dev/null +++ b/ddl/chm_output/com_fun/VerifyUserData.html @@ -0,0 +1,44 @@ + + + + +VerifyUserData + + + + + + + + + + + + + + + + + + + + + + + + +
VerifyUserData ֤û
֤ûʹ“ļ޸”дַַǷͬļӻһĹ̼汾ڵ1.2.0ִ֧˺ʹOpen豸ſʹ
BSTR͡Ҫַ
+ 2Ƿ꣺ֵȡfalseʱԶ֤ûݣͬʱмģʽģʽ豸֤ģʽ豸ûݡȡtrueʱԶ֤ûݣͬʱмģʽģʽ豸֤ģʽ豸ûݡ
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ MsgBox "֤ûݣ" & CStr(wyhkm.VerifyUserData("ҵû",false)),4096
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/VerifyUserData2.html b/ddl/chm_output/com_fun/VerifyUserData2.html new file mode 100644 index 0000000..f79fa9d --- /dev/null +++ b/ddl/chm_output/com_fun/VerifyUserData2.html @@ -0,0 +1,44 @@ + + + + +VerifyUserData2 + + + + + + + + + + + + + + + + + + + + + + + + +
VerifyUserData2 ֤û2
֤ûʹ“ļ޸”дַַǷͬVerifyUserData棬ûݺ֤ݷ룬޷֤ͨݻûݡڹ̼ԭVerifyUserDataVerifyUserData2֧ͬʱʹáļӻһִ֧˺ʹOpen豸ſʹ
BSTR͡Ҫַ
+ 2Ƿ꣺ֵȡfalseʱԶ֤ûݣͬʱмģʽģʽ豸֤ģʽ豸ûݡȡtrueʱԶ֤ûݣͬʱмģʽģʽ豸֤ģʽ豸ûݡ
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+ DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+ If DevId=-1 Then
+     MsgBox "δҵļ",4096
+     wscript.quit
+ End If
+ If Not wyhkm.Open(DevId,0) Then
+     MsgBox "ļʧ",4096
+     wscript.quit
+ End If
+ MsgBox "֤ûݣ" & CStr(wyhkm.VerifyUserData("1234567890ABCDEF1234567890ABCDEF",false)=wyhkm.GetSerialNumber(false)),4096
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/VirtualKeyTable.html b/ddl/chm_output/com_fun/VirtualKeyTable.html new file mode 100644 index 0000000..bf12efb --- /dev/null +++ b/ddl/chm_output/com_fun/VirtualKeyTable.html @@ -0,0 +1,459 @@ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
8Backspace˸88X 
9TabTab89Y 
13Enterس90Z 
16ShiftShift91Left WinWindows
17CtrlCtrl92Right WinWindows
18AltAlt93Apps˵
19Pauseͣ96Num 0С0
20Caps LockСдл97Num 1С1
27Esc˳98Num 2С2
32Spaceո99Num 3С3
33Page UpϷҳ100Num 4С4
34Page Down·ҳ101Num 5С5
35Endβ102Num 6С6
36Homeʼ103Num 7С7
37LeftƼͷ104Num 8С8
38UpƼϼͷ105Num 9С9
39RightƼҼͷ106Num *С*
40DownƼ¼ͷ107Num +С+
44Print Screen108Num EnterС̻س
45Insert109Num -С-
46Deleteɾ110Num .С.
480 111Num /С/
491 112F1 
502 113F2 
513 114F3 
524 115F4 
535 116F5 
546 117F6 
557 118F7 
568 119F8 
579 120F9 
65A 121F10 
66B 122F11 
67C 123F12 
68D 144Num LockСл
69E 145Scroll Lock 
70F 160Left ShiftShift
71G 161Right ShiftShift
72H 162Left CtrlCtrl
73I 163Right CtrlCtrl
74J 164Left AltAlt
75K 165Right AltAlt
76L 186;;:
77M 187==+
78N 188,,<
79O 189--_
80P 190..>
81Q 191//?
82R 192``~
83S 219[[{
84T 220\\|
85U 221]]}
86V 222''"
87W    
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/XBtn1Click.html b/ddl/chm_output/com_fun/XBtn1Click.html new file mode 100644 index 0000000..01adef5 --- /dev/null +++ b/ddl/chm_output/com_fun/XBtn1Click.html @@ -0,0 +1,43 @@ + + + + +XBtn1Click + + + + + + + + + + + + + + + + + + + + + + + + +
XBtn1Click XButton1
XButton1ʹOpen豸ſʹº͵ʱʹSetMouseIntervalļӻĹ̼汾ڵ1.1.0ΪϷִ֧˺
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+ wyhkm.XBtn1Click
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/XBtn1DoubleClick.html b/ddl/chm_output/com_fun/XBtn1DoubleClick.html new file mode 100644 index 0000000..ac35f83 --- /dev/null +++ b/ddl/chm_output/com_fun/XBtn1DoubleClick.html @@ -0,0 +1,43 @@ + + + + +XBtn1DoubleClick + + + + + + + + + + + + + + + + + + + + + + + + +
XBtn1DoubleClick XButton1˫
XButton1˫ʹOpen豸ſʹº͵ʱʹSetMouseIntervalļӻĹ̼汾ڵ1.1.0ΪϷִ֧˺
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+ wyhkm.XBtn1DoubleClick
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/XBtn1Down.html b/ddl/chm_output/com_fun/XBtn1Down.html new file mode 100644 index 0000000..47bf129 --- /dev/null +++ b/ddl/chm_output/com_fun/XBtn1Down.html @@ -0,0 +1,43 @@ + + + + +XBtn1Down + + + + + + + + + + + + + + + + + + + + + + + + +
XBtn1Down XButton1
XButton1¡ʹOpen豸ſʹļӻĹ̼汾ڵ1.1.0ΪϷִ֧˺
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+ wyhkm.XBtn1Down
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/XBtn1Up.html b/ddl/chm_output/com_fun/XBtn1Up.html new file mode 100644 index 0000000..00399c0 --- /dev/null +++ b/ddl/chm_output/com_fun/XBtn1Up.html @@ -0,0 +1,43 @@ + + + + +XBtn1Up + + + + + + + + + + + + + + + + + + + + + + + + +
XBtn1Up XButton1
XButton1ʹOpen豸ſʹļӻĹ̼汾ڵ1.1.0ΪϷִ֧˺
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+ wyhkm.XBtn1Up
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/XBtn2Click.html b/ddl/chm_output/com_fun/XBtn2Click.html new file mode 100644 index 0000000..b9ddc09 --- /dev/null +++ b/ddl/chm_output/com_fun/XBtn2Click.html @@ -0,0 +1,43 @@ + + + + +XBtn2Click + + + + + + + + + + + + + + + + + + + + + + + + +
XBtn2Click XButton2
XButton2ʹOpen豸ſʹº͵ʱʹSetMouseIntervalļӻĹ̼汾ڵ1.1.0ΪϷִ֧˺
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+ wyhkm.XBtn2Click
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/XBtn2DoubleClick.html b/ddl/chm_output/com_fun/XBtn2DoubleClick.html new file mode 100644 index 0000000..1fd1c1b --- /dev/null +++ b/ddl/chm_output/com_fun/XBtn2DoubleClick.html @@ -0,0 +1,43 @@ + + + + +XBtn2DoubleClick + + + + + + + + + + + + + + + + + + + + + + + + +
XBtn2DoubleClick XButton2˫
XButton2˫ʹOpen豸ſʹº͵ʱʹSetMouseIntervalļӻĹ̼汾ڵ1.1.0ΪϷִ֧˺
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+ wyhkm.XBtn2DoubleClick
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/XBtn2Down.html b/ddl/chm_output/com_fun/XBtn2Down.html new file mode 100644 index 0000000..5ac794a --- /dev/null +++ b/ddl/chm_output/com_fun/XBtn2Down.html @@ -0,0 +1,43 @@ + + + + +XBtn2Down + + + + + + + + + + + + + + + + + + + + + + + + +
XBtn2Down XButton2
XButton2¡ʹOpen豸ſʹļӻĹ̼汾ڵ1.1.0ΪϷִ֧˺
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+ wyhkm.XBtn2Down
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/XBtn2Up.html b/ddl/chm_output/com_fun/XBtn2Up.html new file mode 100644 index 0000000..f90fe7d --- /dev/null +++ b/ddl/chm_output/com_fun/XBtn2Up.html @@ -0,0 +1,43 @@ + + + + +XBtn2Up + + + + + + + + + + + + + + + + + + + + + + + + +
XBtn2Up XButton2
XButton2ʹOpen豸ſʹļӻĹ̼汾ڵ1.1.0ΪϷִ֧˺
 
ֵֵɹtrueʧܷfalse
vbs
Dim DevId
+DevId=wyhkm.SearchDevice(&h1234&,&hABCD&,0)
+If DevId=-1 Then
+    MsgBox "δҵļ",4096
+    wscript.quit
+End If
+If Not wyhkm.Open(DevId,0) Then
+    MsgBox "ļʧ",4096
+    wscript.quit
+End If
+ wyhkm.XBtn2Up
+ wyhkm.Close
+ + \ No newline at end of file diff --git a/ddl/chm_output/com_fun/css/help.css b/ddl/chm_output/com_fun/css/help.css new file mode 100644 index 0000000..9c5f3ef --- /dev/null +++ b/ddl/chm_output/com_fun/css/help.css @@ -0,0 +1,17 @@ +@charset "gb2312"; +body{font-size:12px; font-family:Verdana,"";} +.ts{ background:#fff; margin:0;} +.ts th{ + color:#666666; + background:#D8D8D8; + line-height:24px; + font-family: Verdana, ""; +} +.ts td {padding:6px 0;} +.name { font-size:16px; font-weight:bold; border-top:1px dashed #9C9A9C; border-bottom:1px dashed #9C9A9C; color:#006939;} +.canshu { background:#E7E7EF;} +.fanhui { border-bottom:1px dashed #9C9A9C;} +.lizi { border-bottom:1px dashed #9C9A9C;} +.neirong { border-bottom:1px dashed #9C9A9C;} +.thf {color: #000000;} +.note {color: #006600;} diff --git a/ddl/chm_output/css/mystyle.css b/ddl/chm_output/css/mystyle.css new file mode 100644 index 0000000..48ef556 --- /dev/null +++ b/ddl/chm_output/css/mystyle.css @@ -0,0 +1,6 @@ +@charset "gb2312"; +body{font-size:16px; font-family:Verdana,"";} +h1{text-align:center;} +p{text-indent:2em;} +.boldfont{font-weight:bold;} +.redfont {color: #FF0000;} \ No newline at end of file diff --git a/ddl/chm_output/pic/jt1.jpg b/ddl/chm_output/pic/jt1.jpg new file mode 100644 index 0000000..6ce0f87 Binary files /dev/null and b/ddl/chm_output/pic/jt1.jpg differ diff --git a/ddl/chm_output/pic/jt2.jpg b/ddl/chm_output/pic/jt2.jpg new file mode 100644 index 0000000..41306d1 Binary files /dev/null and b/ddl/chm_output/pic/jt2.jpg differ diff --git a/ddl/chm_output/pic/jt3.jpg b/ddl/chm_output/pic/jt3.jpg new file mode 100644 index 0000000..8c09031 Binary files /dev/null and b/ddl/chm_output/pic/jt3.jpg differ diff --git a/ddl/chm_output/pic/jt4.jpg b/ddl/chm_output/pic/jt4.jpg new file mode 100644 index 0000000..b401dd4 Binary files /dev/null and b/ddl/chm_output/pic/jt4.jpg differ diff --git a/ddl/chm_output/standard_fun/HKMCheckPressedKeys.html b/ddl/chm_output/standard_fun/HKMCheckPressedKeys.html new file mode 100644 index 0000000..67505ce --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMCheckPressedKeys.html @@ -0,0 +1,64 @@ + + + + +HKMCheckPressedKeys + + + + + + + + + + + + + + + + + + + + + + + + +
HKMCheckPressedKeys 鰴
̡Щ¡ڳǰЩ̻ļijԭ򱻰δеĴϿˣʵ߼ϲδӰļ̡ȼһ¡
1ģʽ޷32λĹʽȡֵһʱȡ0Ҫͬʱʹöֵɽֵ㡣ȡֵ
+ + + + + + + + + + + + + + + + + +
ֵ˵
1صַĵϢȫӢĵϢ
2صַµϢֻµļ̼
4صַAnsi룬ĬUnicode
+ 2ַȣ޷32λָ롣ڽշֵΪNULLʱַַַ'\0'ҪʱȡֵΪNULL
ֵַ(Unicode/Ansi)δ⵽бµļ“OK”ַ⵽бµļرµļϢʧܣNULLʹַʱʹHKMFreeDataͷַռõԴ
C
LPWSTR lpStr;
+ setlocale(LC_ALL,"chs");//printfUnicodeַҪòʾ
+ lpStr=HKMCheckPressedKeys(1,NULL);
+ if(lpStr==NULL)
+ {
+     printf("ʧ\n");
    return 0;
+ }
+ if(!wcscmp(lpStr,L"OK"))
+ {
+     printf("鵽%S£ǰδ߼̹ϣӰΪ˻ָǣ볢µЩ\n");
+     HKMFreeData(lpStr);
+    return 0;
+ }
+ HKMFreeData(lpStr);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMClose.html b/ddl/chm_output/standard_fun/HKMClose.html new file mode 100644 index 0000000..5cd41c3 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMClose.html @@ -0,0 +1,45 @@ + + + + +HKMClose + + + + + + + + + + + + + + + + + + + + + + + + +
HKMClose ر豸
رļӣвʱʹô˺ر豸ͷռõԴ
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ //ִв
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMDelayRnd.html b/ddl/chm_output/standard_fun/HKMDelayRnd.html new file mode 100644 index 0000000..b1ff355 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMDelayRnd.html @@ -0,0 +1,49 @@ + + + + +HKMDelayRnd + + + + + + + + + + + + + + + + + + + + + + + + +
HKMDelayRnd ʱ
һ趨ʱ䷶Χʱ
1豸ָ롣ʹHKMOpenԴ
+ 2ʱ䣺޷32λλ롣
+ 3ʱ䣺޷32λλ롣ʱʱʱʱǹ̶ֵ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMLeftDown(lpDev);
+ HKMDelayRnd(lpDev,90,120);
+ HKMLeftUp(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMEnableOSMouseAccelerate.html b/ddl/chm_output/standard_fun/HKMEnableOSMouseAccelerate.html new file mode 100644 index 0000000..d565a00 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMEnableOSMouseAccelerate.html @@ -0,0 +1,33 @@ + + + + +HKMEnableOSMouseAccelerate + + + + + + + + + + + + + + + + + + + + + + + + +
HKMEnableOSMouseAccelerate ͣϵͳ
ֹͣϵͳٹܡϵͳٹϵͳе“ָ뾫ȷ”Ĭǿġƶʱϵͳи죬ƶʱϵͳиϵͳеƶ벻ǹ̶ı
1ǷֵȡTRUEʱϵͳ٣ȡFALSEʱֹͣϵͳ١
+2Ƿ񱣴棺ֵȡTRUEʱϵͳȻЧȡFALSEʱϵͳָá
ֵֵɹTRUEʧܷFALSE
C
HKMEnableOSMouseAccelerate(FALSE,FALSE);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMFreeData.html b/ddl/chm_output/standard_fun/HKMFreeData.html new file mode 100644 index 0000000..ef9db64 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMFreeData.html @@ -0,0 +1,35 @@ + + + + +HKMFreeData + + + + + + + + + + + + + + + + + + + + + + + + +
HKMFreeData ͷ
ͷݣͷһЩռõԴغHKMSearchDeviceAllHKMCheckPressedKeys
1ݵַָ롣ʹHKMSearchDeviceAllHKMCheckPressedKeysԴ
ֵֵɹTRUEʧܷFALSE
C
LPWSTR lpStr;
+lpStr=HKMCheckPressedKeys(1);
+//ִв
+HKMFreeData(lpStr);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMGetCursorPos.html b/ddl/chm_output/standard_fun/HKMGetCursorPos.html new file mode 100644 index 0000000..385b8df --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMGetCursorPos.html @@ -0,0 +1,54 @@ + + + + +HKMGetCursorPos + + + + + + + + + + + + + + + + + + + + + + + + +
HKMGetCursorPos
òϵͳеꡣ
1豸ָ롣ʹHKMOpenԴ
+ 2꣺32λָ롣ڽꡣ
+ 3꣺32λָ롣ڽꡣ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ long x,y;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ if(!HKMGetCursorPos(lpDev,&x,&y))
+ {
+     printf("ʧ\n");
+    return 0;
+ } +
+ printf("꣺%d%d%s\n",x,y);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMGetCursorPos2.html b/ddl/chm_output/standard_fun/HKMGetCursorPos2.html new file mode 100644 index 0000000..662d631 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMGetCursorPos2.html @@ -0,0 +1,46 @@ + + + + +HKMGetCursorPos2 + + + + + + + + + + + + + + + + + + + + + + + + +
HKMGetCursorPos2
òϵͳеꡣHKMGetCursorPosȫֻͬΪ˽Բֲַ֧⡣
1豸ָ롣ʹHKMOpenԴ
ֵ޷32λ16λǺ꣬16λꡣ
C
DWORD dwDevId,dwPos;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ dwPos=HKMGetCursorPos2(lpDev);
+ printf("꣺%d%d%s\n",(long)(short)dwPos,(long)(short)(dwPos>>16));
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMGetDataCount.html b/ddl/chm_output/standard_fun/HKMGetDataCount.html new file mode 100644 index 0000000..6a21ebf --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMGetDataCount.html @@ -0,0 +1,42 @@ + + + + +HKMGetDataCount + + + + + + + + + + + + + + + + + + + + + + + + +
HKMGetDataCount
ԪغHKMSearchDeviceAllHKMCheckPressedKeys
1ݵַָ롣ʹHKMSearchDeviceAllHKMCheckPressedKeysԴ
ֵ޷32λɹԪʧܷ0xFFFFFFFF
C
LPDWORD pDevId;
+DWORD dwCount,i;
+pDevId=HKMSearchDeviceAll(0x1234,0xABCD,0);
+if(pDevId==NULL)
+{
+    printf("豸ʧ\n");
+    return 0;
+}
+dwCount=HKMGetDataCount(pDevId);
+printf("ҵ豸:%u\n",dwCount);
+HKMFreeData(pDevId);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMGetDataUnitInt.html b/ddl/chm_output/standard_fun/HKMGetDataUnitInt.html new file mode 100644 index 0000000..4e658fa --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMGetDataUnitInt.html @@ -0,0 +1,47 @@ + + + + +HKMGetDataUnitInt + + + + + + + + + + + + + + + + + + + + + + + + +
HKMGetDataUnitInt ݵԪֵ
ԪصֵغHKMSearchDeviceAllHKMCheckPressedKeys
1ݵַָ롣ʹHKMSearchDeviceAllHKMCheckPressedKeysԴ
+ 2ţ޷32λԪصţԽԪ±꣬һԪ0
ֵ޷32λɹֵʧܷ0
C
LPDWORD pDevId;
+DWORD dwCount,i;
+pDevId=HKMSearchDeviceAll(0x1234,0xABCD,0);
+if(pDevId==NULL)
+{
+    printf("豸ʧ\n");
+    return 0;
+}
+dwCount=HKMGetDataCount(pDevId);
+printf("ҵ豸:%u\n",dwCount);
+for(i=0;i<dwCount;i++)
+{
+    printf("%08X\n",HKMGetDataUnitInt(pDevId,i));
+}
+HKMFreeData(pDevId);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMGetDevInfo.html b/ddl/chm_output/standard_fun/HKMGetDevInfo.html new file mode 100644 index 0000000..f95fbc7 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMGetDevInfo.html @@ -0,0 +1,89 @@ + + + + +HKMGetDevInfo + + + + + + + + + + + + + + + + + + + + + + + + +
HKMGetDevInfo 豸Ϣ
ļӵ豸Ϣļӻһִ֧˺
1豸ָ롣ʹHKMOpenԴ
+ 2ţ޷32λҪȡϢšȡֵ£
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
˵
1豸͡ļӻһ1ļӻ2
2̼汾ֵУ0-15λ޶ţ16-23λǸ汾ţ24-31λ汾š
3ʱ䡣ֵǴͨ߸λʼеĺϵ͸λ㡣ϵͳʱʱʱ侫Ȳߣ
4ͨʱ䡣ֵǴͨ翪ʼеĺϵ㣬λ㡣ϵͳʱʱʱ侫Ȳߣ
6λ
7״̬豸δӷ0xFFFFFFFF豸׼з0״̬1༭״̬2ֹ״̬3
8USB豸ӿڵVIDֵ
9USB豸ӿڵPIDֵ
10USB豸ӿڵ豸汾ֵ
+3Ƿ꣺ֵȡFALSEʱԶ豸Ϣͬʱмģʽģʽ豸üģʽ豸ϢȡTRUEʱԶ豸Ϣͬʱмģʽģʽ豸ģʽ豸Ϣ
ֵ޷32λֵɲ2
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ printf("ļӹ̼汾ţ%08X\n",HKMGetDevInfo(lpDev,2,FALSE));
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMGetDevString.html b/ddl/chm_output/standard_fun/HKMGetDevString.html new file mode 100644 index 0000000..9175bd4 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMGetDevString.html @@ -0,0 +1,68 @@ + + + + +HKMGetDevString + + + + + + + + + + + + + + + + + + + + + + + + +
HKMGetDevString 豸ַ
豸صַ
1豸ָ롣ʹHKMOpenԴ
+ 2ţ޷32λҪȡַšȡֵ£
+ + + + + + + + + + + + + +
ֵ˵
1
2Ʒ
+ 3Ƿ꣺ֵȡfalseʱԶ豸ַͬʱмģʽģʽ豸üģʽ豸ַȡtrueʱԶ豸ַͬʱмģʽģʽ豸ģʽ豸ַ
+ 4ַȣ޷32λָ롣ڽշֵΪNULLʱַַַ'\0'ҪʱȡֵΪNULL
ֵַ(Unicode/Ansi)ʧܷNULLɹַַĬUnicodeַͨHKMSetMode޸ΪAnsiַַ豸ʱУ赥ͷţҪݾֹʹʱĺݸдˡ
C
DWORD dwDevId,;
+LPVOID lpDev;
+ LPWSTR lpStr;
+ setlocale(LC_ALL,"chs");//printfUnicodeַҪòʾ
+dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+if(dwDevId==0xFFFFFFFF)
+{
+    printf("δҵļ\n");
+    return 0;
+}
+lpDev=HKMOpen(dwDevId,0);
+if(lpDev==NULL)
+{
+    printf("ļʧ\n");
+    return 0;
+}
+lpStr=HKMGetString(lpDev,1,false);
+if(lpStr!=NULL)
+    printf("̣%S\n",lpStr);
+HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMGetError.html b/ddl/chm_output/standard_fun/HKMGetError.html new file mode 100644 index 0000000..41afe6b --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMGetError.html @@ -0,0 +1,131 @@ + + + + +HKMGetError + + + + + + + + + + + + + + + + + + + + + + + + +
HKMGetError ô
ô롣Ҫô豸йغִкִиúִ豸йغḲ֮ǰֵ
1豸ָ롣ʹHKMOpenԴ
ֵ޷32λ16λǴ룬16λǴšУ0dzɹ57344ϵͳ룬ϵͳAPI“GetLastError”õֵֵͬĽͿ΢վ鿴ڻ57344Ĵ£
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ֵ˵ֵ˵
0000(0)ɹE020(57376)豸ʧ
E001(57345)ʧE021(57377)ͨʧ
E002(57346)ЧIJE022(57378)޷Ȩ
E003(57347)ЧָE023(57379)ʱ
E004(57348)ЧĶE024(57380)Ӧʧ
E005(57349)ЧijʼֵE025(57381)
E006(57350)ЧE026(57382)ȡDPIϢʧ
E007(57351)̫E027(57383)ȡʧ
E008(57352)ַ̫E028(57384)豸ʧ
E009(57353)̫СE029(57385)豸ʱ
E00A(57354)֧  
E00B(57355)Ѵ  
E00C(57356)ϵͳ  
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ printf(":%04X\n",HKMGetError(lpDev) & 0xFFFF);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMGetKeyboardLEDState.html b/ddl/chm_output/standard_fun/HKMGetKeyboardLEDState.html new file mode 100644 index 0000000..76c2cb7 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMGetKeyboardLEDState.html @@ -0,0 +1,64 @@ + + + + +HKMGetKeyboardLEDState + + + + + + + + + + + + + + + + + + + + + + + + +
HKMGetKeyboardLEDState üLED״̬
üNum LockCaps LockScroll LockƵ״̬
1豸ָ롣ʹHKMOpenԴ
+ 2̵ƣ޷32λȡֵ£
+ + + + + + + + + + + + + + + + + +
ֵ˵
0Num Lock
1Caps Lock
2Scroll Lock
ֵֵTRUE𷵻FALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ printf("NumLock%s\n",HKMGetKeyboardLEDState(lpDev,0)?"":"");
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMGetKeyboardMode.html b/ddl/chm_output/standard_fun/HKMGetKeyboardMode.html new file mode 100644 index 0000000..6ed2661 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMGetKeyboardMode.html @@ -0,0 +1,63 @@ + + + + +HKMGetKeyboardMode + + + + + + + + + + + + + + + + + + + + + + + + +
HKMGetKeyboardMode üģʽ
ļӵļģʽļӻĹ̼汾ڵ1.1.0ִ֧˺
1豸ָ롣ʹHKMOpenԴ
ֵ޷32λģʽʧܷ0xFFFFFFFFɹֵ£
+ + + + + + + + + + + + + + + + + +
ֵ˵
0޼
1ͨ
5Ϸ
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ printf("ģʽ%u\n",HKMGetKeyboardMode(lpDev));
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMGetMouseMode.html b/ddl/chm_output/standard_fun/HKMGetMouseMode.html new file mode 100644 index 0000000..36567f9 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMGetMouseMode.html @@ -0,0 +1,75 @@ + + + + +HKMGetMouseMode + + + + + + + + + + + + + + + + + + + + + + + + +
HKMGetMouseMode ģʽ
ļӵģʽļӻһĹ̼汾ڵ1.2.0ִ֧˺
1豸ָ롣ʹHKMOpenԴ
ֵ޷32λģʽʧܷ0xFFFFFFFFɹֵ£
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ֵ˵
0
1
2
3+
5Ϸ
7Ϸ+
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ printf("ģʽ%u\n",HKMGetMouseMode(lpDev));
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMGetOSMouseSpeed.html b/ddl/chm_output/standard_fun/HKMGetOSMouseSpeed.html new file mode 100644 index 0000000..36bd4e1 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMGetOSMouseSpeed.html @@ -0,0 +1,32 @@ + + + + +HKMGetOSMouseSpeed + + + + + + + + + + + + + + + + + + + + + + + + +
HKMGetOSMouseSpeed ϵͳٶ
ϵͳٶȡϵͳٶϵͳе“ѡָƶٶ”õƶٶϵͳƶٶȵı
 
ֵ32λɹʱֵķΧ1-20ֵԽϵͳеٶԽ죬ϵͳĬֵ10ʧܷ0
C
printf("ϵͳٶȣ%d\n",HKMGetOSMouseSpeed());
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMGetSerialNumber.html b/ddl/chm_output/standard_fun/HKMGetSerialNumber.html new file mode 100644 index 0000000..abb7661 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMGetSerialNumber.html @@ -0,0 +1,46 @@ + + + + +HKMGetSerialNumber + + + + + + + + + + + + + + + + + + + + + + + + +
HKMGetSerialNumber к
ļӵкš
1豸ָ롣ʹHKMOpenԴ
+ 2Ƿ꣺ֵȡFALSEʱԶ豸кţͬʱмģʽģʽ豸üģʽ豸кšȡTRUEʱԶ豸кţͬʱмģʽģʽ豸ģʽ豸кš
ֵ޷32λ
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ printf("ļкţ%08X\n",HKMGetSerialNumber(lpDev,FALSE));
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMGetVersion.html b/ddl/chm_output/standard_fun/HKMGetVersion.html new file mode 100644 index 0000000..804b2ab --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMGetVersion.html @@ -0,0 +1,32 @@ + + + + +HKMGetVersion + + + + + + + + + + + + + + + + + + + + + + + + +
HKMGetVersion õǰģ汾
õǰģ汾
 
ֵ޷32λ0-15λ޶ţ16-23λǸ汾ţ24-31λ汾š
C
printf("汾ţ%08X\n",HKMGetVersion());
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMIsKeyBusy.html b/ddl/chm_output/standard_fun/HKMIsKeyBusy.html new file mode 100644 index 0000000..2a18207 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMIsKeyBusy.html @@ -0,0 +1,45 @@ + + + + +HKMIsKeyBusy + + + + + + + + + + + + + + + + + + + + + + + + +
HKMIsKeyBusy жϼǷæ
жļӵļǷæ
1豸ָ롣ʹHKMOpenԴ
ֵֵæTRUEзFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ printf("ļӼ%s\n",HKMIsKeyBusy(lpDev)?"æ":"");
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMIsKeyDown.html b/ddl/chm_output/standard_fun/HKMIsKeyDown.html new file mode 100644 index 0000000..cb4a9f6 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMIsKeyDown.html @@ -0,0 +1,50 @@ + + + + +HKMIsKeyDown + + + + + + + + + + + + + + + + + + + + + + + + +
HKMIsKeyDown жϼǷ
жļӵļ̵ļǷ¡
1豸ָ롣ʹHKMOpenԴ
+ 2ַ(Unicode/Ansi)޷32/64λ(32λģ32λ64λģ64λ)ʹַ(ĬUnicodeַͨHKMSetMode޸ΪAnsiַ)ʹ޷32/64λͰɲ鿴
ֵֵ·TRUEû»ʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMKeyDown(lpDev,L"Alt");
+ printf("Alt״̬:%d\n",HKMIsKeyDown(lpDev,L"Alt"));
+ HKMDelayRnd(lpDev,90,120);
+ HKMKeyUp(lpDev,L"Alt");
+ printf("Alt״̬:%d\n",HKMIsKeyDown(lpDev,L"Alt"));
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMIsMouseBusy.html b/ddl/chm_output/standard_fun/HKMIsMouseBusy.html new file mode 100644 index 0000000..28076da --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMIsMouseBusy.html @@ -0,0 +1,45 @@ + + + + +HKMIsMouseBusy + + + + + + + + + + + + + + + + + + + + + + + + +
HKMIsMouseBusy жǷæ
жļӵǷæ
1豸ָ롣ʹHKMOpenԴ
ֵֵæTRUEзFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ printf("ļ%s\n",HKMIsMouseBusy(lpDev)?"æ":"");
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMIsMouseButtonDown.html b/ddl/chm_output/standard_fun/HKMIsMouseButtonDown.html new file mode 100644 index 0000000..1b59d32 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMIsMouseButtonDown.html @@ -0,0 +1,68 @@ + + + + +HKMIsMouseButtonDown + + + + + + + + + + + + + + + + + + + + + + + + +
HKMIsMouseButtonDown жǷ
жļӵļǷ¡
1豸ָ롣ʹHKMOpenԴ
+ 232λ޷ȡֵ¡
+ + + + + + + + + + + + + + + + + +
˵
0
1Ҽ
2м
ֵֵ·TRUEû»ʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMLeftDown(lpDev);
+ printf("״̬:%d\n",HKMIsMouseButtonDown(lpDev,0));
+ HKMDelayRnd(lpDev,90,120);
+ HKMLeftUp(lpDev);
+ printf("״̬:%d\n",HKMIsMouseButtonDown(lpDev,0));
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMIsOSMouseAccelerateEnabled.html b/ddl/chm_output/standard_fun/HKMIsOSMouseAccelerateEnabled.html new file mode 100644 index 0000000..6c4181c --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMIsOSMouseAccelerateEnabled.html @@ -0,0 +1,35 @@ + + + + +HKMIsOSMouseAccelerateEnabled + + + + + + + + + + + + + + + + + + + + + + + + +
HKMIsOSMouseAccelerateEnabled жǷϵͳ
жǷϵͳٹܡϵͳٹϵͳе“ָ뾫ȷ”Ĭǿġƶʱϵͳи죬ƶʱϵͳиϵͳеƶ벻ǹ̶ı
 
ֵֵѿϵͳٷTRUEδϵͳٷFALSE
C
if(HKMIsOSMouseAccelerateEnabled())
+     printf("ѿϵͳ\n");
+ else
+     printf("δϵͳ\n");
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMIsOpen.html b/ddl/chm_output/standard_fun/HKMIsOpen.html new file mode 100644 index 0000000..d89c85e --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMIsOpen.html @@ -0,0 +1,63 @@ + + + + +HKMIsOpen + + + + + + + + + + + + + + + + + + + + + + + + +
HKMIsOpen ж豸Ƿ
ж豸ǷѾOpen򿪡
1豸ָ롣ʹHKMOpenԴ
+ 2޷32λȡֵһҪͬʱʹöֵɽֵ㡣ȡֵ
+ + + + + + + + + + + + + + + + + +
ֵ˵
0ж豸Ƿ񱻴򿪣󡢼̻ģʽ豸ԣֵͬʱʹã
1жϼǷ񱻴򿪣߼ģʽ豸
2жǷ񱻴򿪣ģʽ豸
ֵֵѴ򿪷TRUEδ򿪷FALSE
C
DWORD dwDevId;
+LPVOID lpDev;
+dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+if(dwDevId==0xFFFFFFFF)
+{
    printf("δҵļ\n");
    return 0;
+}
+lpDev=HKMOpen(dwDevId,0);
+if(lpDev==NULL)
+{
    printf("ļʧ\n");
    return 0;
+}
+ if(HKMIsOpen(lpDev,0))
    printf("ļѴ");
+ else
    printf("ļδ");
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMKeyDown.html b/ddl/chm_output/standard_fun/HKMKeyDown.html new file mode 100644 index 0000000..b75ee87 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMKeyDown.html @@ -0,0 +1,48 @@ + + + + +HKMKeyDown + + + + + + + + + + + + + + + + + + + + + + + + +
HKMKeyDown ̰
̵ļ¡
1豸ָ롣ʹHKMOpenԴ
+ 2ַ(Unicode/Ansi)޷32/64λ(32λģ32λ64λģ64λ)ʹַ(ĬUnicodeַͨHKMSetMode޸ΪAnsiַ)ʹ޷32/64λͰɲ鿴ַ֧ϼϼİ“+”ӣ磺“Ctrl+C”
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMKeyDown(lpDev,L"F1");
+ HKMDelayRnd(lpDev,90,120);
+ HKMKeyUp(lpDev,L"F1");
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMKeyPress.html b/ddl/chm_output/standard_fun/HKMKeyPress.html new file mode 100644 index 0000000..32583d6 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMKeyPress.html @@ -0,0 +1,46 @@ + + + + +HKMKeyPress + + + + + + + + + + + + + + + + + + + + + + + + +
HKMKeyPress ̰
̵ļٵṵ̈º͵ʱʹHKMSetKeyInterval
1豸ָ롣ʹHKMOpenԴ
+ 2ַ(Unicode/Ansi)޷32/64λ(32λģ32λ64λģ64λ)ʹַ(ĬUnicodeַͨHKMSetMode޸ΪAnsiַ)ʹ޷32/64λͰɲ鿴ַ֧ϼϼİ“+”ӣ磺“Ctrl+C”
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMKeyPress(lpDev,L"F1");
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMKeyUp.html b/ddl/chm_output/standard_fun/HKMKeyUp.html new file mode 100644 index 0000000..da90a4c --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMKeyUp.html @@ -0,0 +1,48 @@ + + + + +HKMKeyUp + + + + + + + + + + + + + + + + + + + + + + + + +
HKMKeyUp ̵
̵ļ
1豸ָ롣ʹHKMOpenԴ
+ 2ַ(Unicode/Ansi)޷32/64λ(32λģ32λ64λģ64λ)ʹַ(ĬUnicodeַͨHKMSetMode޸ΪAnsiַ)ʹ޷32/64λͰɲ鿴ַ֧ϼϼİ“+”ӣ磺“Ctrl+C”
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMKeyDown(lpDev,L"F1");
+ HKMDelayRnd(lpDev,90,120);
+ HKMKeyUp(lpDev,L"F1");
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMLeftClick.html b/ddl/chm_output/standard_fun/HKMLeftClick.html new file mode 100644 index 0000000..c5dab4e --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMLeftClick.html @@ -0,0 +1,45 @@ + + + + +HKMLeftClick + + + + + + + + + + + + + + + + + + + + + + + + +
HKMLeftClick
º͵ʱʹHKMSetMouseInterval
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMLeftClick(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMLeftDoubleClick.html b/ddl/chm_output/standard_fun/HKMLeftDoubleClick.html new file mode 100644 index 0000000..5a8c537 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMLeftDoubleClick.html @@ -0,0 +1,45 @@ + + + + +HKMLeftDoubleClick + + + + + + + + + + + + + + + + + + + + + + + + +
HKMLeftDoubleClick ˫
˫º͵ʱʹHKMSetMouseInterval
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMLeftDoubleClick(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMLeftDown.html b/ddl/chm_output/standard_fun/HKMLeftDown.html new file mode 100644 index 0000000..26eaef8 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMLeftDown.html @@ -0,0 +1,47 @@ + + + + +HKMLeftDown + + + + + + + + + + + + + + + + + + + + + + + + +
HKMLeftDown
¡
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMLeftDown(lpDev);
+ HKMDelayRnd(lpDev,90,120);
+ HKMLeftUp(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMLeftUp.html b/ddl/chm_output/standard_fun/HKMLeftUp.html new file mode 100644 index 0000000..ac90cbb --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMLeftUp.html @@ -0,0 +1,47 @@ + + + + +HKMLeftUp + + + + + + + + + + + + + + + + + + + + + + + + +
HKMLeftUp
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMLeftDown(lpDev);
+ HKMDelayRnd(lpDev,90,120);
+ HKMLeftUp(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMMiddleClick.html b/ddl/chm_output/standard_fun/HKMMiddleClick.html new file mode 100644 index 0000000..5f62878 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMMiddleClick.html @@ -0,0 +1,45 @@ + + + + +HKMMiddleClick + + + + + + + + + + + + + + + + + + + + + + + + +
HKMMiddleClick м
мº͵ʱʹHKMSetMouseInterval
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMMiddleClick(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMMiddleDoubleClick.html b/ddl/chm_output/standard_fun/HKMMiddleDoubleClick.html new file mode 100644 index 0000000..ea57bb7 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMMiddleDoubleClick.html @@ -0,0 +1,45 @@ + + + + +HKMMiddleDoubleClick + + + + + + + + + + + + + + + + + + + + + + + + +
HKMMiddleDoubleClick м˫
м˫º͵ʱʹHKMSetMouseInterval
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMMiddleDoubleClick(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMMiddleDown.html b/ddl/chm_output/standard_fun/HKMMiddleDown.html new file mode 100644 index 0000000..6212c34 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMMiddleDown.html @@ -0,0 +1,47 @@ + + + + +HKMMiddleDown + + + + + + + + + + + + + + + + + + + + + + + + +
HKMMiddleDown м
м¡
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMMiddleDown(lpDev);
+ HKMDelayRnd(lpDev,90,120);
+ HKMMiddleUp(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMMiddleUp.html b/ddl/chm_output/standard_fun/HKMMiddleUp.html new file mode 100644 index 0000000..50429b4 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMMiddleUp.html @@ -0,0 +1,47 @@ + + + + +HKMMiddleUp + + + + + + + + + + + + + + + + + + + + + + + + +
HKMMiddleUp м
м
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMMiddleDown(lpDev);
+ HKMDelayRnd(lpDev,90,120);
+ HKMMiddleUp(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMMouseWheel.html b/ddl/chm_output/standard_fun/HKMMouseWheel.html new file mode 100644 index 0000000..71f540d --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMMouseWheel.html @@ -0,0 +1,46 @@ + + + + +HKMMouseWheel + + + + + + + + + + + + + + + + + + + + + + + + +
HKMMouseWheel
ֹصúHKMSetMode
1豸ָ롣ʹHKMOpenԴ
+ 232λǹֹϹ¹Ǹ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMMouseWheel(lpDev,3);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMMouseWheelP.html b/ddl/chm_output/standard_fun/HKMMouseWheelP.html new file mode 100644 index 0000000..8143121 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMMouseWheelP.html @@ -0,0 +1,46 @@ + + + + +HKMMouseWheelP + + + + + + + + + + + + + + + + + + + + + + + + +
HKMMouseWheelP
ײĹֹUSBײһιֹһĴ127(ֶοֵ3)ڸʹԼʵֹصúHKMSetMode
1豸ָ롣ʹHKMOpenԴ
+ 232λǹֹϹ¹Ǹ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMMouseWheelP(lpDev,3);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMMoveR.html b/ddl/chm_output/standard_fun/HKMMoveR.html new file mode 100644 index 0000000..16ee8fa --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMMoveR.html @@ -0,0 +1,47 @@ + + + + +HKMMoveR + + + + + + + + + + + + + + + + + + + + + + + + +
HKMMoveR ƶ
ƶƶƶϵͳĬʹ٣ʵƶĻƶ벻ͬϵͳ㷨Ӱ죬ƶͬʱƶľҲǹ̶ġɹرϵͳ(ָ뾫ȷ)ƶ׼⡣صúHKMSetMode
1豸ָ롣ʹHKMOpenԴ
+ 2꣺32λƶĺꡣ
+ 3꣺32λƶꡣ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMMoveR(lpDev,100,50);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMMoveR2.html b/ddl/chm_output/standard_fun/HKMMoveR2.html new file mode 100644 index 0000000..59318db --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMMoveR2.html @@ -0,0 +1,47 @@ + + + + +HKMMoveR2 + + + + + + + + + + + + + + + + + + + + + + + + +
HKMMoveR2 ƶ
ƶHKMMoveRϵͳĬϵӰƶ⣬ȱDzϵͳλصúHKMSetModeHKMSetAbsMouseScrnRes
1豸ָ롣ʹHKMOpenԴ
+ 2꣺32λƶĺꡣ
+ 3꣺32λƶꡣ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMMoveR2(lpDev,100,50);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMMoveRP.html b/ddl/chm_output/standard_fun/HKMMoveRP.html new file mode 100644 index 0000000..0fb14b3 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMMoveRP.html @@ -0,0 +1,47 @@ + + + + +HKMMoveRP + + + + + + + + + + + + + + + + + + + + + + + + +
HKMMoveRP ƶ
ײƶUSBײһƶڸʹԼʵƶΪͨΪϷƶ벻ͬͨһƶ붼127(ƶ꣬Ļ)Ϸһƶ붼32767
1豸ָ롣ʹHKMOpenԴ
+ 2꣺32λƶĺꡣ
+ 3꣺32λƶꡣ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMMoveRP(lpDev,100,50);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMMoveTo.html b/ddl/chm_output/standard_fun/HKMMoveTo.html new file mode 100644 index 0000000..32ca40e --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMMoveTo.html @@ -0,0 +1,47 @@ + + + + +HKMMoveTo + + + + + + + + + + + + + + + + + + + + + + + + +
HKMMoveTo ƶ
ƶָĻꡣصúHKMSetModeHKMSetMousePosPrecisionHKMSetMouseMoveTimeoutHKMSetMousePosMaxOffsetHKMSetAbsMouseScrnRes
1豸ָ롣ʹHKMOpenԴ
+ 2꣺32λҪƶĺꡣ
+ 3꣺32λҪƶꡣ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMMoveTo(lpDev,100,50);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMOpen.html b/ddl/chm_output/standard_fun/HKMOpen.html new file mode 100644 index 0000000..a2c3f2b --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMOpen.html @@ -0,0 +1,72 @@ + + + + +HKMOpen + + + + + + + + + + + + + + + + + + + + + + + + +
HKMOpen 豸
ļӣԱвʹʱעƶ𣩣ϵͳĻ÷仯ʱҪ´豸ȹر豸ٴ豸磺ĻֱʻĻDPI()仯ָٶȻ“ָ뾫ȷ”仯
1豸ID޷32λʹHKMSearchDeviceHKMSearchDevice2Ի
+ 2DPIģʽ޷32λƶHKMMoveToHKMMoveR2ͻ꣨HKMGetCursorPosHKMGetCursorPos2ʱʹõDPIģʽϵͳΪֳ֧ţʹ˲ͬ꣬ͬDPIģʽӦͬ㷽ʽDPIģʽеǰֶwindowsϵͳеģʽɲ΢˽ϸݣ漸ģʽı仯ȡֵ
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ֵ˵
0ÿʾDPI֪ģʽϵͳDPIúʾDPIӰ죬ÿʾһһӦģwindowsϵͳWIN8.1ʼִ֧ģʽWIN8.1ǰЧϵͳDPI֪
1ϵͳDPI֪WIN8.1ǰϵͳÿʾһһӦģWIN8.1WIN8.1ԺϵͳÿʾòͬDPIÿʾزһһӦϵֻһʾҿעص¼ûĹDPIÿʾػһһӦġ
2DPI֪ûдDPIʱ״̬̰ϵͳDPIʾDPI100%ʱ״̬ϵͳԿǣDPI100%ʱһDPI100%ʱᵼ³ģ
3DPIãģʽҪĿDzͷźִDPI̡ڷϵ£ЧÿʾDPI֪ڲϵ£DPI任޷ϵǣWIN8.1ǰϵͳϵͳDPI100%ߵǰĵDPI֪ϵͳDPI֪WIN8.1WIN8.1ԺϵͳʾDPI100%ʱǰĵDPI֪ÿʾDPI֪ʱ
4ǰĵDPI֪ݵǰľDPI֪
ֵָ롣豸ҲԿɾʧܷNULLʹʱHKMCloseԹرͷԴWIN10ǰϵͳʧԭڰȫػϵͳȨ⵼DPIʧܣ԰Ѳ2Ϊ3ģDPIֽ֧⡣
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ //ִв
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMOpen2.html b/ddl/chm_output/standard_fun/HKMOpen2.html new file mode 100644 index 0000000..2321bad --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMOpen2.html @@ -0,0 +1,80 @@ + + + + +HKMOpen2 + + + + + + + + + + + + + + + + + + + + + + + + +
HKMOpen2 豸
ļӣһģʽһģʽԱǽвʹʱעƶ𣩣ϵͳĻ÷仯ʱҪ´豸ȹر豸ٴ豸磺ĻֱʻĻDPI()仯ָٶȻ“ָ뾫ȷ”仯
1һ豸ID޷32λʹHKMSearchDeviceHKMSearchDevice2Ի
+ 2ڶ豸ID޷32λʹHKMSearchDeviceHKMSearchDevice2Ի
+ 3DPIģʽ޷32λƶHKMMoveToHKMMoveR2ͻ꣨HKMGetCursorPosHKMGetCursorPos2ʱʹõDPIģʽϵͳΪֳ֧ţʹ˲ͬ꣬ͬDPIģʽӦͬ㷽ʽDPIģʽеǰֶwindowsϵͳеģʽɲ΢˽ϸݣ漸ģʽı仯ȡֵ
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ֵ˵
0ÿʾDPI֪ģʽϵͳDPIúʾDPIӰ죬ÿʾһһӦģwindowsϵͳWIN8.1ʼִ֧ģʽWIN8.1ǰЧϵͳDPI֪
1ϵͳDPI֪WIN8.1ǰϵͳÿʾһһӦģWIN8.1WIN8.1ԺϵͳÿʾòͬDPIÿʾزһһӦϵֻһʾҿעص¼ûĹDPIÿʾػһһӦġ
2DPI֪ûдDPIʱ״̬̰ϵͳDPIʾDPI100%ʱ״̬ϵͳԿǣDPI100%ʱһDPI100%ʱᵼ³ģ
3DPIãģʽҪĿDzͷźִDPI̡ڷϵ£ЧÿʾDPI֪ڲϵ£DPI任޷ϵǣWIN8.1ǰϵͳϵͳDPI100%ߵǰĵDPI֪ϵͳDPI֪WIN8.1WIN8.1ԺϵͳʾDPI100%ʱǰĵDPI֪ÿʾDPI֪ʱ
4ǰĵDPI֪ݵǰľDPI֪
ֵָ롣豸ҲԿɾʧܷNULLʹʱHKMCloseԹرͷԴWIN10ǰϵͳʧԭڰȫػϵͳȨ⵼DPIʧܣ԰Ѳ3Ϊ3ģDPIֽ֧⡣
C
DWORD dwDevId1,dwDevId2;
+ LPVOID lpDev;
+ dwDevId1=HKMSearchDevice(0x1234,0xABCD,2);
+ if(dwDevId1==0xFFFFFFFF)
+ {
+     printf("δҵļ(ģʽ)\n");
    return 0;
+ }
+ dwDevId2=HKMSearchDevice(0x1234,0xABCD,3);
+if(dwDevId2==0xFFFFFFFF)
+{
+    printf("δҵļ(ģʽ)\n");
+    return 0;
+}
+ lpDev=HKMOpen2(dwDevId1,dwDevId2,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ //ִв
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMOutputString.html b/ddl/chm_output/standard_fun/HKMOutputString.html new file mode 100644 index 0000000..582ecfe --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMOutputString.html @@ -0,0 +1,46 @@ + + + + +HKMOutputString + + + + + + + + + + + + + + + + + + + + + + + + +
HKMOutputString ַ
ҪıĵطַַģʽʹHKMSetModeٶʹHKMSetKeyInterval룬Ҫ޸ַģʽҪע⵱ǰ뷨е뷨֧룬޷ȫ޷⡣
1豸ָ롣ʹHKMOpenԴ
+ 2ַַ(Unicode/Ansi)ĬUnicodeַͨHKMSetMode޸ΪAnsiַ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMOutputString(lpDev,L"ַ");
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMReleaseKeyboard.html b/ddl/chm_output/standard_fun/HKMReleaseKeyboard.html new file mode 100644 index 0000000..b54b04a --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMReleaseKeyboard.html @@ -0,0 +1,47 @@ + + + + +HKMReleaseKeyboard + + + + + + + + + + + + + + + + + + + + + + + + +
HKMReleaseKeyboard ͷż̰
ļм̰µļȫ
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMKeyDown(lpDev,L"A");
+ HKMDelayRnd(lpDev,90,120);
+ HKMReleaseKeyboard(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMReleaseMouse.html b/ddl/chm_output/standard_fun/HKMReleaseMouse.html new file mode 100644 index 0000000..9f7e371 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMReleaseMouse.html @@ -0,0 +1,47 @@ + + + + +HKMReleaseMouse + + + + + + + + + + + + + + + + + + + + + + + + +
HKMReleaseMouse ͷ갴
ļ갴µļȫ
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMLeftDown(lpDev);
+ HKMDelayRnd(lpDev,90,120);
+ HKMReleaseMouse(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMRightClick.html b/ddl/chm_output/standard_fun/HKMRightClick.html new file mode 100644 index 0000000..5a2f3c7 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMRightClick.html @@ -0,0 +1,45 @@ + + + + +HKMRightClick + + + + + + + + + + + + + + + + + + + + + + + + +
HKMRightClick Ҽ
Ҽº͵ʱʹHKMSetMouseInterval
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMRightClick(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMRightDoubleClick.html b/ddl/chm_output/standard_fun/HKMRightDoubleClick.html new file mode 100644 index 0000000..3ce98eb --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMRightDoubleClick.html @@ -0,0 +1,45 @@ + + + + +HKMRightDoubleClick + + + + + + + + + + + + + + + + + + + + + + + + +
HKMRightDoubleClick Ҽ˫
Ҽ˫º͵ʱʹHKMSetMouseInterval
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMRightDoubleClick(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMRightDown.html b/ddl/chm_output/standard_fun/HKMRightDown.html new file mode 100644 index 0000000..0fe8d92 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMRightDown.html @@ -0,0 +1,47 @@ + + + + +HKMRightDown + + + + + + + + + + + + + + + + + + + + + + + + +
HKMRightDown Ҽ
Ҽ¡
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMRightDown(lpDev);
+ HKMDelayRnd(lpDev,90,120);
+ HKMRightUp(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMRightUp.html b/ddl/chm_output/standard_fun/HKMRightUp.html new file mode 100644 index 0000000..580dc6e --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMRightUp.html @@ -0,0 +1,47 @@ + + + + +HKMRightUp + + + + + + + + + + + + + + + + + + + + + + + + +
HKMRightUp Ҽ
Ҽ
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMRightDown(lpDev);
+ HKMDelayRnd(lpDev,90,120);
+ HKMRightUp(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMSearchDevice.html b/ddl/chm_output/standard_fun/HKMSearchDevice.html new file mode 100644 index 0000000..419150d --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMSearchDevice.html @@ -0,0 +1,56 @@ + + + + +HKMSearchDevice + + + + + + + + + + + + + + + + + + + + + + + + +
HKMSearchDevice 豸
ļӡ
1VID޷32λÿļӵֵܲһù߲鿴ֵΪ65536ʱԴҵļӵVIDΪֵ
+2PID޷32λÿļӵֵܲһù߲鿴ֵΪ65536ʱԴҵļӵPIDΪֵ
+3豸ģʽ޷32λòҵļӵģʽȡֵ£
+ + + + + + + + + + + + + + + + + + + + + +
ֵ˵
0ģʽ
1ģʽ
2ģʽ
3ģʽ
ֵ޷32λһʱ豸IDţֻԵǰģЧûҵʧܷ0xFFFFFFFF
C
printf("豸ID:%08X\n",HKMSearchDevice(0x1234,0xABCD,0));
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMSearchDevice2.html b/ddl/chm_output/standard_fun/HKMSearchDevice2.html new file mode 100644 index 0000000..bfde177 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMSearchDevice2.html @@ -0,0 +1,57 @@ + + + + +HKMSearchDevice2 + + + + + + + + + + + + + + + + + + + + + + + + +
HKMSearchDevice2 豸
ļӡ
1VID޷32λÿļӵֵܲһù߲鿴ֵΪ65536ʱԴҵļӵVIDΪֵ
+2PID޷32λÿļӵֵܲһù߲鿴ֵΪ65536ʱԴҵļӵPIDΪֵ
+3кţ޷32λÿļӵֵһù߲鿴
+4豸ģʽ޷32λòҵļӵģʽȡֵ£
+ + + + + + + + + + + + + + + + + + + + + +
ֵ˵
0ģʽ
1ģʽ
2ģʽ
3ģʽ
ֵ޷32λһʱ豸IDţֻԵǰģЧûҵʧܷ0xFFFFFFFF
C
printf("豸ID:%08X\n",HKMSearchDevice2(0x1234,0xABCD,0x12345678,1));
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMSearchDeviceAll.html b/ddl/chm_output/standard_fun/HKMSearchDeviceAll.html new file mode 100644 index 0000000..d36037b --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMSearchDeviceAll.html @@ -0,0 +1,70 @@ + + + + +HKMSearchDeviceAll + + + + + + + + + + + + + + + + + + + + + + + + +
HKMSearchDeviceAll ȫ豸
ҷȫļӡ
1VID޷32λÿļӵֵܲһù߲鿴ֵΪ65536ʱԴҵļӵVIDΪֵ
+2PID޷32λÿļӵֵܲһù߲鿴ֵΪ65536ʱԴҵļӵPIDΪֵ
+3豸ģʽ޷32λòҵļӵģʽȡֵ£
+ + + + + + + + + + + + + + + + + + + + + +
ֵ˵
0ģʽ
1ģʽ
2ģʽ
3ģʽ
ֵ޷32λַɹ豸ID飬HKMGetDataCountȡԪʧܷNULLʹַʱʹHKMFreeDataͷռõԴ
C
LPDWORD pDevId;
+ DWORD dwCount,i;
+ pDevId=HKMSearchDeviceAll(0x1234,0xABCD,0);
+ if(pDevId==NULL)
+ {
+     printf("豸ʧ\n");
+     return 0;
+ }
+ dwCount=HKMGetDataCount(pDevId);
+ printf("ҵ豸:%u\n",dwCount);
+ for(i=0;i<dwCount;i++)
+ {
+     printf("%08X\n",pDevId[i]);
+ }
+ HKMFreeData(pDevId);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMSetAbsMouseScrnRes.html b/ddl/chm_output/standard_fun/HKMSetAbsMouseScrnRes.html new file mode 100644 index 0000000..3f94bfd --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMSetAbsMouseScrnRes.html @@ -0,0 +1,47 @@ + + + + +HKMSetAbsMouseScrnRes + + + + + + + + + + + + + + + + + + + + + + + + +
HKMSetAbsMouseScrnRes þĻֱ
þƶʾĻֱʡйغHKMMoveToHKMMoveR2
1豸ָ롣ʹHKMOpenԴ
+ 2ȣ32λ2Ͳ3ȡ0ʱĻֱΪǰϵͳʾĻֱʡ
+ 3߶ȣ32λ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMSetAbsMouseScrnRes(lpDev,800,600);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMSetDevDescInfo.html b/ddl/chm_output/standard_fun/HKMSetDevDescInfo.html new file mode 100644 index 0000000..4b2c506 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMSetDevDescInfo.html @@ -0,0 +1,71 @@ + + + + +HKMSetDevDescInfo + + + + + + + + + + + + + + + + + + + + + + + + +
HKMSetDevDescInfo 豸Ϣ
ļӵ豸ϢļӵUSBӿϢ豸Ϣı䣬ϵͳʶ豸ԶװҪȴӻʱʹãвҪγӣᵼϵͳװʧܡ޸ĺҪر豸ȴϵͳװɺٲҺʹ豸ЩܻܵӰ죬޷ļӻĹ̼汾ڵ1.2.0ִ֧˺
1豸ָ롣ʹHKMOpenԴ
+ 2VID޷32λUSBӿڵIDֵķΧ0-65535ֵΪ65536ʱ޸ļVIDֵ
+ 3PID޷32λUSBӿڵIJƷIDֵķΧ0-65535ֵΪ65536ʱ޸ļPIDֵ
+ 4汾޷32λUSBӿڵ豸汾ֵķΧ0-65535ֵΪ65536ʱ޸ļӰ汾ֵ
+ 5ַ(Unicode/Ansi)޷32/64λ(32λģ32λ64λģ64λ)USBӿڵַĬUnicodeַͨHKMSetMode޸ΪAnsiַ޸ʱʹ޷32/64λֵΪ1
+ 6Ʒַ(Unicode/Ansi)޷32/64λ(32λģ32λ64λģ64λ)USBӿڵIJƷòƷַĬUnicodeַͨHKMSetMode޸ΪAnsiַ޸IJƷʱʹ޷32/64λֵΪ1
+ 7ģʽ޷32λȡֵ£
+ + + + + + + + + + + + + + + + + +
ֵ˵
0ȡʱá
1ʱãϵ磨USBӿͣγļӣָ
2ãϵ󲻻ָôƣϵֻ5Ρ
+ 8Ƿ꣺ֵȡFALSEʱԶ豸Ϣͬʱмģʽģʽ豸üģʽ豸豸ϢȡTRUEʱԶ豸Ϣͬʱмģʽģʽ豸ģʽ豸豸Ϣ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ //޸豸ϢPID޸
+ HKMSetDevDescInfo(lpDev,0x1235,0x10000,0x0101,(LPCWSTR)1,L"Mouse",1,FALSE);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMSetKeyInterval.html b/ddl/chm_output/standard_fun/HKMSetKeyInterval.html new file mode 100644 index 0000000..8759bc9 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMSetKeyInterval.html @@ -0,0 +1,47 @@ + + + + +HKMSetKeyInterval + + + + + + + + + + + + + + + + + + + + + + + + +
HKMSetKeyInterval ðʱ
ṵ̈º͵֮ʱֻԵǰ豸ЧʱǸһΧڵֵҲóɹ̶ֵĬϰʱǸ100븽ֵйغHKMKeyPressHKMOutputString
1豸ָ롣ʹHKMOpenԴ
+ 2ʱ䣺޷32λλ롣
+ 3ʱ䣺޷32λλ롣ʱʱʱʱǹ̶ֵ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMSetKeyInterval(lpDev,100,150);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMSetLightMode.html b/ddl/chm_output/standard_fun/HKMSetLightMode.html new file mode 100644 index 0000000..4e05047 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMSetLightMode.html @@ -0,0 +1,69 @@ + + + + +HKMSetLightMode + + + + + + + + + + + + + + + + + + + + + + + + +
HKMSetLightMode ָʾģʽ
ļӵָʾģʽļӻĹ̼汾ڵ1.1.0ִ֧˺
1豸ָ롣ʹHKMOpenԴ
+ 2ģʽ޷32λȡֵ£
+ + + + + + + + + + + + + + + + + + + + + +
ֵ˵
0˸(Ĭģʽ)
1
2
8ģʽλӸλʱģʽ䣬ֵλʹ
+ 3Ƿ꣺ֵȡFALSEʱԶָʾģʽͬʱмģʽģʽ豸üģʽ豸ָʾģʽȡTRUEʱԶָʾģʽͬʱмģʽģʽ豸ģʽ豸ָʾģʽ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMSetLightMode(lpDev,1,FALSE);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMSetMode.html b/ddl/chm_output/standard_fun/HKMSetMode.html new file mode 100644 index 0000000..9ec2401 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMSetMode.html @@ -0,0 +1,153 @@ + + + + +HKMSetMode + + + + + + + + + + + + + + + + + + + + + + + + +
HKMSetMode ģʽ
ļӵĹģʽֻԵǰ豸Ч
1豸ָ롣ʹHKMOpenԴ
+ 2ԣ޷32λ
+ 3ģʽ޷32λ
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
˵ģʽģʽ˵
2ƶķʽ0ǷƶĬģʽͨһֵѡͬʱѡֵûϡйغHKMMoveToHKMMoveRHKMMoveR2ƶģʽֵ1ƶֻ׷ƶٶȣģֶƶʽ
2ƶֻͨƶǾƶƶֻʾƶʹúHKMMoveToHKMMoveR2ԾƶʽУҪļӿ“”ģʽ“+”ģʽע⣺HKMMoveToûþƶҲʵ־ƶHKMMoveR2þƶþʵƶ
4ƶģʽƶָֻûʹ“ָ뾫ȷ”“ѡָƶٶ”м䣨ƶĻı1:1win10Dpi100%ʱʹãƶвƶӰ죬ŵٶȿЩʹþƶʱЧHKMMoveRЧ
0ģʽʼ٣١ʹÿƶʱЧ
8ģʽ޼Ӽ٣ʱήٶȡʹÿƶʱЧHKMMoveToHKMMoveR2ھƶͻƶģʽûʹʱЧ
16ģʽ޼Ӽ٣ʱٶȡʹÿƶʱЧHKMMoveToHKMMoveR2ھƶͻƶģʽûʹʱЧ
3ֹʽйغHKMMouseWheel0ģֵֶķʽٶȽ(Ĭģʽ)
1ٹֻ׷ֹٶȣģֵֶķʽ
4ַ룬ͬڽַܵ벻ͬѡ˻յ룬йغHKMOutputString0ANSIַ(Ĭģʽ)
1UNICODEַ
2ANSIַģʽ0IJǣ֡ĸͲַʱֶһٶȸ죬ܼ̻뷨š
3UNICODEַģʽ1IJǣ֡ĸͲַʱֶһٶȸ죬ܼ̻뷨š
4ʹüճַŵַʱٶȸҲ뷨Ӱ죬ȱǻдݺͲ֧ڡ
5ͬʽͬǵȴӵݱӲգϵͳѾ˸ݣʱϵͳæӲյϵͳ֮ʱһʱ϶̣1롣0ȫͬĬģʽ첽ͨһֵѡͬʱѡֵûϡйغHKMKeyPressHKMKeyDownHKMKeyUpHKMLeftClickHKMRightClickHKMMiddleClickHKMXBtn1ClickHKMXBtn2ClickHKMLeftDoubleClickHKMRightDoubleClickHKMMiddleDoubleClickHKMXBtn1DoubleClickHKMXBtn2DoubleClickHKMLeftDownHKMRightDownHKMMiddleDownHKMXBtn1DownHKMXBtn2DownHKMLeftUpHKMRightUpHKMMiddleUpHKMXBtn1UpHKMXBtn2UpHKMMoveRPHKMMouseWheelPHKMOutputString1첽ȴ̶ֱӷ
2첽ȴ궯ֱӷ
6ʱĸʷֲʽйغHKMDelayRndHKMKeyPressHKMLeftClickHKMRightClickHKMMiddleClickHKMXBtn1ClickHKMXBtn2ClickHKMLeftDoubleClickHKMRightDoubleClickHKMMiddleDoubleClickHKMXBtn1DoubleClickHKMXBtn2DoubleClickHKMOutputString0ʱȷֲʱֵĸͬ(Ĭģʽ)
1ʱƫСֲʱֵԽСԽߣֵĸʽӽ0
7ʱʽйغHKMDelayRndHKMKeyPressHKMLeftClickHKMRightClickHKMMiddleClickHKMXBtn1ClickHKMXBtn2ClickHKMLeftDoubleClickHKMRightDoubleClickHKMMiddleDoubleClickHKMXBtn1DoubleClickHKMXBtn2DoubleClickHKMOutputString0Ϣ(Ĭģʽ)
1Ϣ
32ͷֵеַͣڽеı̹߶Unicodeֲַ֧õ⡣йغHKMGetDevStringHKMKeyPressHKMKeyDownHKMKeyUpHKMOutputStringHKMVerifyUserDataHKMVerifyUserData20ַʹUnicode(Ĭģʽ)
1ַʹAnsi
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMSetMode(lpDev,2,1);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMSetMouseInterval.html b/ddl/chm_output/standard_fun/HKMSetMouseInterval.html new file mode 100644 index 0000000..faf1151 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMSetMouseInterval.html @@ -0,0 +1,47 @@ + + + + +HKMSetMouseInterval + + + + + + + + + + + + + + + + + + + + + + + + +
HKMSetMouseInterval ʱ
º͵֮ʱֻԵǰ豸ЧʱǸһΧڵֵҲóɹ̶ֵĬʱǸ100븽ֵйغHKMLeftClickHKMRightClickHKMMiddleClickHKMLeftDoubleClickHKMRightDoubleClickHKMMiddleDoubleClick
1豸ָ롣ʹHKMOpenԴ
+ 2ʱ䣺޷32λλ롣
+ 3ʱ䣺޷32λλ롣ʱʱʱʱǹ̶ֵ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMSetMouseInterval(lpDev,100,150);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMSetMouseMoveTimeout.html b/ddl/chm_output/standard_fun/HKMSetMouseMoveTimeout.html new file mode 100644 index 0000000..ee6b05e --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMSetMouseMoveTimeout.html @@ -0,0 +1,46 @@ + + + + +HKMSetMouseMoveTimeout + + + + + + + + + + + + + + + + + + + + + + + + +
HKMSetMouseMoveTimeout ƶʱʱ
ƶʱ䳬趨ʱʱֹͣƶFALSEֻԵǰ豸ЧغHKMMoveTo
1豸ָ롣ʹHKMOpenԴ
+ 2ʱ䣺޷32λƶʱʱ䣬λ롣ȡֵΪ0xFFFFFFFFʱȡʱʱơĬֵ10롣
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMSetMouseMoveTimeout(lpDev,50000);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMSetMousePosMaxOffset.html b/ddl/chm_output/standard_fun/HKMSetMousePosMaxOffset.html new file mode 100644 index 0000000..c66d3ca --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMSetMousePosMaxOffset.html @@ -0,0 +1,46 @@ + + + + +HKMSetMousePosMaxOffset + + + + + + + + + + + + + + + + + + + + + + + + +
HKMSetMousePosMaxOffset ƫ
ֶƶʱͨÿζ㵽ͬ꣬һΧģΪõƫֵֻԵǰ豸ЧغHKMMoveTo
1豸ָ롣ʹHKMOpenԴ
+ 2ƫƣ޷32λƫֵĬֵ0
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMSetMousePosMaxOffset(lpDev,2);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMSetMousePosPrecision.html b/ddl/chm_output/standard_fun/HKMSetMousePosPrecision.html new file mode 100644 index 0000000..ec46cf7 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMSetMousePosPrecision.html @@ -0,0 +1,46 @@ + + + + +HKMSetMousePosPrecision + + + + + + + + + + + + + + + + + + + + + + + + +
HKMSetMousePosPrecision 꾫
ϵͳеƶٶȹʱ޷ȷÿأĿ긽ܾãʱҪ꾫ȣƶĿʱƫֻԵǰ豸ЧغHKMMoveToHKMMoveR2
1豸ָ롣ʹHKMOpenԴ
+ 2ȣ޷32λƫĬֵ0
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMSetMousePosPrecision(lpDev,1);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMSetMouseSpeed.html b/ddl/chm_output/standard_fun/HKMSetMouseSpeed.html new file mode 100644 index 0000000..98d199e --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMSetMouseSpeed.html @@ -0,0 +1,48 @@ + + + + +HKMSetMouseSpeed + + + + + + + + + + + + + + + + + + + + + + + + +
HKMSetMouseSpeed ٶ
ƶٶȡõǼƶٶȵֵƶģʽHKMMoveRPӰ졣йغHKMMoveRHKMMoveR2HKMMoveTo
1豸ָ롣ʹHKMOpenԴ
+2ٶȣֵ޷32λȡֵΧ5-100ֵԽٶԽ죬Ĭֵ45ʹٶֵȫ̶ˣƶٶСΧƶģʽHKMMoveRP⣩
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+LPVOID lpDev;
+dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+if(dwDevId==0xFFFFFFFF)
+{
+    printf("δҵļ\n");
+    return 0;
+}
+lpDev=HKMOpen(dwDevId,0);
+if(lpDev==NULL)
+{
+    printf("ļʧ\n");
+    return 0;
+}
+HKMSetMouseSpeed(lpDev,20);
+HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMSetOSMouseSpeed.html b/ddl/chm_output/standard_fun/HKMSetOSMouseSpeed.html new file mode 100644 index 0000000..fa94f5d --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMSetOSMouseSpeed.html @@ -0,0 +1,33 @@ + + + + +HKMSetOSMouseSpeed + + + + + + + + + + + + + + + + + + + + + + + + +
HKMSetOSMouseSpeed ϵͳٶ
ϵͳٶȡϵͳٶϵͳе“ѡָƶٶ”õƶٶϵͳƶٶȵı
1ٶȣ32λֵķΧ1-20ֵԽϵͳеٶԽ죬ϵͳĬֵ10
+2Ƿ񱣴棺ֵȡTRUEʱϵͳȻЧȡFALSEʱϵͳָá
ֵֵɹTRUEʧܷFALSE
C
HKMSetOSMouseSpeed(10,FALSE);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMSetResetMode.html b/ddl/chm_output/standard_fun/HKMSetResetMode.html new file mode 100644 index 0000000..6b9c863 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMSetResetMode.html @@ -0,0 +1,66 @@ + + + + +HKMSetResetMode + + + + + + + + + + + + + + + + + + + + + + + + +
HKMSetResetMode øλģʽ
ļӵʱλģʽʱλģʽʱλʹHKMSetResetTimeļӻĹ̼汾ڵ1.1.0ִ֧˺
1豸ָ롣ʹHKMOpenԴ
+ 2ģʽ޷32λȡֵ£
+ + + + + + + + + + + + + +
ֵ˵
0Ӳλ(Ĭģʽ)
1갴״̬λ
+ 3Ƿ꣺ֵȡFALSEʱԶøλģʽͬʱмģʽģʽ豸üģʽ豸ĸλģʽȡTRUEʱԶøλģʽͬʱмģʽģʽ豸ģʽ豸ĸλģʽ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMSetResetMode(lpDev,1,FALSE);
+ for(;;)
+ {
+     HKMSetResetTime(lpDev,1000,FALSE);
+     HKMDelayRnd(lpDev,90,120);
+ }
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMSetResetTime.html b/ddl/chm_output/standard_fun/HKMSetResetTime.html new file mode 100644 index 0000000..c47dd37 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMSetResetTime.html @@ -0,0 +1,52 @@ + + + + +HKMSetResetTime + + + + + + + + + + + + + + + + + + + + + + + + +
HKMSetResetTime øλʱ
ļӵʱλʱ䡣иʱʹøúʱ䵽˾ͻʹӸλʹʺӵļʹʱ¼ʱλʱʧЧҪʹøúáļʱ»ͨѶ쳣߳ͻȻ˳°µļ޷ȥЩ²κӷաֹͣļӲرʱλΪļ̺ǽӴһ㲻ָλļӻһִ֧˺
+ ʺӵĺУHKMGetVersionHKMIsOpenHKMCloseHKMSetModeHKMSetKeyIntervalHKMSetMouseIntervalHKMSetAbsMouseScrnResHKMSetMouseMoveTimeoutHKMSetMousePosMaxOffsetHKMSetMousePosPrecisionHKMDelayRndHKMCheckPressedKeysHKMFreeDataHKMIsOSMouseAccelerateEnabledHKMEnableOSMouseAccelerateHKMGetOSMouseSpeedHKMSetOSMouseSpeedHKMGetDevStringغHKMSetResetMode
1豸ָ롣ʹHKMOpenԴ
+ 2ʱʱ䣺޷32λλ롣ȡ0ʱرʱλ0ʱСֵ50룬ֵ19Сʱ
+ 3Ƿ꣺ֵȡFALSEʱԶʱλʱ䣬ͬʱмģʽģʽ豸üģʽ豸ʱλʱ䡣ȡTRUEʱԶʱλʱ䣬ͬʱмģʽģʽ豸ģʽ豸ʱλʱ䡣
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ for(;;)
+ {
+     HKMSetResetTime(lpDev,1000,FALSE);
+     HKMDelayRnd(lpDev,90,120);
+ }
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMVerifyUserData.html b/ddl/chm_output/standard_fun/HKMVerifyUserData.html new file mode 100644 index 0000000..7b15f8d --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMVerifyUserData.html @@ -0,0 +1,47 @@ + + + + +HKMVerifyUserData + + + + + + + + + + + + + + + + + + + + + + + + +
HKMVerifyUserData ֤û
֤ûʹ“ļ޸”дַַǷͬļӻһĹ̼汾ڵ1.2.0ִ֧˺صúHKMSetMode
1豸ָ롣ʹHKMOpenԴ
+ 2ַַ(Unicode/Ansi)ĬUnicodeַͨHKMSetMode޸ΪAnsiַ
+ 3Ƿ꣺ֵȡFALSEʱԶ֤ûݣͬʱмģʽģʽ豸֤ģʽ豸ûݡȡTRUEʱԶ֤ûݣͬʱмģʽģʽ豸֤ģʽ豸ûݡ
ֵֵͬTRUEͬʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ printf("֤ûݣ%d\n",HKMVerifyUserData(lpDev,L"ҵû",FALSE));
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMVerifyUserData2.html b/ddl/chm_output/standard_fun/HKMVerifyUserData2.html new file mode 100644 index 0000000..411d162 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMVerifyUserData2.html @@ -0,0 +1,47 @@ + + + + +HKMVerifyUserData2 + + + + + + + + + + + + + + + + + + + + + + + + +
HKMVerifyUserData2 ֤û2
֤ûʹ“ļ޸”дַַǷͬHKMVerifyUserData棬ûݺ֤ݷ룬޷֤ͨݻûݡڹ̼ԭHKMVerifyUserDataHKMVerifyUserData2֧ͬʱʹáļӻһִ֧˺صúHKMSetMode
1豸ָ롣ʹHKMOpenԴ
+ 2֤ݣַ(Unicode/Ansi)ĬUnicodeַͨHKMSetMode޸ΪAnsiַ
+ 3Ƿ꣺ֵȡFALSEʱԶ֤ûݣͬʱмģʽģʽ豸֤ģʽ豸֤ݡȡTRUEʱԶ֤ûݣͬʱмģʽģʽ豸֤ģʽ豸֤ݡ
ֵ32λ޷֤ͨ32λкֵ֤ûͨ32λкֵķ룬ʧܷ0кſʹHKMGetSerialNumberȡ
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ printf("֤ûݣ%d\n",HKMVerifyUserData(lpDev,L"1234567890ABCDEF1234567890ABCDEF",FALSE)==HKMGetSerialNumber(lpDev,FALSE));
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMXBtn1Click.html b/ddl/chm_output/standard_fun/HKMXBtn1Click.html new file mode 100644 index 0000000..2aa3974 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMXBtn1Click.html @@ -0,0 +1,45 @@ + + + + +HKMXBtn1Click + + + + + + + + + + + + + + + + + + + + + + + + +
HKMXBtn1Click XButton1
XButton1º͵ʱʹHKMSetMouseIntervalļӻĹ̼汾ڵ1.1.0ΪϷִ֧˺
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMXBtn1Click(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMXBtn1DoubleClick.html b/ddl/chm_output/standard_fun/HKMXBtn1DoubleClick.html new file mode 100644 index 0000000..d34ea49 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMXBtn1DoubleClick.html @@ -0,0 +1,45 @@ + + + + +HKMXBtn1DoubleClick + + + + + + + + + + + + + + + + + + + + + + + + +
HKMXBtn1DoubleClick XButton1˫
XButton1˫º͵ʱʹHKMSetMouseIntervalļӻĹ̼汾ڵ1.1.0ΪϷִ֧˺
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMXBtn1DoubleClick(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMXBtn1Down.html b/ddl/chm_output/standard_fun/HKMXBtn1Down.html new file mode 100644 index 0000000..425511b --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMXBtn1Down.html @@ -0,0 +1,45 @@ + + + + +HKMXBtn1Down + + + + + + + + + + + + + + + + + + + + + + + + +
HKMXBtn1Down XButton1
XButton1¡ļӻĹ̼汾ڵ1.1.0ΪϷִ֧˺
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMXBtn1Down(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMXBtn1Up.html b/ddl/chm_output/standard_fun/HKMXBtn1Up.html new file mode 100644 index 0000000..1133496 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMXBtn1Up.html @@ -0,0 +1,45 @@ + + + + +HKMXBtn1Up + + + + + + + + + + + + + + + + + + + + + + + + +
HKMXBtn1Up XButton1
XButton1ļӻĹ̼汾ڵ1.1.0ΪϷִ֧˺
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMXBtn1Up(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMXBtn2Click.html b/ddl/chm_output/standard_fun/HKMXBtn2Click.html new file mode 100644 index 0000000..245cc63 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMXBtn2Click.html @@ -0,0 +1,45 @@ + + + + +HKMXBtn2Click + + + + + + + + + + + + + + + + + + + + + + + + +
HKMXBtn2Click XButton2
XButton2º͵ʱʹHKMSetMouseIntervalļӻĹ̼汾ڵ1.1.0ΪϷִ֧˺
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMXBtn2Click(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMXBtn2DoubleClick.html b/ddl/chm_output/standard_fun/HKMXBtn2DoubleClick.html new file mode 100644 index 0000000..6721d19 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMXBtn2DoubleClick.html @@ -0,0 +1,45 @@ + + + + +HKMXBtn2DoubleClick + + + + + + + + + + + + + + + + + + + + + + + + +
HKMXBtn2DoubleClick XButton2˫
XButton2˫º͵ʱʹHKMSetMouseIntervalļӻĹ̼汾ڵ1.1.0ΪϷִ֧˺
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMXBtn2DoubleClick(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMXBtn2Down.html b/ddl/chm_output/standard_fun/HKMXBtn2Down.html new file mode 100644 index 0000000..5b24993 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMXBtn2Down.html @@ -0,0 +1,45 @@ + + + + +HKMXBtn2Down + + + + + + + + + + + + + + + + + + + + + + + + +
HKMXBtn2Down XButton2
XButton2¡ļӻĹ̼汾ڵ1.1.0ΪϷִ֧˺
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMXBtn2Down(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/HKMXBtn2Up.html b/ddl/chm_output/standard_fun/HKMXBtn2Up.html new file mode 100644 index 0000000..0913d51 --- /dev/null +++ b/ddl/chm_output/standard_fun/HKMXBtn2Up.html @@ -0,0 +1,45 @@ + + + + +HKMXBtn2Up + + + + + + + + + + + + + + + + + + + + + + + + +
HKMXBtn2Up XButton2
XButton2ļӻĹ̼汾ڵ1.1.0ΪϷִ֧˺
1豸ָ롣ʹHKMOpenԴ
ֵֵɹTRUEʧܷFALSE
C
DWORD dwDevId;
+ LPVOID lpDev;
+ dwDevId=HKMSearchDevice(0x1234,0xABCD,0);
+ if(dwDevId==0xFFFFFFFF)
+ {
    printf("δҵļ\n");
    return 0;
+ }
+ lpDev=HKMOpen(dwDevId,0);
+ if(lpDev==NULL)
+ {
+     printf("ļʧ\n");
+    return 0;
+ }
+ HKMXBtn2Up(lpDev);
+ HKMClose(lpDev);
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/Type.html b/ddl/chm_output/standard_fun/Type.html new file mode 100644 index 0000000..bdb7062 --- /dev/null +++ b/ddl/chm_output/standard_fun/Type.html @@ -0,0 +1,15 @@ + + + + +˵ + + + +

˵

+

VCģԻе죬Բͽ˵

+

ֵԿռĸֽڣTRUE1FALSE0

+

ַַָ,ַΪ0ַAnsiUnicode֣еַͿʹHKMSetModeá

+

+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/VirtualKeyTable.html b/ddl/chm_output/standard_fun/VirtualKeyTable.html new file mode 100644 index 0000000..bf12efb --- /dev/null +++ b/ddl/chm_output/standard_fun/VirtualKeyTable.html @@ -0,0 +1,459 @@ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
8Backspace˸88X 
9TabTab89Y 
13Enterس90Z 
16ShiftShift91Left WinWindows
17CtrlCtrl92Right WinWindows
18AltAlt93Apps˵
19Pauseͣ96Num 0С0
20Caps LockСдл97Num 1С1
27Esc˳98Num 2С2
32Spaceո99Num 3С3
33Page UpϷҳ100Num 4С4
34Page Down·ҳ101Num 5С5
35Endβ102Num 6С6
36Homeʼ103Num 7С7
37LeftƼͷ104Num 8С8
38UpƼϼͷ105Num 9С9
39RightƼҼͷ106Num *С*
40DownƼ¼ͷ107Num +С+
44Print Screen108Num EnterС̻س
45Insert109Num -С-
46Deleteɾ110Num .С.
480 111Num /С/
491 112F1 
502 113F2 
513 114F3 
524 115F4 
535 116F5 
546 117F6 
557 118F7 
568 119F8 
579 120F9 
65A 121F10 
66B 122F11 
67C 123F12 
68D 144Num LockСл
69E 145Scroll Lock 
70F 160Left ShiftShift
71G 161Right ShiftShift
72H 162Left CtrlCtrl
73I 163Right CtrlCtrl
74J 164Left AltAlt
75K 165Right AltAlt
76L 186;;:
77M 187==+
78N 188,,<
79O 189--_
80P 190..>
81Q 191//?
82R 192``~
83S 219[[{
84T 220\\|
85U 221]]}
86V 222''"
87W    
+ + \ No newline at end of file diff --git a/ddl/chm_output/standard_fun/css/help.css b/ddl/chm_output/standard_fun/css/help.css new file mode 100644 index 0000000..9c5f3ef --- /dev/null +++ b/ddl/chm_output/standard_fun/css/help.css @@ -0,0 +1,17 @@ +@charset "gb2312"; +body{font-size:12px; font-family:Verdana,"";} +.ts{ background:#fff; margin:0;} +.ts th{ + color:#666666; + background:#D8D8D8; + line-height:24px; + font-family: Verdana, ""; +} +.ts td {padding:6px 0;} +.name { font-size:16px; font-weight:bold; border-top:1px dashed #9C9A9C; border-bottom:1px dashed #9C9A9C; color:#006939;} +.canshu { background:#E7E7EF;} +.fanhui { border-bottom:1px dashed #9C9A9C;} +.lizi { border-bottom:1px dashed #9C9A9C;} +.neirong { border-bottom:1px dashed #9C9A9C;} +.thf {color: #000000;} +.note {color: #006600;} diff --git a/ddl/chm_output/wyhkmPrj.hhc b/ddl/chm_output/wyhkmPrj.hhc new file mode 100644 index 0000000..3ac5208 --- /dev/null +++ b/ddl/chm_output/wyhkmPrj.hhc @@ -0,0 +1,1202 @@ + + + diff --git a/ddl/chm_output/wyhkmPrj.hhk b/ddl/chm_output/wyhkmPrj.hhk new file mode 100644 index 0000000..919e942 --- /dev/null +++ b/ddl/chm_output/wyhkmPrj.hhk @@ -0,0 +1,873 @@ + + diff --git a/ddl/example.py b/ddl/example.py new file mode 100644 index 0000000..e71eb37 --- /dev/null +++ b/ddl/example.py @@ -0,0 +1,47 @@ +#64位的Python使用64位的无涯键鼠盒子模块 +#本例子使用的无涯键鼠盒子模块是5.00 +import sys +import win32api +import win32com.client +from ctypes import * + +#进程内注册插件,模块所在的路径按照实际位置修改 +hkmdll = windll.LoadLibrary("D:\\Plugin\\x64\\wyhkm.dll") +hkmdll.DllInstall.argtypes=(c_long,c_longlong) +if hkmdll.DllInstall(1,2)<0: + print("注册失败!") + sys.exit(0) + +#创建对象 +try: + wyhkm=win32com.client.Dispatch("wyp.hkm") +except: + print("创建对象失败!") + sys.exit(0) +#获得模块版本号 +version=wyhkm.GetVersion() +print("无涯键鼠盒子模块版本:"+hex(version)) +#查找设备,这个只是例子,参数中的VID和PID要改成实际值 +DevId=wyhkm.SearchDevice(0x2612, 0x1701, 0) +if DevId==-1: + print("未找到无涯键鼠盒子") + sys.exit(0) +#打开设备,DPI模式取每个显示器DPI感知 +if not wyhkm.Open(DevId,0): + print("打开无涯键鼠盒子失败") + sys.exit(0) +#打开资源管理器快捷键Win+E +wyhkm.KeyDown("WIN") +wyhkm.DelayRnd(100,150) +wyhkm.KeyPress("E") +wyhkm.DelayRnd(100,150) +wyhkm.KeyUp("WIN") +x=0 +y=0 +r=wyhkm.GetCursorPos(x,y) +print(str(x) + "," + str(y)) +print(len(r)) +print(r) +print(wyhkm.CheckPressedKeys(0)) +#关闭设备 +wyhkm.Close() diff --git a/ddl/wyhkm.dll b/ddl/wyhkm.dll new file mode 100644 index 0000000..4eb62b2 Binary files /dev/null and b/ddl/wyhkm.dll differ diff --git a/ddl/接入方法.txt b/ddl/接入方法.txt new file mode 100644 index 0000000..8a4a0f5 --- /dev/null +++ b/ddl/接入方法.txt @@ -0,0 +1,26 @@ +COM接口调用 +1.注册: +注册有两种方法:常规注册方法、进程内注册方法。常规注册方法会写注册表,可能导致安全软件报警或者被检测。进程内注册方法不写注册表,没有这些问题,但是只在当前进程有效,新的进程要重新注册。 + +1)常规注册方法:在同一台电脑上,模块文件或者路径不变化时,只要注册一次即可。 +注册本模块可使用regsvr32命令,也可以直接调用本模块的DllRegisterServer接口。 +注册本模块的vbs例子如下(管理员权限): +Set wshshell = CreateObject("wscript.shell") +wshshell.run "regsvr32 /s ""D:\Plugin\wyhkm.dll""" +无管理员权限注册模块的例子如下: +Set wshshell = CreateObject("wscript.shell") +wshshell.run "regsvr32 /s /n /i:user ""D:\Plugin\wyhkm.dll""" + +注意:如果在64位系统中使用的是32位模块,双击直接运行vbs文件是用64位脚本执行器执行,会导致失败。运行C:\Windows\SysWOW64\cmd.exe,再到其中运行vbs就能正常调用模块了。 + +2)进程内注册方法:调用模块的DllInstall导出函数,第一个参数传入32位整型数1,第二个参数传入32/64位整型数2(32位模块中是32位整型数,64位模块中是64位整型数)。返回值大于等于0时注册成功。vbs不支持直接调用dll的导出函数,这里就不给例子了。 + +2.创建对象: +模块中的函数使用前,先创建对象,再使用对象调用函数。 +创建本模块的对象的vbs例子如下: +Set wyhkm=CreateObject("wyp.hkm") + +调用函数的完整例子(不包含注册): +Set wyhkm=CreateObject("wyp.hkm") +ver = wyhkm.GetVersion() +MsgBox "模块版本:" & Hex(ver), 4096 diff --git a/ddl/无涯键鼠盒子模块V5.71说明.chm b/ddl/无涯键鼠盒子模块V5.71说明.chm new file mode 100644 index 0000000..b77ee8e Binary files /dev/null and b/ddl/无涯键鼠盒子模块V5.71说明.chm differ diff --git a/death_manager.py b/death_manager.py index 0b45132..aee1c1d 100644 --- a/death_manager.py +++ b/death_manager.py @@ -1,6 +1,6 @@ import time import math -import pydirectinput +from hardware_control import hw_ctrl class DeathManager: @@ -46,7 +46,7 @@ class DeathManager: self.corpse_pos = (state['x'], state['y']) self.is_running_to_corpse = True print(f">>> [系统] 记录死亡坐标: {self.corpse_pos},准备释放灵魂...") - pydirectinput.press(self.release_spirit_key) + hw_ctrl.press(self.release_spirit_key) time.sleep(5) # 等待加载界面 def run_to_corpse(self, state, get_state=None): @@ -74,9 +74,8 @@ class DeathManager: # 如果距离尸体很近(0.005 约等于 10-20 码) if is_arrived: print(">>> 已到达尸体附近,尝试复活...") - pydirectinput.press(self.resurrect_key) + hw_ctrl.press(self.resurrect_key) time.sleep(5) self.is_running_to_corpse = False self.corpse_pos = None return - diff --git a/game_state_config.json b/game_state_config.json index aa1f31a..1c79e76 100644 --- a/game_state_config.json +++ b/game_state_config.json @@ -7,8 +7,8 @@ "offset_top": 45, "enable_mount": false, "mount_key": "x", - "mount_hold_sec": 2.0, - "mount_retry_after_sec": 2.5, - "hearthstone_key": "6", - "bag_full_hearthstone": true + "mount_hold_sec": 1.6, + "mount_retry_after_sec": 2.0, + "hearthstone_key": "b", + "bag_full_hearthstone": false } \ No newline at end of file diff --git a/hardware_control.py b/hardware_control.py new file mode 100644 index 0000000..a352e6e --- /dev/null +++ b/hardware_control.py @@ -0,0 +1,152 @@ +import os +import sys +import ctypes +from ctypes import * +import time +import win32com.client +import pythoncom + +class HardwareController: + """ + 接入 wyhkm.dll 硬件盒子的 COM 接口封装类。 + 经过实测验证:Index 0 配合 SetMode(2, 1) 可同时支持键盘与鼠标。 + """ + _instance = None + _wyhkm = None + + def __new__(cls, *args, **kwargs): + if not cls._instance: + cls._instance = super(HardwareController, cls).__new__(cls) + return cls._instance + + def __init__(self, dll_path="ddl/wyhkm.dll"): + if self._wyhkm: + return + + self.dll_path = os.path.abspath(dll_path) + if not os.path.exists(self.dll_path): + print(f">>> [硬件控制] 错误:找不到 DLL 文件 {self.dll_path}") + return + + try: + # 1. 进程内注册 (标准 64 位注册方式) + hkmdll = windll.LoadLibrary(self.dll_path) + hkmdll.DllInstall.argtypes = (c_long, c_longlong) + + if hkmdll.DllInstall(1, 2) < 0: + print(">>> [硬件控制] 注册失败!") + return + else: + print(">>> [硬件控制] 进程内注册 wyhkm.dll 成功") + + # 2. 创建对象 + pythoncom.CoInitialize() + try: + self._wyhkm = win32com.client.Dispatch("wyp.hkm") + except Exception as e: + print(f">>> [硬件控制] 创建对象失败: {e}") + return + + # 3. 查找并打开设备 (Index 0 已验证支持键盘鼠标) + dev_id = self._wyhkm.SearchDevice(0x2612, 0x1701, 0) + if dev_id == -1: + print(">>> [硬件控制] 未找到无涯键鼠盒子 (Index 0)") + return + + if not self._wyhkm.Open(dev_id, 0): + print(">>> [硬件控制] 打开设备失败") + return + + # 4. 关键初始化设置 (实测鼠标移动必须开启模式 2, 1) + # 开启键盘增强模拟 + self._wyhkm.SetMode(1, 1) + # 开启鼠标仿真移动 (解决鼠标不动的问题) + self._wyhkm.SetMode(2, 1) + + # 设置推荐的按键/鼠标间隔 (与 test_hw.py 一致,30-50ms 更稳定) + self._wyhkm.SetKeyInterval(30, 50) + self._wyhkm.SetMouseInterval(30, 50) + + print(f">>> [硬件控制] 成功打开设备并完成初始化配置") + + except Exception as e: + print(f">>> [硬件控制] 初始化异常: {e}") + self._wyhkm = None + + def is_available(self): + if not self._wyhkm: + return False + try: + # 修正:IsOpen 需要参数 (0:全模式, 1:键盘, 2:鼠标) + # 之前漏传参数会导致 COM 报错,进而导致 key_down 等所有操作被 skip + return self._wyhkm.IsOpen(0) + except: + return False + + def delay_rnd(self, min_ms, max_ms): + """随机延时""" + if self.is_available(): + try: self._wyhkm.DelayRnd(int(min_ms), int(max_ms)) + except: pass + + # --- 键盘操作 (均使用大写字符串) --- + + def key_down(self, key_str): + if self.is_available(): + try: self._wyhkm.KeyDown(str(key_str).upper()) + except: pass + + def key_up(self, key_str): + if self.is_available(): + try: self._wyhkm.KeyUp(str(key_str).upper()) + except: pass + + def key_press(self, key_str): + if self.is_available(): + try: self._wyhkm.KeyPress(str(key_str).upper()) + except: pass + + # 兼容性别名 + def keyDown(self, key_str): self.key_down(key_str) + def keyUp(self, key_str): self.key_up(key_str) + def press(self, key_str): self.key_press(key_str) + + # --- 鼠标操作 --- + + def move_to(self, x, y): + """绝对移动""" + if self.is_available(): + try: self._wyhkm.MoveTo(int(x), int(y)) + except: pass + + def move_r(self, dx, dy): + """相对移动""" + if self.is_available(): + try: self._wyhkm.MoveR(int(dx), int(dy)) + except: pass + + def MoveR(self, dx, dy): # 兼容写法 + self.move_r(dx, dy) + + def left_click(self): + if self.is_available(): + try: self._wyhkm.LeftClick() + except: pass + + def right_click(self): + if self.is_available(): + try: self._wyhkm.RightClick() + except: pass + + def left_down(self): + if self.is_available(): + try: self._wyhkm.LeftDown() + except: pass + + def left_up(self): + if self.is_available(): + try: self._wyhkm.LeftUp() + except: pass + +# 全局实例 +hw_ctrl = HardwareController() diff --git a/logistics_manager.py b/logistics_manager.py index 0c6ae1e..1ee6052 100644 --- a/logistics_manager.py +++ b/logistics_manager.py @@ -1,7 +1,7 @@ import json import math import time -import pydirectinput +from hardware_control import hw_ctrl # 修理商所在位置(游戏坐标),按实际位置修改 VENDOR_POS = (30.08, 71.51) @@ -34,21 +34,61 @@ class LogisticsManager: else: self.is_returning = False - def use_hearthstone_and_stop(self): - """按炉石按键并等待施法完成,返回 True 表示已执行(调用方应随后结束循环)。""" - print(f">>> [后勤] 包满,使用炉石({self.hearthstone_key})回城,等待 {self.hearthstone_cast_sec:.0f}s...") - pydirectinput.press(self.hearthstone_key) - time.sleep(self.hearthstone_cast_sec) - print(">>> [后勤] 炉石施法完成,停止所有动作。") + def use_hearthstone_and_stop(self, get_state=None): + """按炉石按键并等待施法完成,带有坐标校验的重试机制。""" + max_retries = 3 + success = False + + for i in range(max_retries): + start_pos = None + if get_state: + st = get_state() + if st: + start_pos = (st.get('x'), st.get('y')) + + print(f">>> [后勤] 第 {i+1} 次尝试使用炉石(按键: {self.hearthstone_key})...") + # 先按一下 S 确保停止移动,防止移动中按炉石失败 + hw_ctrl.press('s') + time.sleep(0.5) + hw_ctrl.press(self.hearthstone_key) + + # 等待施法过程 + print(f">>> [后勤] 正在等待施法 {self.hearthstone_cast_sec}s...") + time.sleep(self.hearthstone_cast_sec + 2.0) # 多等 2 秒保险 + + if get_state and start_pos and start_pos[0] is not None: + st_now = get_state() + if st_now: + end_pos = (st_now.get('x'), st_now.get('y')) + dist = math.dist(start_pos, end_pos) + # 如果坐标发生了明显跳变(大于 2.0),证明回城成功 + if dist > 2.0: + print(f">>> [后勤] 炉石回城成功!位置跳变距离: {dist:.2f}") + success = True + break + else: + print(f">>> [后勤] 炉石似乎失败(位置未变化),准备重试...") + else: + # 获取不到状态可能已经卡死或窗口关闭,默认成功以退出循环 + success = True + break + else: + # 如果没法校验坐标,就只执行一次 + success = True + break + + if not success: + print(">>> [后勤] 警告:多次尝试炉石回城均未检测到位置跳变!") + self.is_returning = False - return True + return success def return_home(self): """执行回城动作""" # 1. 停止当前巡逻 # 2. 寻找安全点或直接使用炉石 print(">>> 正在释放炉石...") - pydirectinput.press('7') # 假设炉石在 7 号键 + hw_ctrl.press('7') # 假设炉石在 7 号键 time.sleep(15) # 等待炉石施法 def handle_town_visit(self, state, patrol): @@ -64,9 +104,9 @@ class LogisticsManager: def _do_vendor_interact(self): """执行与修理商/背包的交互按键(8、4)。""" - pydirectinput.press("8") + hw_ctrl.press("8") time.sleep(0.5) - pydirectinput.press("4") + hw_ctrl.press("4") time.sleep(2) def run_route1_round(self, get_state, patrol, route_file=None): @@ -94,4 +134,4 @@ class LogisticsManager: if not ok: print(">>> [后勤] 反向未完成") return - print(">>> [后勤] route1 往返结束") \ No newline at end of file + print(">>> [后勤] route1 往返结束") diff --git a/loot_path.json b/loot_path.json new file mode 100644 index 0000000..5447740 --- /dev/null +++ b/loot_path.json @@ -0,0 +1 @@ +[[-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-1, -86], [-238, -79], [-263, -75], [-269, -74], [-302, -74], [-307, -72], [-324, -48], [-325, -21], [-318, 10], [-302, 40], [-251, 86], [-197, 121], [-124, 151], [-43, 173], [7, 186], [54, 200], [92, 203], [115, 201], [171, 179], [224, 144], [259, 108], [273, 75], [276, 41], [252, 7], [221, -23], [162, -55], [110, -71], [46, -86], [-1, -92], [-47, -92], [-90, -85], [-118, -79], [-135, -74], [-160, -64], [-184, -45], [-219, -9], [-236, 35], [-236, 80], [-193, 120], [-132, 156], [-61, 175], [25, 190], [124, 185], [174, 170], [209, 145], [245, 85], [253, 31], [226, -5], [184, -33], [149, -51], [110, -66], [90, -67], [70, -68], [40, -69], [24, -69], [3, -66], [-3, -65], [-10, -64], [-10, -64], [-10, -64], [-10, -64], [-10, -64], [-10, -64], [-10, -63], [-10, -63], [-10, -63], [-10, -63], [-10, -63], [-10, -63], [-10, -63], [-10, -63], [-10, -63], [-10, -63], [-10, -63], [-10, -63], [-10, -63], [-10, -63], [-10, -63], [-10, -63], [-10, -63], [-10, -63], [-10, -63], [-10, -63], [-10, -63], [-10, -63]] \ No newline at end of file diff --git a/mouse_path_recorder.py b/mouse_path_recorder.py new file mode 100644 index 0000000..dd44d12 --- /dev/null +++ b/mouse_path_recorder.py @@ -0,0 +1,85 @@ +import time +import json +import math +import ctypes +import win32gui +import win32api +import pynput +from pynput import keyboard + +# 开启 DPI 意识,解决 Windows 缩放导致的坐标偏差 +try: + ctypes.windll.shcore.SetProcessDpiAwareness(1) +except Exception: + ctypes.windll.user32.SetProcessDPIAware() + +# 配置 +WIN_TITLE = "魔兽世界" +SAVE_FILE = "loot_path.json" + +class PathRecorder: + def __init__(self): + self.is_recording = False + self.points = [] + self.center_x = 0 + self.center_y = 0 + + def get_window_center(self): + hwnd = win32gui.FindWindow(None, WIN_TITLE) + if not hwnd: + print(f"未找到窗口: {WIN_TITLE}") + return None, None + rect = win32gui.GetWindowRect(hwnd) + left, top, right, bottom = rect + cx = left + (right - left) // 2 + cy = top + (bottom - top) // 2 + return cx, cy + + def on_press(self, key): + try: + if key == keyboard.Key.f8: + if not self.is_recording: + cx, cy = self.get_window_center() + if cx is None: return + self.center_x, self.center_y = cx, cy + self.points = [] + self.is_recording = True + print("\n>>> 开始录制... 请在角色前方划出你想要的扫瞄轨迹。") + else: + self.is_recording = False + self.save_path() + print(f">>> 录制结束。已保存 {len(self.points)} 个点到 {SAVE_FILE}") + except Exception as e: + print(f"出错: {e}") + + def save_path(self): + # 稀疏处理:每隔几个点取一个,防止点位过密影响性能 + step = 3 + processed_points = self.points[::step] + with open(SAVE_FILE, 'w') as f: + json.dump(processed_points, f) + + def run(self): + print(f"--- 鼠标轨迹录制工具 ---") + print(f"1. 运行游戏并确保处于窗口/全屏窗口化模式。") + print(f"2. 按下 [F8] 开始录制。") + print(f"3. 均匀、平滑地移动鼠标,划出你想要的拾取扫瞄范围。") + print(f"4. 再次按 [F8] 保存并退出。") + + listener = keyboard.Listener(on_press=self.on_press) + listener.start() + + try: + while True: + if self.is_recording: + x, y = win32api.GetCursorPos() + # 记录相对于中心的偏移量 + dx = x - self.center_x + dy = y - self.center_y + self.points.append((dx, dy)) + time.sleep(0.02) + except KeyboardInterrupt: + pass + +if __name__ == "__main__": + PathRecorder().run() diff --git a/player_movement.py b/player_movement.py index 4990e2c..cd9b14d 100644 --- a/player_movement.py +++ b/player_movement.py @@ -1,7 +1,8 @@ import math import time import logging -import pydirectinput +import random +from hardware_control import hw_ctrl from player_position import PlayerPosition # 游戏朝向约定:正北=0°,正西=90°,正南=180°,正东=270°(逆时针递增) @@ -81,9 +82,9 @@ class PlayerMovement: f"[转向 {attempt + 1}] 当前 {current_heading:.1f}° → 目标 {target_heading:.1f}°," f"按 '{key}' {turn_duration:.2f}s(需转 {angle_to_turn:.1f}°)" ) - pydirectinput.keyDown(key) + hw_ctrl.keyDown(key) time.sleep(turn_duration) - pydirectinput.keyUp(key) + hw_ctrl.keyUp(key) time.sleep(0.15) # 等待游戏刷新朝向 self.logger.warning(f"转向失败:超过最大尝试次数 {max_attempts}") @@ -96,36 +97,35 @@ class PlayerMovement: duration: 移动时间(秒) """ self.logger.info(f"向前移动 {duration:.2f}s") - pydirectinput.keyDown('w') + hw_ctrl.keyDown('w') time.sleep(duration) - pydirectinput.keyUp('w') + hw_ctrl.keyUp('w') def _escape_stuck(self): """卡死脱困组合拳:后退 + 随机转向 + 跳跃。 当连续多次检测到坐标无明显位移时调用,尝试脱离障碍物。 """ - import random self.logger.warning("检测到角色卡死,执行脱困动作") # 1. 松开前进键,后退 0.8s - pydirectinput.keyUp('w') - pydirectinput.keyDown('s') + hw_ctrl.keyUp('w') + hw_ctrl.keyDown('s') time.sleep(0.8) - pydirectinput.keyUp('s') + hw_ctrl.keyUp('s') # 2. 随机左转或右转 0.3~0.5s turn_key = random.choice(['a', 'd']) turn_dur = random.uniform(0.3, 0.5) - pydirectinput.keyDown(turn_key) + hw_ctrl.keyDown(turn_key) time.sleep(turn_dur) - pydirectinput.keyUp(turn_key) + hw_ctrl.keyUp(turn_key) # 3. 跳跃(按空格)同时向前冲 0.5s - pydirectinput.keyDown('w') - pydirectinput.press('space') + hw_ctrl.keyDown('w') + hw_ctrl.press('space') time.sleep(0.5) - pydirectinput.keyUp('w') + hw_ctrl.keyUp('w') self.logger.info("脱困动作完成,重新开始前进") @@ -172,7 +172,7 @@ class PlayerMovement: return False # 按住 w 开始持续前进 - pydirectinput.keyDown('w') + hw_ctrl.keyDown('w') # 卡死检测:记录最近 STUCK_CHECK_COUNT 次坐标,用于判断是否停滞 recent_positions = [] try: @@ -204,7 +204,7 @@ class PlayerMovement: if moved < self.STUCK_MOVE_THRESHOLD: self._escape_stuck() recent_positions.clear() - pydirectinput.keyDown('w') + hw_ctrl.keyDown('w') # x 和 y 都在容差范围内即视为到达 if abs(dx) <= position_tolerance and abs(dy) <= position_tolerance: @@ -213,7 +213,7 @@ class PlayerMovement: # 接近目标时松开 w 停下,再做一次静止判定,避免冲过头后死循环 if distance <= position_tolerance * 2: - pydirectinput.keyUp('w') + hw_ctrl.keyUp('w') time.sleep(0.2) final_pos = self.player_position.get_position_with_retry() if final_pos is not None: @@ -223,7 +223,7 @@ class PlayerMovement: self.logger.info(f"已到达目标位置 ({target_x}, {target_y})") return True # 静止后仍未到达,重新按住 w 继续前进 - pydirectinput.keyDown('w') + hw_ctrl.keyDown('w') # 每隔 HEADING_CHECK_INTERVAL 次读一次朝向,减少 OCR 频率 if iteration % self.HEADING_CHECK_INTERVAL != 0: @@ -239,12 +239,12 @@ class PlayerMovement: if abs_diff > self.COARSE_TURN_THRESHOLD: # 偏差过大:停步原地粗修正,再重新按住 w - pydirectinput.keyUp('w') + hw_ctrl.keyUp('w') self.logger.info(f"偏差 {abs_diff:.1f}° 过大,停步原地修正") if not self.turn_to_heading(required_heading): self.logger.warning("修正转向失败,移动中止") return False - pydirectinput.keyDown('w') + hw_ctrl.keyDown('w') elif abs_diff > self.ANGLE_TOLERANCE: # 小幅偏差:边走边转,同时按住 w 和转向键 @@ -254,15 +254,15 @@ class PlayerMovement: self.logger.info( f"边走边转:按 '{turn_key}' {turn_time:.2f}s(偏差 {abs_diff:.1f}°)" ) - pydirectinput.keyDown(turn_key) + hw_ctrl.keyDown(turn_key) time.sleep(turn_time) - pydirectinput.keyUp(turn_key) + hw_ctrl.keyUp(turn_key) else: # 方向已对齐,让角色多走一段再重新检测,减少 OCR 频率 time.sleep(1) finally: - pydirectinput.keyUp('w') + hw_ctrl.keyUp('w') self.logger.warning(f"移动失败:超过最大迭代次数 {max_iterations}") return False diff --git a/quest_follow.py b/quest_follow.py index db769ed..1895f99 100644 --- a/quest_follow.py +++ b/quest_follow.py @@ -1,10 +1,9 @@ """ -任务跟随:按固定间隔向游戏发送「跟随」与「交互」按键(pydirectinput,与 auto_bot 一致)。 +任务跟随:按固定间隔向游戏发送「跟随」与「交互」按键(使用 hw_ctrl 硬件盒子)。 """ import time - -import pydirectinput +from hardware_control import hw_ctrl class QuestFollowBot: @@ -30,9 +29,9 @@ class QuestFollowBot: return self._last_cycle = now try: - pydirectinput.press(self.follow_key) + hw_ctrl.press(self.follow_key) time.sleep(0.08) - pydirectinput.press(self.interact_key) + hw_ctrl.press(self.interact_key) self._log(f"➡️ 任务跟随: {self.follow_key} → {self.interact_key}") except Exception as e: self._log(f"❌ 任务跟随按键失败: {e}") diff --git a/recorder/waypoints.json b/recorder/waypoints.json index 5add738..58481dc 100644 --- a/recorder/waypoints.json +++ b/recorder/waypoints.json @@ -1,70 +1,22 @@ [ [ - 85.35, - 74.90 + 30.97, + 73.59 ], [ - 85.32, - 74.86 + 30.45, + 73.49 ], [ - 85.02, - 74.38 + 30.05, + 73.83 ], [ - 84.8, - 73.92 + 30.55, + 73.98 ], [ - 84.6, - 73.46 - ], - [ - 84.39, - 73.0 - ], - [ - 84.17, - 72.55 - ], - [ - 83.88, - 72.05 - ], - [ - 83.42, - 71.84 - ], - [ - 83.3, - 72.34 - ], - [ - 83.34, - 72.9 - ], - [ - 83.37, - 73.46 - ], - [ - 83.62, - 73.94 - ], - [ - 83.97, - 74.32 - ], - [ - 84.41, - 74.67 - ], - [ - 84.94, - 74.86 - ], - [ - 85.35, - 74.90 + 30.87, + 73.57 ] ] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 70a3856..5e93e3f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,6 @@ opencv-python==4.9.0.80 numpy==1.26.4 pyautogui==0.9.54 Pillow==10.2.0 -pydirectinput==1.0.4 pygetwindow==0.0.9 pyinstaller>=6.0.0 PyQt6>=6.4.0 diff --git a/stuck_handler.py b/stuck_handler.py index f231e77..ab74342 100644 --- a/stuck_handler.py +++ b/stuck_handler.py @@ -1,7 +1,7 @@ import math import time import random -import pydirectinput +from hardware_control import hw_ctrl class StuckHandler: # 针对 0.xxxx 坐标系优化 @@ -61,27 +61,27 @@ class StuckHandler: # 1. 全停 for k in ("w", "a", "d", "s"): - pydirectinput.keyUp(k) + hw_ctrl.keyUp(k) # 2. 倒车并转向(组合动作更有效) - pydirectinput.keyDown("s") + hw_ctrl.keyDown("s") turn_key = random.choice(["a", "d"]) - pydirectinput.keyDown(turn_key) + hw_ctrl.keyDown(turn_key) # 倒车时间稍长一点,离开障碍物 time.sleep(0.5) # 3. 尝试跳跃脱离地形卡位 - pydirectinput.press("space") + hw_ctrl.press("space") time.sleep(0.5) - pydirectinput.keyUp(turn_key) - pydirectinput.keyUp("s") + hw_ctrl.keyUp(turn_key) + hw_ctrl.keyUp("s") # 4. 往前稍微走一步,重新锁定坐标 - pydirectinput.keyDown("w") + hw_ctrl.keyDown("w") time.sleep(0.5) - pydirectinput.keyUp("w") + hw_ctrl.keyUp("w") self.reset() print(">>> 脱困尝试结束") diff --git a/test_hw.py b/test_hw.py new file mode 100644 index 0000000..aa8c164 --- /dev/null +++ b/test_hw.py @@ -0,0 +1,62 @@ +import sys +import os +import ctypes +from ctypes import * +import win32com.client +import time + +# 路径配置 +dll_path = os.path.abspath("ddl/wyhkm.dll") +print(f"测试 DLL: {dll_path}") + +# 1. 注册并创建对象 +try: + hkmdll = windll.LoadLibrary(dll_path) + hkmdll.DllInstall.argtypes = (c_long, c_longlong) + if hkmdll.DllInstall(1, 2) < 0: + print("注册失败!") + sys.exit(0) + + wyhkm = win32com.client.Dispatch("wyp.hkm") + print(f"硬件对象已创建,版本: {hex(wyhkm.GetVersion())}") +except Exception as e: + print(f"初始化异常: {e}") + sys.exit(0) + +# 2. 打开设备并配置模式 (使用已验证的 Index 0) +dev_id = wyhkm.SearchDevice(0x2612, 0x1701, 0) +if dev_id == -1 or not wyhkm.Open(dev_id, 0): + print("无法打开硬件设备") + sys.exit(0) + +# 关键模式设置 +wyhkm.SetMode(1, 1) # 键盘增强模式 +wyhkm.SetMode(2, 1) # 鼠标仿真模式 +wyhkm.SetKeyInterval(30, 50) # 设置合理的按键间隔 + +print(f"\n--- 硬件就绪 (ID: {dev_id}) ---") +print("请在 5 秒内切换到记事本进行按键测试...") +time.sleep(5) + +# 3. 常用按键序列测试 +test_keys = [ + ("方向键", ["W", "A", "S", "D"]), + ("功能键", ["SPACE", "X", "B", "M", "TAB", "ESCAPE"]), + ("数字键", ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]), + ("组合键测试", ["CTRL+C", "ALT+Z"]) +] + +for category, keys in test_keys: + print(f"\n正在测试 {category}: {keys}") + for k in keys: + print(f" 发送按键: {k}") + wyhkm.KeyPress(k) + time.sleep(0.5) + +# 4. 鼠标同步测试 +print("\n正在测试鼠标移动 (MoveR 100, 100)...") +wyhkm.MoveR(100, 100) + +time.sleep(1) +wyhkm.Close() +print("\n所有常用按键测试完成!") diff --git a/wow_multikey_gui.py b/wow_multikey_gui.py index fdce1e9..f362987 100644 --- a/wow_multikey_gui.py +++ b/wow_multikey_gui.py @@ -9,9 +9,10 @@ import os import random import sys import time +import ctypes from PyQt6.QtWidgets import ( - QApplication, QMainWindow, QWidget, QVBoxLayout, QHBoxLayout, + QApplication, QMainWindow, QWidget, QVBoxLayout, QHBoxLayout, QGridLayout, QLabel, QPushButton, QCheckBox, QSpinBox, QDoubleSpinBox, QScrollArea, QTextEdit, QMessageBox, QTabWidget, QGroupBox, QFormLayout, QLineEdit, QComboBox, QTableWidget, QTableWidgetItem, QHeaderView, QAbstractItemView, @@ -21,6 +22,7 @@ from PyQt6.QtGui import QPainter, QPen, QColor import win32gui import win32api import win32con +from pynput import keyboard def _config_base(): @@ -320,6 +322,7 @@ class GameLoopWorker(QThread): resurrection_waypoints_path=None, release_spirit_key=None, resurrect_key=None, + enable_mouse_loot=True, ): super().__init__() self.mode = mode # 'monitor' | 'patrol' | 'combat' | 'quest_follow' | 'flight' | 'record' @@ -358,6 +361,7 @@ class GameLoopWorker(QThread): self.resurrection_waypoints_path = resurrection_waypoints_path self.release_spirit_key = release_spirit_key self.resurrect_key = resurrect_key + self.enable_mouse_loot = enable_mouse_loot def run(self): try: @@ -381,6 +385,7 @@ class GameLoopWorker(QThread): resurrection_waypoints_path=self.resurrection_waypoints_path, release_spirit_key=self.release_spirit_key, resurrect_key=self.resurrect_key, + enable_mouse_loot=self.enable_mouse_loot, ) self.bot_move._on_hearthstone_stop = self.stop_signal.emit except ImportError as e: @@ -393,6 +398,7 @@ class GameLoopWorker(QThread): self.bot_combat = AutoBot( attack_loop_path=self.attack_loop_path, skinning_wait_sec=self.skinning_wait_sec, + enable_mouse_loot=self.enable_mouse_loot, ) except ImportError as e: self.log_signal.emit(f"❌ 自动打怪依赖加载失败: {e}") @@ -513,6 +519,54 @@ class GameLoopWorker(QThread): return None +class LootPathRecorderWorker(QThread): + """拾取轨迹录制工作线程""" + finished_signal = pyqtSignal(int) + log_signal = pyqtSignal(str) + + def __init__(self, hwnd): + super().__init__() + self.hwnd = hwnd + self.running = False + self.points = [] + + def run(self): + if not self.hwnd: + self.log_signal.emit("❌ 未找到游戏窗口,无法录制轨迹") + return + + try: + rect = win32gui.GetWindowRect(self.hwnd) + cx = rect[0] + (rect[2] - rect[0]) // 2 + cy = rect[1] + (rect[3] - rect[1]) // 2 + + self.points = [] + self.running = True + self.log_signal.emit("🔴 拾取轨迹录制中... 请在角色前方平滑移动鼠标") + + while self.running: + x, y = win32api.GetCursorPos() + self.points.append((x - cx, y - cy)) + time.sleep(0.02) + + # 稀疏处理并保存 + processed = self.points[::3] + if not processed: + self.log_signal.emit("⚠️ 未记录到有效轨迹点") + return + + path = get_config_path("loot_path.json") + with open(path, 'w') as f: + json.dump(processed, f) + self.finished_signal.emit(len(processed)) + self.log_signal.emit(f"✅ 拾取轨迹已保存: {len(processed)} 点") + except Exception as e: + self.log_signal.emit(f"❌ 轨迹录制失败: {e}") + + def stop(self): + self.running = False + + # ============ 主窗口 ============ class WoWMultiKeyGUI(QMainWindow): @@ -522,12 +576,31 @@ class WoWMultiKeyGUI(QMainWindow): self.config = self.load_config() self.key_workers = {} self.game_worker = None + self.loot_recorder_worker = None self.pending_recorder = None # 停止录制后保留,便于保存 self.hwnd = None self.init_ui() self.find_wow_window() + # 初始化全局热键监听 (F8 用于拾取录制) + self.kb_listener = keyboard.Listener(on_press=self._on_hotkey_press) + self.kb_listener.start() + + def _on_hotkey_press(self, key): + """全局热键回调""" + try: + if key == keyboard.Key.f8: + # 必须在主线程 UI 操作,但 pynput 在独立线程,这里简单判断状态 + if self.loot_recorder_worker and self.loot_recorder_worker.isRunning(): + # 停止录制 + self.stop_loot_record() + else: + # 开始录制 + self.start_loot_record() + except Exception: + pass + def init_ui(self): self.setWindowTitle("WoW 多功能控制器") self.setGeometry(100, 100, 780, 620) @@ -870,15 +943,41 @@ class WoWMultiKeyGUI(QMainWindow): loops_layout.addWidget(loop_editor) tabs.addTab(tab_combat_loops, "攻击循环") + # Tab: 拾取录制 (新增加) + tab_loot_record = QWidget() + loot_record_layout = QVBoxLayout(tab_loot_record) + loot_record_group = QGroupBox("自定义拾取轨迹") + loot_record_inner = QVBoxLayout(loot_record_group) + loot_record_inner.addWidget(QLabel("说明:\n1. 点击下方按钮开始录制。\n2. 在游戏角色前方划出你想要的扫瞄路径。\n3. 再次点击停止录制,轨迹将自动保存。\n4. 挂机脚本将优先使用录制的路径进行拾取。")) + + loot_record_btn_layout = QHBoxLayout() + self.loot_record_start_btn = QPushButton("🔴 开始录制拾取轨迹") + self.loot_record_start_btn.clicked.connect(self.start_loot_record) + self.loot_record_stop_btn = QPushButton("⏹ 停止录制") + self.loot_record_stop_btn.clicked.connect(self.stop_loot_record) + self.loot_record_stop_btn.setEnabled(False) + loot_record_btn_layout.addWidget(self.loot_record_start_btn) + loot_record_btn_layout.addWidget(self.loot_record_stop_btn) + loot_record_btn_layout.addStretch() + loot_record_inner.addLayout(loot_record_btn_layout) + loot_record_layout.addWidget(loot_record_group) + loot_record_layout.addStretch() + tabs.addTab(tab_loot_record, "拾取录制") + # Tab: 参数配置(上下两个分组) tab_params = QWidget() params_layout = QVBoxLayout(tab_params) # 基础参数(截图/窗口配置) basic_group = QGroupBox("基础参数") - basic_layout = QHBoxLayout(basic_group) - basic_left = QFormLayout() - basic_right = QFormLayout() + basic_grid = QGridLayout(basic_group) + # 统一对齐配置 + LABEL_WIDTH = 100 + basic_grid.setColumnMinimumWidth(0, LABEL_WIDTH) + basic_grid.setColumnMinimumWidth(2, LABEL_WIDTH) + basic_grid.setColumnStretch(1, 1) + basic_grid.setColumnStretch(3, 1) + self.gs_pixel_size = QSpinBox() self.gs_pixel_size.setRange(8, 32) self.gs_pixel_size.setValue(17) @@ -897,21 +996,33 @@ class WoWMultiKeyGUI(QMainWindow): self.gs_offset_top = QSpinBox() self.gs_offset_top.setRange(0, 100) self.gs_offset_top.setValue(45) - basic_left.addRow("每格像素 (pixel_size):", self.gs_pixel_size) - basic_left.addRow("起始 X (block_start_x):", self.gs_block_start_x) - basic_left.addRow("截图宽度 (scan_region_width):", self.gs_scan_width) - basic_right.addRow("截图高度 (scan_region_height):", self.gs_scan_height) - basic_right.addRow("窗口左偏移 (offset_left):", self.gs_offset_left) - basic_right.addRow("窗口顶偏移 (offset_top):", self.gs_offset_top) - basic_layout.addLayout(basic_left) - basic_layout.addLayout(basic_right) + + # 第一列 + basic_grid.addWidget(QLabel("每格像素:"), 0, 0) + basic_grid.addWidget(self.gs_pixel_size, 0, 1) + basic_grid.addWidget(QLabel("起始 X:"), 1, 0) + basic_grid.addWidget(self.gs_block_start_x, 1, 1) + basic_grid.addWidget(QLabel("截图宽度:"), 2, 0) + basic_grid.addWidget(self.gs_scan_width, 2, 1) + # 第二列 + basic_grid.addWidget(QLabel("截图高度:"), 0, 2) + basic_grid.addWidget(self.gs_scan_height, 0, 3) + basic_grid.addWidget(QLabel("窗口左偏移:"), 1, 2) + basic_grid.addWidget(self.gs_offset_left, 1, 3) + basic_grid.addWidget(QLabel("窗口顶偏移:"), 2, 2) + basic_grid.addWidget(self.gs_offset_top, 2, 3) + params_layout.addWidget(basic_group) # 游戏参数 game_group = QGroupBox("游戏参数") - game_layout = QHBoxLayout(game_group) - game_left = QFormLayout() - game_right = QFormLayout() + game_grid = QGridLayout(game_group) + # 统一对齐配置 + game_grid.setColumnMinimumWidth(0, LABEL_WIDTH) + game_grid.setColumnMinimumWidth(2, LABEL_WIDTH) + game_grid.setColumnStretch(1, 1) + game_grid.setColumnStretch(3, 1) + self.skinning_wait_spin = QDoubleSpinBox() self.skinning_wait_spin.setRange(0.1, 10.0) self.skinning_wait_spin.setSingleStep(0.1) @@ -960,20 +1071,39 @@ class WoWMultiKeyGUI(QMainWindow): self.gs_resurrect_key.setPlaceholderText("如 0") self.gs_resurrect_key.setMaxLength(16) self.gs_resurrect_key.setText("0") - game_left.addRow("剥皮等待时间:", self.skinning_wait_spin) - game_left.addRow("吃面包按键:", self.food_key_edit) - game_left.addRow("吃面包血量阈值:", self.eat_hp_threshold_spin) - game_left.addRow("吃面包最长等待:", self.eat_max_wait_spin) - game_left.addRow("炉石按键:", self.gs_hearthstone_key) - game_left.addRow("", self.gs_bag_full_hearthstone) - game_right.addRow("是否上马:", self.gs_enable_mount) - game_right.addRow("上马按键:", self.gs_mount_key) - game_right.addRow("上马按住时长:", self.gs_mount_hold) - game_right.addRow("上马重试间隔:", self.gs_mount_retry) - game_right.addRow("释放灵魂按键:", self.gs_release_spirit_key) - game_right.addRow("复活按键:", self.gs_resurrect_key) - game_layout.addLayout(game_left) - game_layout.addLayout(game_right) + self.gs_enable_mouse_loot = QCheckBox("启用扫雷拾取") + self.gs_enable_mouse_loot.setChecked(True) + + # 网格填充 + game_grid.addWidget(QLabel("剥皮等待时间:"), 0, 0) + game_grid.addWidget(self.skinning_wait_spin, 0, 1) + game_grid.addWidget(self.gs_enable_mouse_loot, 0, 2) + game_grid.addWidget(self.gs_enable_mount, 0, 3) + + game_grid.addWidget(QLabel("吃面包按键:"), 1, 0) + game_grid.addWidget(self.food_key_edit, 1, 1) + game_grid.addWidget(QLabel("上马按键:"), 1, 2) + game_grid.addWidget(self.gs_mount_key, 1, 3) + + game_grid.addWidget(QLabel("吃面包血量阈值:"), 2, 0) + game_grid.addWidget(self.eat_hp_threshold_spin, 2, 1) + game_grid.addWidget(QLabel("上马按住时长:"), 2, 2) + game_grid.addWidget(self.gs_mount_hold, 2, 3) + + game_grid.addWidget(QLabel("吃面包最长等待:"), 3, 0) + game_grid.addWidget(self.eat_max_wait_spin, 3, 1) + game_grid.addWidget(QLabel("上马重试间隔:"), 3, 2) + game_grid.addWidget(self.gs_mount_retry, 3, 3) + + game_grid.addWidget(QLabel("炉石按键:"), 4, 0) + game_grid.addWidget(self.gs_hearthstone_key, 4, 1) + game_grid.addWidget(QLabel("释放灵魂按键:"), 4, 2) + game_grid.addWidget(self.gs_release_spirit_key, 4, 3) + + game_grid.addWidget(self.gs_bag_full_hearthstone, 5, 1) + game_grid.addWidget(QLabel("复活按键:"), 5, 2) + game_grid.addWidget(self.gs_resurrect_key, 5, 3) + params_layout.addWidget(game_group) params_layout.addStretch() @@ -1025,11 +1155,13 @@ class WoWMultiKeyGUI(QMainWindow): self.food_key_edit.setText(str(bot_cfg.get('food_key', 'f1')).strip() or 'f1') self.eat_hp_threshold_spin.setValue(int(bot_cfg.get('eat_hp_threshold', 30))) self.eat_max_wait_spin.setValue(float(bot_cfg.get('eat_max_wait_sec', 30.0))) + self.gs_enable_mouse_loot.setChecked(bool(bot_cfg.get('enable_mouse_loot', True))) except Exception: self.skinning_wait_spin.setValue(1.5) self.food_key_edit.setText('f1') self.eat_hp_threshold_spin.setValue(30) self.eat_max_wait_spin.setValue(30.0) + self.gs_enable_mouse_loot.setChecked(True) def _save_params_config(self): """保存「参数配置」界面到 game_state_config.json(多分辨率)并写入 wow_multikey_qt.json(bot 参数)""" @@ -1058,6 +1190,7 @@ class WoWMultiKeyGUI(QMainWindow): self.config['bot']['food_key'] = self.food_key_edit.text().strip() or 'f1' self.config['bot']['eat_hp_threshold'] = int(self.eat_hp_threshold_spin.value()) self.config['bot']['eat_max_wait_sec'] = float(self.eat_max_wait_spin.value()) + self.config['bot']['enable_mouse_loot'] = self.gs_enable_mouse_loot.isChecked() self._save_main_config() self.log(f"✅ 参数配置已保存至 {path},并更新 bot 参数") @@ -1505,6 +1638,8 @@ class WoWMultiKeyGUI(QMainWindow): release_spirit_key = '9' resurrect_key = '0' + enable_mouse_loot = self.gs_enable_mouse_loot.isChecked() + self.game_worker = GameLoopWorker( mode, waypoints_path=waypoints_path, vendor_path=vendor_path, attack_loop_path=attack_loop_path, @@ -1523,6 +1658,7 @@ class WoWMultiKeyGUI(QMainWindow): resurrection_waypoints_path=resurrection_waypoints_path, release_spirit_key=release_spirit_key, resurrect_key=resurrect_key, + enable_mouse_loot=enable_mouse_loot, ) self.game_worker.state_signal.connect(self.state_label.setText) self.game_worker.log_signal.connect(self.log) @@ -1625,6 +1761,36 @@ class WoWMultiKeyGUI(QMainWindow): else: QMessageBox.warning(self, "提示", "请先进行巡逻点录制") + def start_loot_record(self): + """开始录制拾取轨迹。""" + if not self.hwnd: + QMessageBox.warning(self, "提示", "未找到游戏窗口,无法录制轨迹") + return + if self.loot_recorder_worker and self.loot_recorder_worker.isRunning(): + return + + self.loot_recorder_worker = LootPathRecorderWorker(self.hwnd) + self.loot_recorder_worker.log_signal.connect(self.log) + self.loot_recorder_worker.finished_signal.connect(self._on_loot_record_finished) + self.loot_recorder_worker.start() + + self.loot_record_start_btn.setEnabled(False) + self.loot_record_stop_btn.setEnabled(True) + self.status_bar.showMessage("🔴 拾取轨迹录制中...") + + def stop_loot_record(self): + """停止录制拾取轨迹。""" + if self.loot_recorder_worker: + self.loot_recorder_worker.stop() + self.loot_record_start_btn.setEnabled(True) + self.loot_record_stop_btn.setEnabled(False) + self.status_bar.showMessage("✅ 录制已结束") + + def _on_loot_record_finished(self, count): + self.log(f"🎬 拾取录制完成,共记录 {count} 个有效点") + self.loot_record_start_btn.setEnabled(True) + self.loot_record_stop_btn.setEnabled(False) + def closeEvent(self, event): running = bool(self.key_workers) or (self.game_worker and self.game_worker.isRunning()) if running: diff --git a/wow_multikey_qt.json b/wow_multikey_qt.json index ed20bd3..9669e73 100644 --- a/wow_multikey_qt.json +++ b/wow_multikey_qt.json @@ -10,6 +10,7 @@ "skinning_wait_sec": 1.5, "food_key": "f1", "eat_hp_threshold": 30, - "eat_max_wait_sec": 30.0 + "eat_max_wait_sec": 30.0, + "enable_mouse_loot": false } } \ No newline at end of file