Module:Key/sandbox explained

-- This module implements .

local kbdPrefix = ''

local kbdSuffix = ''

local keyText =

local keyAlias =

local Collection = Collection.__index = Collectiondo function Collection:add(item) if item ~= nil then self.n = self.n + 1 self[self.n] = item end end function Collection:join(sep) return table.concat(self, sep) end function Collection:sort(comp) table.sort(self, comp) end function Collection.new return setmetatable(Collection) endend

local function keyPress(args) local chainNames = local result = Collection.new local chainDefault = args.chain or '+' for i, id in ipairs(args) do if i > 1 then result:add(args[chainNames[i - 1]] or chainDefault) end local lc = id:lower local text = keyText[lc] or keyText[keyAlias[lc]] or id result:add(kbdPrefix .. text .. kbdSuffix) end return mw.getCurrentFrame:extensionTag .. result:joinend

local function keypress(frame) -- Called by "". -- Using the template doubles the post‐expand include size. return keyPress(frame:getParent.args)end

local function press(frame) -- Called by "". return keyPress(frame.args)end

return