本站文本内容除另有声明外,转载时均必须注明出处,并遵守CC BY-NC-SA 3.0协议。(转载须知)
本站是中文Minecraft Wiki的镜像站,与Mojang Studios、Weird Gloop没有从属关系。(免责声明)
全站通知:
模块:Keys
刷
历
编
跳到导航
跳到搜索
local p = {}
p.keys = function( f )
local args = f
if f == mw.getCurrentFrame() then
args = f:getParent().args
end
local keys = {}
for _, key in ipairs( args ) do
key = mw.text.trim( key )
if key ~= '+' and key:find( '%+' ) then
local comboKeys = {}
for comboKey in mw.text.gsplit( key, '%s*%+%s*' ) do
table.insert( comboKeys, p.key( comboKey ) )
end
table.insert( keys, table.concat( comboKeys, ' + ' ) )
else
table.insert( keys, p.key( key ) )
end
end
return table.concat( keys )
end
p.key = function( key )
if key == '' then
return ''
end
local symbols = mw.loadData( 'Module:Keys/Symbols' )
return '<kbd class="keyboard-key nowrap">' .. ( symbols[key:lower()] or key ) .. '</kbd>'
end
return p