Page MenuHomePhabricator

efl.ui.text key navigation issues
Open, HighPublic

Description

Arrow keys

When using the arrow keys the cursor is moved. However, when the cursor is at the minimal or maximum position and I press up / left or down / right the key down event will not be consumed. (This then results in the fact that focus movement will work again).

General Implementation

Normally widgets do not implement directly key-down callbacks. They normally use ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT and key_actions. With these helpers the actaul "key" and modifier gets loaded from the config, which means these operations can be changed by a API user (which happens from time to time). Using these helpers will also simplyfy your code, additionally, the bug described above will be solved more easily.

bu5hm4n created this task.Dec 18 2019, 12:04 AM
bu5hm4n triaged this task as High priority.
bu5hm4n added a project: efl (efl-1.24).

To be honest, IMO I do not think this is the right behavior, and the user does not expect it, and make the arrow keys very tricky and must click precisely to not lose focus by mistake.

I examine some frameworks like WinForms, Qt, In these platforms If text widget becomes focused, the user can not lose focus with the arrow keys.

Other toolkits do not matter, as efl is one of the only ones implementing focus-movement by keys. Additionally, every other widget supports that + legacy supports that.
So we also want that in efl.ui.text.

ali.alzyod added a comment.EditedTue, Dec 24, 12:28 AM

efl is one of the only ones implementing focus-movement by keys.

what do you mean? Maybe I am missing something, most toolkit (Qt, Winforms) allow movement for focus using arrow keys

So we also want that in efl.ui.text.

ui.text should be special case, not as other widgets, becuase arrows control cursor position

efl is one of the only ones implementing focus-movement by keys.

what do you mean? Maybe I am missing something, most toolkit (Qt, Winforms) allow movement for focus using arrow keys

QT does not have arrow navigation through the widgets on the UI, you can only move selection of lists etc. and the cursor in the entry (maybe other things), however, you for example cannot focus the play button in the qt frontent of vlc just by using the arrow keys. Now go into elm test and press the arrow keys, and you will see that you can focus every single widget in the window.

So we also want that in efl.ui.text.

ui.text should be special case, not as other widgets, becuase arrows control cursor position

Please see how legacy handles that, if you cannot change the cursor position anymore with the arrow keys, focus is moved. And that is something (as i said before) that we want to keep, as every widget in efl can be escaped with the arrow keys.

efl is one of the only ones implementing focus-movement by keys.

what do you mean? Maybe I am missing something, most toolkit (Qt, Winforms) allow movement for focus using arrow keys

QT does not have arrow navigation through the widgets on the UI, you can only move selection of lists etc. and the cursor in the entry (maybe other things), however, you for example cannot focus the play button in the qt frontent of vlc just by using the arrow keys. Now go into elm test and press the arrow keys, and you will see that you can focus every single widget in the window.

I do not know about VLC, But I can create Qt application and navigate through controls using arrow keys/ tabs (some controls uses tabs only)

Yeah, you have encountered what I said before. Arrow keys do not work on every widget. They usually only work for selection or other special cases. In general, arrow keys do not work in QT. However they do on every efl widget, so we need to make this work as well on efl.ui.text.

In general, arrow keys do not work in QT.

this depends on what you mean by In general, almost all controls that can be focused can be changed with arrows or tabs like buttons, checkboxes, ...
the only difference I can find is in textbox like widgets

aside from QT
I feel this is very confusing for the user who uses the application with a textbox.

I hope this example shows the problem with losing focus with an arrow in textbox:
Imagine you type in the textbox (with many lines of text) and you want to go up to the first line to edit something there:
1- So you keep pressing the upper arrow key (this is what you are normally do in multiline text widgets)
2- but Ooops you are not in the text-block at all, and If you did not notice that you could press Enter on some button to do unwanted action

I am concerned that, is this valid default behavior ?

In general, arrow keys do not work in QT.

this depends on what you mean by In general, almost all controls that can be focused can be changed with arrows or tabs like buttons, checkboxes, ...
the only difference I can find is in textbox like widgets

This does not matter, efl runs on devices that do not have any mice or pointer like device. We need that on *every* widget,

aside from QT
I feel this is very confusing for the user who uses the application with a textbox.

I hope this example shows the problem with losing focus with an arrow in textbox:
Imagine you type in the textbox (with many lines of text) and you want to go up to the first line to edit something there:
1- So you keep pressing the upper arrow key (this is what you are normally do in multiline text widgets)
2- but Ooops you are not in the text-block at all, and If you did not notice that you could press Enter on some button to do unwanted action

This is a example showing what can happen when a user does not control the UI correctly. However, this example is not bound to the textbox usage, nor to the usage of arrow-key focus. The same can happen with tab-key focus or simple clicking.

I am concerned that, is this valid default behavior ?

For EFL the default behaviour is to use the arrow keys for focus movement when the widget cannot handle it in anymore (like cursor at position 0 and you press left, just like legacy).