mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-22 09:12:19 -05:00
Few small changes.
This commit is contained in:
parent
fc8a181cec
commit
e68dab9280
@ -10,6 +10,10 @@ class MMLCoreException(Exception):
|
|||||||
Exception.__init__(self, err)
|
Exception.__init__(self, err)
|
||||||
|
|
||||||
class MMLCore(object):
|
class MMLCore(object):
|
||||||
|
'''
|
||||||
|
The MMLCore object is to be opened only once per Python instance.
|
||||||
|
It opens the libmml library, and calls init().
|
||||||
|
'''
|
||||||
def __init__(self, dllpath):
|
def __init__(self, dllpath):
|
||||||
self.dll = CDLL(dllpath)
|
self.dll = CDLL(dllpath)
|
||||||
|
|
||||||
|
@ -8,6 +8,15 @@ class MouseException(Exception):
|
|||||||
|
|
||||||
# Usage:
|
# Usage:
|
||||||
class Mouse(object):
|
class Mouse(object):
|
||||||
|
'''
|
||||||
|
The MML Mouse object communicates directly with libmml,
|
||||||
|
but wraps it around a nice and easy to use layer.
|
||||||
|
It will allow several ways to set mouse positions and
|
||||||
|
buttons. __getitem__ and __setitem__ are also implemented,
|
||||||
|
so one can access mouse buttons states and positions with [].
|
||||||
|
|
||||||
|
|
||||||
|
'''
|
||||||
# _mc = MMLCore reference.
|
# _mc = MMLCore reference.
|
||||||
_mc = None
|
_mc = None
|
||||||
Left ='Left'
|
Left ='Left'
|
||||||
@ -19,7 +28,8 @@ class Mouse(object):
|
|||||||
_lpp = (0, 0)
|
_lpp = (0, 0)
|
||||||
|
|
||||||
def __init__(self, MC):
|
def __init__(self, MC):
|
||||||
'''Initialize the Mouse object'''
|
''' Initialize the Mouse object. Needs a DLL Mufasa Core object
|
||||||
|
(which contains the dll reference.)'''
|
||||||
self._mc = MC
|
self._mc = MC
|
||||||
self._initialiseDLLFuncs()
|
self._initialiseDLLFuncs()
|
||||||
pass
|
pass
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
from ctypes import *
|
from ctypes import *
|
||||||
|
|
||||||
class POINT(Structure):
|
class POINT(Structure):
|
||||||
|
'''
|
||||||
|
POINT represents a point with two variables, x and y.
|
||||||
|
POINT is mainly used for Python <-> MML communication.
|
||||||
|
'''
|
||||||
_fields_ = [('x', c_int),
|
_fields_ = [('x', c_int),
|
||||||
('y', c_int)]
|
('y', c_int)]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user