diff --git a/Documentation/card10-cfg.rst b/Documentation/card10-cfg.rst index 7a0173b3daceb49d8481e09948c485c1cec6a628..134014889d5008b6e851f2a4fe33d176cb040d23 100644 --- a/Documentation/card10-cfg.rst +++ b/Documentation/card10-cfg.rst @@ -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. ================== ========== =========== diff --git a/pycardium/modules/py/simple_menu.py b/pycardium/modules/py/simple_menu.py index 5701d80b61bd859fff5b165dcf663a4a5d9ec801..506c5f894e3ea9652e1995b14faf503ddfae4a84 100644 --- a/pycardium/modules/py/simple_menu.py +++ b/pycardium/modules/py/simple_menu.py @@ -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):