Begin Implementing V2 features
This commit is contained in:
parent
f0ef411697
commit
e5611567c2
18 changed files with 3433 additions and 121 deletions
|
|
@ -231,11 +231,12 @@ bread.once("bread.system.startup", function(event)
|
|||
end)
|
||||
|
||||
-- Subscribe with a predicate filter
|
||||
-- Third arg is an opts table with a 'filter' key whose value is the predicate
|
||||
bread.filter("bread.device.connected", function(event)
|
||||
return event.data.class == "keyboard"
|
||||
end, function(event)
|
||||
bread.exec("xset r rate 200 40")
|
||||
end)
|
||||
end, { filter = function(event)
|
||||
return event.data.class == "keyboard"
|
||||
end })
|
||||
|
||||
-- Emit a custom event (for cross-module communication)
|
||||
bread.emit("mymodule.something", { key = "value" })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue