X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ioncore%2Fioncore_bindings.lua;h=5f11967db2f52b76abafe5970920a4b24d4865ea;hb=7c392448b0d2efcc6bb959063dcaa8b2c5ea0964;hp=aa52c74ff5ac436ae413132fe238a7e8fb434edf;hpb=d2a43a53786878c1273313249d3b49f6cd559b00;p=ion3.git diff --git a/ioncore/ioncore_bindings.lua b/ioncore/ioncore_bindings.lua index aa52c74..5f11967 100644 --- a/ioncore/ioncore_bindings.lua +++ b/ioncore/ioncore_bindings.lua @@ -110,29 +110,30 @@ end -- Returns a function that creates a submap binding description table. -- When the key press action \var{keyspec} occurs, Ioncore will wait for -- a further key presse and act according to the submap. --- For details, see section \ref{sec:bindings}. -function ioncore.submap(kcb_, list) +-- For details, see Section \ref{sec:bindings}. +function ioncore.submap(keyspec, list) if not list then return function(lst) - return submap(kcb_, lst) + return submap(keyspec, lst) end end - return {action = "kpress", kcb = kcb_, submap = list} + return {action = "kpress", kcb = keyspec, submap = list} end --DOC -- Creates a binding description table for the action of pressing a key given --- by \var{keyspec} (with possible modifiers) to the function \var{func}. --- For more information on bindings, see section \ref{sec:bindings}. +-- by \var{keyspec} (with possible modifiers) to the function \var{cmd}. +-- The \var{guard} controls when the binding can be called. +-- For more informationp see Section \ref{sec:bindings}. function ioncore.kpress(keyspec, cmd, guard) return putcmd(cmd, guard, {action = "kpress", kcb = keyspec}) end --DOC --- This is similar to \fnref{kpress} but after calling \var{cmd}, +-- This is similar to \fnref{ioncore.kpress} but after calling \var{cmd}, -- Ioncore waits for all modifiers to be released before processing -- any further actions. --- For more information on bindings, see section \ref{sec:bindings}. +-- For more information on bindings, see Section \ref{sec:bindings}. function ioncore.kpress_wait(keyspec, cmd, guard) return putcmd(cmd, guard, {action = "kpress_wait", kcb = keyspec}) end @@ -167,22 +168,22 @@ end --DOC -- Creates a binding description table for the action of clicking a mouse -- button while possible modifier keys are pressed, --- both given by \var{buttonspec}, to the function \var{func}. --- For more information, see section \ref{sec:bindings}. +-- both given by \var{buttonspec}, to the function \var{cmd}. +-- For more information, see Section \ref{sec:bindings}. function ioncore.mclick(buttonspec, cmd, guard) return mact("mclick", buttonspec, cmd, guard) end --DOC --- Similar to \fnref{mclick} but for double-click. --- Also see section \ref{sec:bindings}. +-- Similar to \fnref{ioncore.mclick} but for double-click. +-- Also see Section \ref{sec:bindings}. function ioncore.mdblclick(buttonspec, cmd, guard) return mact("mdblclick", buttonspec, cmd, guard) end --DOC --- Similar to \fnref{mclick} but for just pressing the mouse button. --- Also see section \ref{sec:bindings}. +-- Similar to \fnref{ioncore.mclick} but for just pressing the mouse button. +-- Also see Section \ref{sec:bindings}. function ioncore.mpress(buttonspec, cmd, guard) return mact("mpress", buttonspec, cmd, guard) end @@ -200,7 +201,7 @@ end --DOC -- Define bindings for context \var{context}. Here \var{binding} is -- a table composed of entries created with \fnref{ioncore.kpress}, --- etc.; see section \ref{sec:bindings} for details. +-- etc.; see Section \ref{sec:bindings} for details. function ioncore.defbindings(context, bindings) local function filterdoc(b) local t={}