![Logitech Magellan/SPACE MOUSE Classic Programmer'S Manual Download Page 15](http://html1.mh-extra.com/html/logitech/magellan-space-mouse-classic/magellan-space-mouse-classic_programmers-manual_1937109015.webp)
15
Windows Interface (mgldll.c Library)
The
mgldll.c
library contains several useful
functions for constructing the interface for a
Windows application. The file is found on the
LogiCad3D CD-ROM under the directory
\win95nt\source\mgldrv\
. The following
sections describe the functions available in this
library.
MagellanInit
This function checks for a running Magellan/
SPACE MOUSE driver and initializes the
interface. It must be the first Magellan/SPACE
MOUSE function to be called.
Syntax:
HMAGELLAN MagellanInit (
/* [in] */ HWND ApplicationWindow );
Application
Window
Handle to the application window.
Normally, this input parameter is a
variable initialized by the Win32 function
InitClassWindow().
Result:
If the function succeeds, the return value
is a Magellan handle. If not, it returns the
value NULL.
File:
mgldll.h
MagellanSetWindow
This function sets the window handle (stored
in
ApplicationWindow
) into the Magellan driver
as the current application window. All
messages generated by the Magellan driver
are now sent to the given window. Note that
this function has an operation similar to the
command
MagellanSetWindowCommand
in the
function
Syntax:
int MagellanSetWindow (
/* [in] */ HMAGELLAN MagellanHandle,
/* [in] */ HWND ApplicationWindow );
Magellan
Handle
Magellan handle. Normally, this
parameter is a variable initialized by the
function
MagellanInit.
Application
Window
Handle to the application window.
Result:
If the function succeeds, it returns the
value TRUE. If not, it returns the value
FALSE.
File:
mgldll.h
MagellanTranslateEvent
This function identifies and decodes incoming
event messages from the Magellan/SPACE
MOUSE driver and stores the resulting
information into the data structure pointed by
MagellanEvent
. The Magellan driver sends a
message to the application window handler if
one of three different types of events occurs:
MotionEvent
,
ButtonPressEvent
or
ButtonReleaseEvent
.
Syntax:
int MagellanTranslateEvent (
/* [in] */ HMAGELLAN MagellanHandle,
/* [in] */ LPMSG Message,
/* [out] */ MagellanIntegerEvent
*MagellanEvent );
Magellan
Handle
Magellan handle. Normally, this
parameter is a variable initialized by the
function
MagellanInit.
Message
Points to a standard Win32 MSG structure
with the raw data as sent by the driver.
Magellan
Event
This output variables stores the decoded
information in a structure of type
MagellanIntegerEvent, defined in the file
mgldll.h as follows:
struct _MagellanIntegerEvent_ {
HWND MagellanWindow;
int MagellanType;
int MagellanButton;
int MagellanData[6];
int MagellanPeriod;
};
typedef struct _MagellanIntegerEvent_
MagellanIntegerEvent;
Magellan
Window
The handle to the window of the
Magellan/SPACE MOUSE driver.
MagellanType The event type. Can have one of the
values
MotionEvent, ButtonPressEvent or
ButtonReleaseEvent, as defined in
mgldll.h.
Magellan
Button
Stores the number (1 to 12) of the button
which was pressed or released.
MagellanData An integer array with six elements,
defined as follows:
Index
Axis
0
X
1
Y
2
Z
3
A
4
B
5
C
Magellan
Period
Holds the time period of the data packet
sent by the device (in milliseconds).
Normally, this value is set to 60 ms.
Result:
If the message parsed by the function
corresponds to an event sent by the
Magellan driver, the function returns the
same value as stored in the
MagellanType
element of
MagellanEvent. If not, it
returns the value FALSE.
File:
mgldll.h
MagellanClose
This function closes the interface to the
Magellan driver and must be last Magellan
function called by the application.
Summary of Contents for Magellan/SPACE MOUSE Classic
Page 1: ......