On Sat, Apr 21, 2012 at 1:19 PM, Uli Schlachter <psyc...@znc.in> wrote:
> On 21.04.2012 09:09, Anurag Priyam wrote:
>> Say I run two grabbers one after the other.  If the second grabber
>> returns false, the event will be dispatched to the first one without
>> removing the second one from the stack.  This doesn't sound like what
>> you previously said "...if someone after you asks for keys as well he
>> will get it until he leaves it and you're back in key control again."
>
> Uhm, I think this "table stack" works the other way around than you think it
> works. The newest entry has index 1 in the table.
[...]
> Keygrabber can thus not only ask for old events, but can also pass on some of
> them to "older" keygrabbers. E.g. a menu which can only be navigated with 
> arrow
> keys and ignores/passes on all other keys.

Right, I got that.  So my question was "Is being able to bubble up
events to the older grabbers intended (given the use of 'stack') and
whether it is safe?", which you answered below.

> Does this make sense? Do you agree that this makes sense?
>
> (I take your response as a NACK to the patch and will now wait for an ACK or a
> timeout ;-) )

Yep, except the docs could do with some improvement:

+--- The global key grabber
+-- that distributes the key events to the last grabber in history
+local function grabber(mod, key, event)
+    for i, g in ipairs(grabbers) do
+        -- continue if the grabber returns explicitly false

It should be "continue unless the grabber explicitly returns false".

Perhaps the luadoc for the module should describe the event bubbling
behavior too.

-- 
Anurag Priyam

--
To unsubscribe, send mail to awesome-devel-unsubscr...@naquadah.org.

Reply via email to