1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 07:47:14 +03:00

Clean up hotkey thread on exit on Windows

This commit is contained in:
Jonathan Harris 2016-09-06 12:41:02 +01:00
parent b6a5d7b8ed
commit 28169cc404

View File

@ -9,7 +9,6 @@ from config import config
if platform == 'darwin':
import threading
import objc
from AppKit import NSApplication, NSWorkspace, NSBeep, NSSound, NSEvent, NSKeyDown, NSKeyUp, NSFlagsChanged, NSKeyDownMask, NSFlagsChangedMask, NSShiftKeyMask, NSControlKeyMask, NSAlternateKeyMask, NSCommandKeyMask, NSNumericPadKeyMask, NSDeviceIndependentModifierFlagsMask, NSF1FunctionKey, NSF35FunctionKey, NSDeleteFunctionKey, NSClearLineFunctionKey
@ -180,6 +179,7 @@ if platform == 'darwin':
elif platform == 'win32':
import atexit
import ctypes
from ctypes.wintypes import *
import threading
@ -285,6 +285,7 @@ elif platform == 'win32':
self.thread = None
self.snd_good = open(join(config.respath, 'snd_good.wav'), 'rb').read()
self.snd_bad = open(join(config.respath, 'snd_bad.wav'), 'rb').read()
atexit.register(self.unregister)
def register(self, root, keycode, modifiers):
self.root = root