class GPM
- GPM
- Reference
- Object
Defined in:
gpm.crConstant Summary
-
ENDIAN =
IO::ByteFormat::SystemEndian -
GPM writes its raw C structs onto the socket, so all multi-byte fields are in the host's native byte order (little-endian on x86/most ARM).
-
MAGIC =
1198550348_u32 -
SOCKET =
"/dev/gpmctl" -
USE_MAGIC =
false -
VERSION =
"1.0.5"
Constructors
Instance Method Summary
- #config : Config
- #config=(config : Config)
- #file : String
- #file=(file : String)
-
#get_event(raw = @socket)
Reads one event from the socket.
- #magic : UInt32
- #magic=(magic : UInt32)
- #send_config(config = @config, socket = @socket)
- #socket : UNIXSocket
- #socket=(socket : UNIXSocket)
- #stop
- #use_magic=(use_magic : Bool)
- #use_magic? : Bool
Constructor Detail
Instance Method Detail
def get_event(raw = @socket)
#
Reads one event from the socket. Returns nil once the connection is
closed (e.g. GPM exits), so callers can use while e = gpm.get_event.
Pulls the whole 28-byte Gpm_Event struct with one read_fully and decodes
fields from that stack buffer, instead of a buffered read per field.