Interface to GPM (General Purpose Mouse) library

The GPM unit implements an interface to libgpm, the console program for mouse handling. This unit was created by Peter Vreman, and is only available on linux.

When this unit is used, your program is linked to the C libraries, so you must take care of the C library version. Also, it will only work with version 1.17 or higher of the libgpm library.

Location of run PID files directory.
Location of /dev directory.
Where to write socket.
Mode of socket.
Name of PID file.
Device socket filename
Control socket
FIFO name
Left mouse button identifier.
Middle mouse button identifier.
Right mouse button identifier.
Mouse move event.
Mouse drag event.
Mouse button down event.
Mouse button up event.
Mouse single click event.
Mouse double click event.
Mouse triple click event.
Motion flag.
?
Enter area event.
Leave area event.
Top of area.
Bottom of area.
Left side of area.
Right side of area.
Type for event type.
Type to hold area margin.
Pointer to record
Pointer to record
Alias for record
GPM event record
Tgpm_event
describes the events that are reported by GPM.
Pressed buttons
Modifier flags
Virtual console
Change in horizontal position since last event
Change in vertical position since last event
Horizontal position of event
Vertical position of event
Event type
Number of clicks
Position where mouse cursor left the screen.
Mouse event handler callback.
Pointer to record.
Pointer to record.
Alias for record.
GPM server connection information.
Mask with events which client is interested in
Mask with events that should be handled with defaults
Minimum amount of modifiers required for client
Maximum amount of modifiers client can handle
PID of connecting application
Virtual console that should be handled.
Pointer to record.
Alias for Record
Pointer to record.
Record used to define regions of interest.
Minimum horizontal position.
Maximum horizontal position.
Minimum vertical position.
Maximum horizontal position.
Minimum modifiers required
Maximum modifiers allowed
Events to signal
?
Handler to call in case of event.
Clientdata to pass to event handler
Previous region of interest.
Next region of interest.
Internal gpm library variable. Do not use.
Internal gpm library variable. Do not use.
Internal gpm library variable. Do not use.
Internal gpm library variable. Do not use.
Internal gpm library variable. Do not use.
Internal gpm library variable. Do not use.
Internal gpm library variable. Do not use.
Internal gpm library variable. Do not use.
Internal gpm library variable. Do not use.
Internal gpm library variable. Do not use.
Internal gpm library variable. Do not use.
Internal gpm library variable. Do not use.
Internal gpm library variable. Do not use.
Internal gpm library variable. Do not use.
Internal gpm library variable. Do not use.
Internal gpm library variable. Do not use.
Internal gpm library variable. Do not use.
Internal gpm library variable. Do not use.
Check whether event has double click event.
Gpm_AnyDouble
returns True if EventType contains the GPM_DOUBLE flag, False otherwise.
None.
Check whether event has a single click event.
Gpm_AnySingle
returns True if EventType contains the GPM_SINGLE flag, False otherwise.
None.
Check whether event has a triple click event.
Gpm_AnySingle
returns True if EventType contains the GPM_TRIPLE flag, False otherwise.
None.
Close connection to GPM server.

Gpm_Close closes the current connection, and pops the connection stack; this means that the previous connection becomes active again.

The function returns -1 if the current connection is not the last one, and it returns 0 if the current connection is the last one.

for an example, see .

None.
Change coordinates to fit physical screen.
Gpm_fitValues
changes x and y so they fit in the visible screen. The actual mouse pointer is not affected by this function.
None.
Change coordinates to fit margin.
Gpm_FitValuesM
changes x and y so they fit in the margin indicated by margin. If margin is -1, then the values are fitted to the screen. The actual mouse pointer is not affected by this function.
None.
Get event from event queue.

Gpm_GetEvent Reads an event from the file descriptor gpm_fd. This file is only for internal use and should never be called by a client application.

It returns 1 on succes, and -1 on failue.

On error, -1 is returned.
Return GPM library version.

Gpm_GetLibVersion returns a pointer to a version string, and returns in where an integer representing the version. The version string represents the version of the gpm library.

The return value is a pchar, which should not be dealloacted, i.e. it is not on the heap.

None.
Return GPM server version.

Gpm_GetServerVersion returns a pointer to a version string, and returns in where an integer representing the version. The version string represents the version of the gpm server program.

The return value is a pchar, which should not be dealloacted, i.e. it is not on the heap.

If the gpm program is not present, then the function returns Nil
Return servers' current image of mouse state.

Gpm_GetSnapshot returns the picture that the server has of the current situation in Event. This call will not read the current situation from the mouse file descriptor, but returns a buffered version.

The function returns the number of mouse buttons, or -1 if this information is not available.

None.
Lower a region of interest in the stack.

Gpm_LowerRoi lowers the region of interest which after after. If after is Nil, the region of interest is moved to the bottom of the stack.

The return value is the new top of the region-of-interest stack.

None.
Open connection to GPM server.

Gpm_Open opens a new connection to the mouse server. The connection is described by the fields of the conn record of type .

if Flag is 0, then the application only receives events that come from its own terminal device. If it is negative it will receive all events. If the value is positive then it is considered a console number to which to connect.

The return value is -1 on error, or the file descriptor used to communicate with the client. Under an X-Term the return value is -2.

for an example, see .

On Error, the return value is -1.
Pop region of interest from the stack.
Gpm_PopRoi
pops the topmost region of interest from the stack. It returns the next element on the stack, or Nil if the current element was the last one.
None.
Push region of interest on the stack.

Gpm_PushRoi puts a new region of interest on the stack. The region of interest is defined by a rectangle described by the corners (X1,Y1) and (X2,Y2).

The mask describes which events the handler {fun} will handle; ExtraData will be put in the xtradata field of the {TGPM_Roi} record passed to the fun handler.

None.
Raise region of interest in the stack.
Gpm_RaiseRoi
raises the region of interest which till it is on top of region before. If before is nil then the region is put on top of the stack. The returned value is the top of the stack.
None.
Check for presence of mouse event.
Gpm_Repeat
returns 1 of no mouse event arrives in the next millisec miiliseconds, it returns 0 otherwise.
None.
Check whether event contains only a double-click event.
Gpm_StrictDouble
returns true if EventType contains only a doubleclick event, False otherwise.
None.
Check whether event contains only a single-click event.
Gpm_StrictDouble
returns True if EventType contains only a singleclick event, False otherwise.
None.
Check whether event contains only a triple-click event.
Gpm_StrictTriple
returns true if EventType contains only a triple click event, False otherwise.
None.