Jomelo / LCDMenuLib2

Create a tree menu. Use it with different lcd types / console output / ssh console.
MIT License
249 stars 46 forks source link

Moving cursor with a grid menu #95

Open localhero44 opened 9 months ago

localhero44 commented 9 months ago

Hi, I use this library for a project and it works fine with the actual UI. Now I would like to make a new UI, still using the library but with a new way of showing the "menus" as a grid (let's say 4*4). Showing the grid is ok, but I would like to know if it's possible to jump from row to row, that means moving the cursor + 4 instead of just +1/-1. Is there a function that would allow that ? Thanks

Jomelo commented 9 months ago

Hi, unfortunately, the library does not currently support this.

The menu calculates the cursor position in some places. These calculations would all have to be adjusted.

The simplest step is still direct scrolling. It is more difficult to determine the correct cursor position when the menu returns from an element or a "jumpTo" function is executed. The cursor position is important, otherwise the scroll function will not work.

At all points where the variables cursor_pos = 0; cursor_obj_pos = 0; cursor_pos_abs = 0; window_start = 0; are used, an adjustment must be made.

At the moment I can't think of an easy way without investing a lot of time