Begin Implementing V2 features

This commit is contained in:
Breadway 2026-05-11 20:56:10 +08:00
parent f0ef411697
commit e5611567c2
18 changed files with 3433 additions and 121 deletions

View file

@ -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" })