Skip to content
Snippets Groups Projects
Commit fe1c7ad9 authored by Philip Stewart's avatar Philip Stewart Committed by rahix
Browse files

feat(simple_menu): Make scroll buttons configurable

parent dfbe4c12
No related branches found
No related tags found
No related merge requests found
......@@ -48,4 +48,6 @@ Option name Type Description
``ble_mac`` Boolean MAC address used for BLE. Format: ``ca:4d:10:xx:xx:xx``.
------------------ ---------- -----------
``ble_log_enable`` Boolean Activate HCI level logging of BLE data. Creates a new btsnoop compatible log file named ``ble.log`` in the ``logs`` folder after each boot if BLE is activated. Keeps the last 10 files.
------------------ ---------- -----------
``right_scroll`` Boolean Use both right buttons to scroll up and down. Lower left button is SELECT.
================== ========== ===========
......@@ -3,6 +3,7 @@ import color
import display
import sys
import time
import config
TIMEOUT = 0x100
""":py:func:`~simple_menu.button_events` timeout marker."""
......@@ -193,11 +194,18 @@ class Menu:
self.idx = 0
self.select_time = time.time_ms()
self.disp = display.open()
try:
right_scroll_str = config.get_string("right_scroll")
if right_scroll_str.lower() in ["true", "1"]:
right_buttons_scroll = True
except OSError:
right_buttons_scroll = self.right_buttons_scroll
self.button_scroll_up = (
buttons.TOP_RIGHT if self.right_buttons_scroll else buttons.BOTTOM_LEFT
buttons.TOP_RIGHT if right_buttons_scroll else buttons.BOTTOM_LEFT
)
self.button_select = (
buttons.BOTTOM_LEFT if self.right_buttons_scroll else buttons.TOP_RIGHT
buttons.BOTTOM_LEFT if right_buttons_scroll else buttons.TOP_RIGHT
)
def entry2name(self, value):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment