Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.
Valeri edited this page Aug 28, 2019 · 4 revisions

Welcome to the lua-xwiimote wiki! It is used to host documentation for this library.

Overview

Flow of usual application using lua-xwiimote library looks like this:

  1. require this library
  2. Enumerate connected WiiMotes using wii.monitor
  3. Open those you need as wii.iface
  4. (Optional) Check available interfaces with iface:available() and/or read static data
  5. Open on them interfaces using iface:open()
  6. (Optional) Obtain file descriptors for using with side library porting poll syscall, like Gio.UnixInputStream from lgi or poll from luaposix with iface:get_fd()
  7. Check for incoming events using
for ev in iface:iter() do
	-- Handle event
end

either constantly or when file descriptor from step 6 reports itself as readable.

Examples

Examples page have the list of included examples with some comments on them.

Some definitions

  • "Standard assert-compatible notation" — true or value on success, false and string message on error. It's generally used on recoverable/non-fatal errors.
Clone this wiki locally