(2)重置Surface后surface mouse无法连接问题的解决方法

本文解决了一个Surface Pro 6在重置后无法连接蓝牙鼠标的常见问题。通过重新启动鼠标配对模式并在Surface上进行设备搜索,成功解决了蓝牙连接失败的情况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

设备: Surface pro6
系统: Windows10 版本 1903(OS内部版本 18362.592)
问题:重置Surface pro 6后,打开蓝牙鼠标,指示灯亮着,但是并未与电脑连接。

解决方法:尝试在鼠标底部,长按“电源”按钮。在 LED 指示灯开始闪烁时松开按钮。当鼠标处于配对模式时,LED 会闪烁。然后在 Surface 上,选择“开始”按钮 ,然后依次选择“设置” >“设备” >“蓝牙和其他设备”。打开“蓝牙”,然后依次选择“添加蓝牙或其他设备”>“蓝牙”。看一下能否搜索到鼠标。

来源于微软技术支持。

import pygame import sys pygame.init() screen = pygame.display.set_mode((1000, 800)) clock = pygame.time.Clock() # 矩形属性 draggable_rect = pygame.Rect(350, 250, 100, 100) dragging = False offset = (0, 0) # 物理参数 velocity = [0.0, 0.0] # [x, y]速度 gravity = 4.0 damping = 0.9 # 通用阻尼系数 ground_level = 800 inertia_factor = 0.8 # 惯性强度系数 # 鼠标跟踪 last_mouse_pos = (0, 0) running = True while running: current_mouse_pos = pygame.mouse.get_pos() for event in pygame.event.get(): if event.type == pygame.QUIT: running = False elif event.type == pygame.MOUSEBUTTONDOWN: if event.button == 1 and draggable_rect.collidepoint(event.pos): dragging = True offset = (event.pos[0] - draggable_rect.x, event.pos[1] - draggable_rect.y) last_mouse_pos = event.pos velocity = [0, 0] # 重置速度 elif event.type == pygame.MOUSEBUTTONUP: if event.button == 1: dragging = False elif event.type == pygame.MOUSEMOTION and dragging: draggable_rect.topleft = (event.pos[0] - offset[0], event.pos[1] - offset[1]) # 惯性速度计算 if dragging: dx = current_mouse_pos[0] - last_mouse_pos[0] dy = current_mouse_pos[1] - last_mouse_pos[1] velocity = [dx * inertia_factor, dy * inertia_factor] last_mouse_pos = current_mouse_pos # 物理模拟 if not dragging: # 更新位置 draggable_rect.x += velocity[0] draggable_rect.y += velocity[1] # 应用重力 velocity[1] += gravity # 边界碰撞 if draggable_rect.bottom > ground_level: draggable_rect.bottom = ground_level velocity[1] *= -damping if abs(velocity[1]) < 1: velocity[1] = 0 if draggable_rect.left < 0: draggable_rect.left = 0 velocity[0] *= -damping elif draggable_rect.right > 800: draggable_rect.right = 800 velocity[0] *= -damping # 速度衰减 velocity = [v * damping for v in velocity] if all(abs(v) < 0.1 for v in velocity): velocity = [0, 0] screen.fill((255, 255, 255)) pygame.draw.rect(screen, (0, 120, 255), draggable_rect) pygame.display.flip() clock.tick(60) pygame.quit() sys.exit()矩形落地后会不断弹跳,修改一下,且加入可拖拽的斜面,将矩形改为小球
03-22
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值