import pythoncom, pyHook
import win32gui,win32api,win32con
Lcontrol_press = False
Lmenu_press = False
Left_press = False
def OnKeyboardEvent(event):
global Lcontrol_press #在函数里面使用全局变量的时候要加上global关键字
global Lmenu_press #要不然会出错
global Left_press
print 'Key:', event.Key
if (event.Key == "Lcontrol"):
Lcontrol_press = True
elif(event.Key == "Lmenu"):
Lmenu_press = True
elif(event.Key == "Left"):
Left_press =True
handel_key()
return True
def handel_key() :
global Lcontrol_press
global Lmenu_press
global Left_press
if(Lcontrol_press and Lmenu_press and Left_press):
win32api.keybd_event( 0xB0,win32con.VK_MEDIA_NEXT_TRACK,0,0)
Lcontrol_press = False
Lmenu_press = False
Left_press = False
hm = pyHook.HookManager()
hm.KeyDown = OnKeyboardEvent
hm.HookKeyboard()
pythoncom.PumpMessages()
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有