From ff6aa8e4975663c58c2c195a6028b7e38722951a Mon Sep 17 00:00:00 2001 From: Firew0lf Date: Fri, 21 Aug 2015 18:24:21 +0200 Subject: [PATCH] Added the hid.pos3d() function. hid.3d() was not possible. Sorry. --- source/hid.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/hid.c b/source/hid.c index 0a23583..65f098f 100644 --- a/source/hid.c +++ b/source/hid.c @@ -130,6 +130,14 @@ static int hid_volume(lua_State *L) { return 1; } +static int hid_3d(lua_State *L) { + float slider = (*(float*)0x1FF81080); + + lua_pushnumber(L, slider); + + return 1; +} + static const struct luaL_Reg hid_lib[] = { { "read", hid_read }, { "keys", hid_keys }, @@ -138,6 +146,7 @@ static const struct luaL_Reg hid_lib[] = { { "accel", hid_accel }, { "gyro", hid_gyro }, { "volume", hid_volume }, + { "pos3d", hid_3d }, { NULL, NULL } };