Lua: input.lcid_to_pcid
This commit is contained in:
parent
a5dc55e008
commit
5f1e9e243b
3 changed files with 25 additions and 0 deletions
|
@ -2905,6 +2905,15 @@ Set the the state of specified controller to values specified in specified
|
|||
table.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsubsection
|
||||
input.lcid_to_pcid(number controller)
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Return the physical index, physical port and controller number in port for
|
||||
specified (1-based) logical controller.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
Table subtitle
|
||||
\end_layout
|
||||
|
|
|
@ -1453,6 +1453,11 @@ names of fields vary by controller type.
|
|||
Set the the state of specified controller to values specified in
|
||||
specified table.
|
||||
|
||||
8.4.11 input.lcid_to_pcid(number controller)
|
||||
|
||||
Return the physical index, physical port and controller number in
|
||||
port for specified (1-based) logical controller.
|
||||
|
||||
8.5 Table subtitle
|
||||
|
||||
Subtitle handling
|
||||
|
|
|
@ -190,4 +190,15 @@ namespace
|
|||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
function_ptr_luafun ijlcid_to_pcid("input.lcid_to_pcid", [](lua_State* LS, const std::string& fname) -> int {
|
||||
unsigned lcid = get_numeric_argument<unsigned>(LS, 1, fname.c_str());
|
||||
int pcid = controls.lcid_to_pcid(lcid - 1);
|
||||
if(pcid < 0)
|
||||
return 0;
|
||||
lua_pushnumber(LS, pcid);
|
||||
lua_pushnumber(LS, pcid / 4);
|
||||
lua_pushnumber(LS, pcid % 4);
|
||||
return 3;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue