Add long-right-press as a shortcut to the now playing screen

Implemented for both the wheel and d-pad input methods.
custom
jacqueline 4 months ago
parent b3e1e88ba2
commit 13c5b7b847
  1. 12
      lua/main.lua
  2. 1
      luals-stubs/controls.lua

@ -70,6 +70,18 @@ local function init_ui()
end end
end end
end), end),
controls.scheme:bind(function()
-- Set up a shortcut for jumping straight to the 'now playing' screen.
-- Implemented as a binding so that the shortcut is still applied even if
-- the control scheme is changed at runtime.
local hooks = controls.hooks()
local input_method = hooks.wheel or hooks.dpad
if input_method and input_method.right then
input_method.right.long_press = function()
require("playing"):push_if_not_shown()
end
end
end),
sd_card.mounted:bind(function(mounted) sd_card.mounted:bind(function(mounted)
backstack.reset(main_menu:new()) backstack.reset(main_menu:new())
end), end),

@ -7,6 +7,7 @@
--- @field scheme Property The currently configured control scheme --- @field scheme Property The currently configured control scheme
--- @field scroll_sensitivity Property How much rotational motion is required on the touchwheel per scroll tick. --- @field scroll_sensitivity Property How much rotational motion is required on the touchwheel per scroll tick.
--- @field lock_switch Property The current state of the device's lock switch. --- @field lock_switch Property The current state of the device's lock switch.
--- @field hooks funtion Returns a table containing the inputs and actions associated with the current control scheme.
local controls = {} local controls = {}
return controls return controls

Loading…
Cancel
Save