Merge branch 'rr1-maint'

Conflicts:
	manual.txt
	src/lua/input.cpp
This commit is contained in:
Ilari Liusvaara 2013-03-19 05:32:26 +02:00
commit ab9080294c
3 changed files with 33 additions and 6 deletions

View file

@ -2352,6 +2352,18 @@ keyboard.unbind(string mod, string mask, string key)
Unbind specified key with specified modifers.
\end_layout
\begin_layout Itemize
nil does not change value
\end_layout
\begin_layout Itemize
true/false (buttons) and integers (axes) force value.
\end_layout
\begin_layout Itemize
string (button) inverts the input.
\end_layout
\begin_layout Subsubsection
keyboard.alias(string alias, string expansion)
\end_layout
@ -2630,7 +2642,7 @@ Count number of subframes in specified frame (frame numbers are 1-based)
\end_layout
\begin_layout Subsubsection
movie.read_subframe(number frame, number subframe)
movie.read_subframes(number frame, number subframe)
\end_layout
\begin_layout Standard

View file

@ -1171,6 +1171,12 @@ Bind specified key with specified modifers to specified command.
Unbind specified key with specified modifers.
• nil does not change value
• true/false (buttons) and integers (axes) force value.
• string (button) inverts the input.
7.5.3 keyboard.alias(string alias, string expansion)
Set expansion of given command.
@ -1320,7 +1326,7 @@ Set readwrite mode (does not cause on_readwrite callback).
Count number of subframes in specified frame (frame numbers are
1-based) and return that.
7.8.7 movie.read_subframe(number frame, number subframe)
7.8.7 movie.read_subframes(number frame, number subframe)
Read specifed subframe in specified frame and return data as
array (100 elements, numbered 0-99 currently).

View file

@ -257,10 +257,19 @@ namespace
L.pushstring(ctrl.buttons[i]->name);
L.gettable(2);
int s;
if(ctrl.buttons[i]->is_analog())
s = L.tonumber(-1);
else
s = L.toboolean(-1) ? 1 : 0;
if(ctrl.buttons[i]->is_analog()) {
if(L.type(-1) == LUA_TNIL)
s = lua_input_controllerdata->axis3(pcid.first, pcid.second, i);
else
s = L.tonumber(-1);
} else {
if(L.type(-1) == LUA_TNIL)
s = lua_input_controllerdata->axis3(pcid.first, pcid.second, i);
else if(L.type(-1) == LUA_TSTRING)
s = lua_input_controllerdata->axis3(pcid.first, pcid.second, i) ^ 1;
else
s = L.toboolean(-1) ? 1 : 0;
}
lua_input_controllerdata->axis3(pcid.first, pcid.second, i, s);
L.pop(1);
}