Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using input widgets without a toutchscreen #14

Closed
PTDreamer opened this issue Jul 15, 2017 · 11 comments
Closed

Using input widgets without a toutchscreen #14

PTDreamer opened this issue Jul 15, 2017 · 11 comments

Comments

@PTDreamer
Copy link

Hi,

I would like to use the library on a system with just a clickable rotary encoder as an input device. How can I accomplish that since the library doesn't seem to have the active widget state?

i.e. rotate the encoder changes the active button (or list item or whatever) and clicking on it sends a "click" to the active widget.

@kisvegabor
Copy link
Member

kisvegabor commented Jul 15, 2017

Hi,

Yes, you are right. There is no "native" support for this feature. But I like it! Thank you for the idea.

I've already figured out how to realize it. On Monday I will send you an example implementation.

@kisvegabor
Copy link
Member

@PTDreamer
Copy link
Author

Yeh that is exactly what I need, lists and comboboxes require auto scroling to the active item though

@PTDreamer
Copy link
Author

Ok I have looked at the attached code and understand your solution. I was thinking about the possibility of making the active state a property of the graphical object with it's own style (e.g. LV_STYLE_BTN_ACTIVE). Also having the library handling the active states automagicaly by having functions to change the active item to the next or previous item (like tab indexes on frameworks like Qt or .NET), and to send signal to them like activeitemclick()

@kisvegabor
Copy link
Member

kisvegabor commented Jul 17, 2017

Great!

Yes, I was thinking on something similar too. This functionality can be integrated to the library but it means a lot of work to implement all the handler functions for different object types.

@kisvegabor
Copy link
Member

kisvegabor commented Jul 19, 2017

I had some free time so I implemented one part of it. Now you can create groups from objects and activate next or previous. A callback function belongs to every object group to modify the style of the active object. For example: color_mix(style->mcolor, COLOR_ORANGE, OPA_50) will mix orange to the current color therefore it is not required to define new styles.

The next step is to implement new signals when an object is activated and its value increased/decreased.

https://www.youtube.com/watch?v=FUDmUKaejFg&feature=youtu.be

enc2.zip

I create a new branch called lv_group for this feature

What do you think?

@qwert1213131
Copy link

There are many devices not equipped with touch screens, so it is necessary to use buttons。
That's great

@kisvegabor
Copy link
Member

I added a full featured sub system called lv_group to the beta branch.

See an example here: https://github.com/littlevgl/lvgl/blob/beta/lv_examples/2_2_encoder_ctrl/encoder_ctrl.c
In the example there are buttons on the GUI to simulate encoder actions.

Can you try it?

@kisvegabor
Copy link
Member

The update is released in v4.2.0.
Read more here: http://www.gl.littlev.hu/objects/#group

@PTDreamer
Copy link
Author

I'm sorry for the lack of feedback, I'm currently on vacations and don't have the hw required to test the new code.
Thank you for the new features.

@kisvegabor
Copy link
Member

kisvegabor commented Aug 19, 2017

No problem, just enjoy your holiday! :)
I'm waiting for your feedback when your hardware is ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants