luabox

command module
v0.0.0-...-f110a76 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2015 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Luabox is a tiny library for writing console apps in Lua. It uses gopher-lua as the interpreter and termbox-go to interface with the terminal.

$ git clone https://github.com/ferbivore/luabox
$ go build
$ ./luabox examples/single-event.lua

You can also go get -u https://github.com/ferbivore/luabox if you like executables in your path. Here's what an extremely simple program, which prints ! to your terminal and quits when you press Ctrl-C, looks like:

function luabox.load()
    termbox.set(1, 1, "!")
end
function luabox.event(e)
    if e.key == termbox.key.CtrlC then
        luabox.quit()
    end
end

Luabox calls luabox.load() when starting up and luabox.event(e) when receiving a Termbox event. e is just a table - you can run the examples/single-event.lua file to see what it looks like. The termbox module offers a bunch of functions and constants you can use - see api.go for details.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址