Show pagesourceOld revisionsBacklinksAdd to bookExport to PDFODT exportBack to top Share via Share via... Twitter LinkedIn Facebook Pinterest Telegram WhatsApp Yammer Reddit TeamsRecent ChangesSend via e-MailPrintPermalink × Book Creator Add this page to your book Book Creator Remove this page from your book Manage book(0 page(s)) Help Ringer (lua) Example: Ringer ringer.xml <?xml version="1.0" encoding="utf-8" ?><templates> <!-- switches ringer on and off, stores current volume locally --> <template name="ringer" icon="@drawable/ringer_on"> <!-- todo string for ringer --> <keyConfiguration> <lua> <code>local currentlyMuted = falselocal path = "sound/volumes/ringing"local configuredVolume = config.get( path ) function onConfigChanged() local c = config.get( path ) print( c ) if not (c == "0") then key:setLed("off") configuredVolume = c currentlyMuted = false else currentlyMuted = true key:setLed("red") endend function onKeyUp() if currentlyMuted then config.set( path, configuredVolume ) else config.set( path, 0 ) endend config.register(path, onConfigChanged) </code> </lua> </keyConfiguration> </template></templates> en/products/comfortel-d-series/developer/keys/templates/examples/ringer.txt Last modified: 22.03.2022 13:17by hoehne