0

每次我使用我的键绑定时都会出错

/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
4

0 回答 0