Added standalone analyzer layout
This commit is contained in:
5 files changed
+110
-13
No files matched your search
+12
@@ -190,14 +190,19 @@ func (c *controllerContext) handleInput(event hardware.InputEvent) {
|
||||
c.handleRotaryPress()
|
||||
}
|
||||
case hardware.RotaryLongPressEvent:
|
||||
var handled bool
|
||||
for _, layout := range c.layouts {
|
||||
if layout.IsVisible() {
|
||||
if handler, ok := layout.(app.ButtonInputHandler); ok {
|
||||
log.WithField("layout", layout.String()).Debug("dispatch button long press")
|
||||
handler.HandleButtonLongPress(c)
|
||||
handled = true
|
||||
}
|
||||
}
|
||||
}
|
||||
if !handled {
|
||||
c.handleRotaryLongPress()
|
||||
}
|
||||
default:
|
||||
log.Warn("unhandled input event")
|
||||
}
|
||||
@@ -228,4 +233,11 @@ func (c *controllerContext) handleRotaryPress() {
|
||||
c.Show(c.layouts[nextIndex])
|
||||
}
|
||||
|
||||
func (c *controllerContext) handleRotaryLongPress() {
|
||||
log := logrus.NewEntry(logrus.StandardLogger())
|
||||
log.Debug("no handler for rotary press event, switching to settings")
|
||||
|
||||
c.Show(c.settingsLayout)
|
||||
}
|
||||
|
||||
var _ app.Context = (*controllerContext)(nil)
|
||||
Reference in new issue
Block a user