Well, I am in unknown territory but... 
Try
You have to know if the ctrl key is down also when you check for 'c'

Try
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import pyhook from pyHook.HookManager import HookConstants def OnKeyboardEvent(event): if event.Key.lower() = = 'lcontrol' and pyhook.GetKeyState(HookConstants.VKeyToID( 'VK_CONTROL' ): print "Control or win or tab or alt is pressed" if event.Ascii = = 99 : print "control+c is pressed" exit() else : print 'MessageName:' ,event.MessageName print 'Ascii:' , repr (event.Ascii), repr ( chr (event.Ascii)) print 'Key:' , repr (event.Key) print 'KeyID:' , repr (event.KeyID) print 'ScanCode:' , repr (event.ScanCode) print '---' print "The pressed key does not match Control+c" hm = pyHook.HookManager() hm.KeyDown = OnKeyboardEvent hm.HookKeyboard() pythoncom.PumpMessages () |