mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-11 03:45:06 -05:00
32 lines
608 B
Python
Executable File
32 lines
608 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
from ctypes import *
|
|
import platform
|
|
from mmlmouse import Mouse
|
|
|
|
class MMLCoreException(Exception):
|
|
def __init__(self, err):
|
|
Exception.__init__(self, err)
|
|
|
|
class MMLCore(object):
|
|
def __init__(self, dllpath):
|
|
self.dll = CDLL(dllpath)
|
|
|
|
self.dll.init.restype = c_int
|
|
self.dll.init.argtypes = None
|
|
if self.dll.init() != 0:
|
|
del self.dll
|
|
raise MMLCoreException("Could not initialize the DLL")
|
|
|
|
def __del__(self):
|
|
del self.dll
|
|
|
|
DLL = MMLCore('../libmml.so')
|
|
|
|
m = Mouse(DLL)
|
|
print m._getMousePos()
|
|
|
|
del DLL
|
|
|
|
|