[Lcdproc] Patch: Wrapping sliders
Peter Marschall
peter@adpm.de
Thu Oct 4 19:04:02 2007
Hi,
On Sunday, 30. September 2007, Markus Dolze wrote:
> I thought about it and had a look at the other input controls. They work
> a little bit different than sliders. IP, Alpha and Numeric inputs wrap
> their values around. This is OK, if one wants e.g. in a alpha input to
> change from 'W' to 'B'. Even with an Up and Down key I would like them
> to wrap (at least forward).
>
> LCDd always assumes you have 4 keys available (Menu, Enter, Up, Down)
> and reserves them, regardless if they are enabled in the config or not.
> But the left and right key are only reserved, if they are actually
> configured. As soon as a left or right key is configured, LCDd assumes
> you have an "extended" keypad, which makes the Enter key behave
> differently. The logic behind there is a bit odd, too.
>
> Therefore to make a menuitem aware that we have a "reduced" (3 key, no
> opposite key to one), "full" (4 key), or "extended" (5/6 key) keypad, I
> will have to extend the API between menuscreen and menuitem, because all
> keys are only visible in menuscreen.
I have committed the patch to CVS, but with a slight change:
The wrap does only take place when we do not have more than 4 keys.
Markus' idea above does not need a big API change.
Unfortunately this again is not fool proof.
- What to do if someone defines the 4 keys: Menu, Enter, Left, Up ?
Is this a "restricted" or a "full" pad
- What to do if someonew only defins 1 / 2 keys: Menu (+ any other) ?
IMHO shis setting shound not allow menus to be entered.
Despite the open questions above I have started to work in this direction:
- all keys in the [Menu] section are now optional
- a static bit maks called "keymask" holds the information on the defined
keys in the [Menu] section
- I want to replace the "extended" flag by the "keymask"
and adapt the input functions accordingly.
Further ideas and patches are very welcome.
Peter
--
Peter Marschall
peter@adpm.de