https://github.com/squeek502/lua-windcon
Lua module for interacting with the console on Windows
https://github.com/squeek502/lua-windcon
Last synced: 2 months ago
JSON representation
Lua module for interacting with the console on Windows
- Host: GitHub
- URL: https://github.com/squeek502/lua-windcon
- Owner: squeek502
- License: unlicense
- Created: 2020-12-06T14:19:56.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-12-08T20:46:52.000Z (over 4 years ago)
- Last Synced: 2025-01-29T12:32:42.183Z (4 months ago)
- Language: C
- Size: 11.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lua-windcon
[](https://ci.appveyor.com/project/squeek502/lua-windcon)
`windcon` is a [Lua](https://www.lua.org/) module for interacting with the console on Windows.
```lua
local windcon = require('windcon')-- Clear the screen
windcon.clear()-- Get the console size
local w, h = windcon.size()-- Move the cursor to the center
windcon.movecursor(w / 2, h / 2)-- Hide the cursor
windcon.showcursor(false)
```## Installation
With [Luarocks](https://luarocks.org/modules/squeek502/windcon):```
luarocks install windcon
```## API Reference
### `windcon.showcursor([state = true])`
Sets the visibility of the cursor to `state`. On success, returns `true`.### `windcon.movecursor(x, y)`
Moves the cursor to the given coordinates. On success, returns `true`; otherwise, returns `nil, errmsg`.### `windcon.clear()`
Clears the screen. On success, returns `true`; otherwise, returns `nil, errmsg`.### `windcon.size()`
Returns the width and height of the console.