Thierry <thierry.pelle <at> soliavos.fr> writes:

> I test 
> awful.key({ modkey           }, "Up",       awful.tag.viewidx(1)            ))
> to simulate a awful.tag.viewnext but that does not work too... even if 
> awful.tag.viewidx(1) IS awful.tag.viewnext.
> 
> Any Idea?
> 
> Thierry
> 
> 


Hi Thierry, I was wondering about this myself. It turned out, by calling
awful.tag.viewidx(3) you are putting the return value of the function call into
the object instead of binding the function (this is dealt with by the preset
keys by not having the argument-brackets "()" at the end of the function,
obviously not something possible when you need to pass arguments).
Long story short, you need to wrap the function in "function () [...] end"
So my code (I wanted to do exactly the same thing) now looks like this:
awful.key({ modkey,           }, "Up",     function () awful.tag.viewidx(3) 
end),
awful.key({ modkey,           }, "Down",   function () awful.tag.viewidx(-3) 
end),

Hope this is still useful, I know this post has existed for a while...

-brisk


-- 
To unsubscribe, send mail to [email protected].

Reply via email to