除了一个错误,Volume小部件工作

时间:2014-08-23 01:56:27

标签: lua awesome-wm

每次我使用我的键绑定时都会收到错误

/usr/share/awesome/lib/awful/key.lua:42: attempt to call upvalue 'press' (a string value)

第42行:

 ret[#ret]:connect_signal("press", function(kobj, ...) press(...) end)

这里是它周围的所有线条

--- Create a new key to use as binding.
-- This function is useful to create several keys from one, because it will use
-- the ignore_modifier variable to create more key with or without the ignored
-- modifiers activated.
-- For example if you want to ignore CapsLock in your keybinding (which is
-- ignored by default by this function), creating key binding with this function
-- will return 2 key objects: one with CapsLock on, and the other one with
-- CapsLock off.
-- @see key
-- @return A table with one or several key objects.
function key.new(mod, _key, press, release)
    local ret = {}
    local subsets = util.subsets(ignore_modifiers)
    for _, set in ipairs(subsets) do
        ret[#ret + 1] = capi.key({ modifiers = util.table.join(mod, set),
                                   key = _key })
        if press then
            ret[#ret]:connect_signal("press", function(kobj, ...) press(...) end)
        end
        if release then
            ret[#ret]:connect_signal("release", function(kobj, ...) release(...) end)
        end
    end
    return ret
end

0 个答案:

没有答案
相关问题