Nautilus: tab key change focus
Hi, Can someone give me any glue how tab-key-order and handling works in Nautilus? I am trying to fix the tab order in Nautilus but I do not see how it is implemented. Thanks, Jura
Hi Jura, it's implemented at the Morphic level; it follow the chain of owners / submorphs and should correctly tab to all morphs in the window, except when going through text fields which will catch the tab for themselves (but Ctrl+tab should work). To change the order, you may have a look at the order in which the morphs are added to the window. Another thing which may be of interest to you, Spec has the necessary code to override the default Morphic tab navigation and force an application defined order. What is the issue you are facing ? Thierry ________________________________________ De : Pharo-dev [pharo-dev-bounces@lists.pharo.org] de la part de Juraj Kubelka [juraj.kubelka@gmail.com] Date d'envoi : jeudi 26 décembre 2013 17:09 à : Pharo Development List Objet : [Pharo-dev] Nautilus: tab key change focus Hi, Can someone give me any glue how tab-key-order and handling works in Nautilus? I am trying to fix the tab order in Nautilus but I do not see how it is implemented. Thanks, Jura
Hi Thierry, thank you. Actually I have started with an issue with package filter input. When it has a focus, there is no way to change a focus with key press. Like tab, or down arrow key, or anything. And I also find out the tab order is strange. When package list has focus, tab change focus to the filter. I think it should change to class list. For some reasons it is possible to escape the filter input by pressing shift+tab, but not by pressing tab. So I wanted to try to change the âtab" order. Thanks, Jura El 26-12-2013, a las 16:34, GOUBIER Thierry <thierry.goubier@cea.fr> escribió:
Hi Jura,
it's implemented at the Morphic level; it follow the chain of owners / submorphs and should correctly tab to all morphs in the window, except when going through text fields which will catch the tab for themselves (but Ctrl+tab should work).
To change the order, you may have a look at the order in which the morphs are added to the window.
Another thing which may be of interest to you, Spec has the necessary code to override the default Morphic tab navigation and force an application defined order.
What is the issue you are facing ?
Thierry ________________________________________ De : Pharo-dev [pharo-dev-bounces@lists.pharo.org] de la part de Juraj Kubelka [juraj.kubelka@gmail.com] Date d'envoi : jeudi 26 décembre 2013 17:09 à : Pharo Development List Objet : [Pharo-dev] Nautilus: tab key change focus
Hi,
Can someone give me any glue how tab-key-order and handling works in Nautilus? I am trying to fix the tab order in Nautilus but I do not see how it is implemented.
Thanks, Jura
Have you tried Ctrl+Tab in the filter? I remember that text fields would catch the tab for themselves, and probably shift+tab as well, but we could force that filter to switch by using an onKeyCombination: Character tab asKeyCombination do: [ "setFocusToPackageListMorph" ] on the filter. With this asKeyCombination: do: , we could also change the order for the Package list and the class list (or just make sure the filter is added to the main window before the package list). If you change the order by hand, make sure you also correct the reverse order as well (Shift+tab and Ctrl+Shift+tab). I can't have a look at the code right now :( Thierry ________________________________________ De : Pharo-dev [pharo-dev-bounces@lists.pharo.org] de la part de Juraj Kubelka [juraj.kubelka@gmail.com] Date d'envoi : jeudi 26 décembre 2013 20:42 à : Pharo Development List Objet : Re: [Pharo-dev] Nautilus: tab key change focus Hi Thierry, thank you. Actually I have started with an issue with package filter input. When it has a focus, there is no way to change a focus with key press. Like tab, or down arrow key, or anything. And I also find out the tab order is strange. When package list has focus, tab change focus to the filter. I think it should change to class list. For some reasons it is possible to escape the filter input by pressing shift+tab, but not by pressing tab. So I wanted to try to change the âtab" order. Thanks, Jura El 26-12-2013, a las 16:34, GOUBIER Thierry <thierry.goubier@cea.fr> escribió:
Hi Jura,
it's implemented at the Morphic level; it follow the chain of owners / submorphs and should correctly tab to all morphs in the window, except when going through text fields which will catch the tab for themselves (but Ctrl+tab should work).
To change the order, you may have a look at the order in which the morphs are added to the window.
Another thing which may be of interest to you, Spec has the necessary code to override the default Morphic tab navigation and force an application defined order.
What is the issue you are facing ?
Thierry ________________________________________ De : Pharo-dev [pharo-dev-bounces@lists.pharo.org] de la part de Juraj Kubelka [juraj.kubelka@gmail.com] Date d'envoi : jeudi 26 décembre 2013 17:09 à : Pharo Development List Objet : [Pharo-dev] Nautilus: tab key change focus
Hi,
Can someone give me any glue how tab-key-order and handling works in Nautilus? I am trying to fix the tab order in Nautilus but I do not see how it is implemented.
Thanks, Jura
Thanks for the advice. I have just tried to add my own key stroke handling and I face interesting issue. The first time I enter the package filter input field, everything works. When I press down-key, it change focus to package list. But since then whenever I enter again the filter, any key stroke change the focus back to package list. I do not see any glue right now. The code is like this: buildPackageSearch "It is an search dialog which filters package list" searchWidget := SearchMorph new model: self; updateSelector: #packageSearchUpdate:; ghostText: 'Type: Pkg1|^Pkg2|Pk.*Core$'; list: SharedValueHolder instance; useSelectionIndex: false; setIndexSelector: #packageSearchUpdate:; keystrokeSelector: #packageSearchKeyStroke:; yourself. ^ searchWidget packageSearchKeyStroke: anEvent (anEvent keyCharacter = Character arrowDown) ifTrue: [ self giveFocusToPackage. ^ true ]. ^ false Thanks. Jura El 26-12-2013, a las 19:35, GOUBIER Thierry <thierry.goubier@cea.fr> escribió:
Have you tried Ctrl+Tab in the filter? I remember that text fields would catch the tab for themselves, and probably shift+tab as well, but we could force that filter to switch by using an onKeyCombination: Character tab asKeyCombination do: [ "setFocusToPackageListMorph" ] on the filter.
With this asKeyCombination: do: , we could also change the order for the Package list and the class list (or just make sure the filter is added to the main window before the package list). If you change the order by hand, make sure you also correct the reverse order as well (Shift+tab and Ctrl+Shift+tab).
I can't have a look at the code right now :(
Thierry
________________________________________ De : Pharo-dev [pharo-dev-bounces@lists.pharo.org] de la part de Juraj Kubelka [juraj.kubelka@gmail.com] Date d'envoi : jeudi 26 décembre 2013 20:42 à : Pharo Development List Objet : Re: [Pharo-dev] Nautilus: tab key change focus
Hi Thierry,
thank you. Actually I have started with an issue with package filter input. When it has a focus, there is no way to change a focus with key press. Like tab, or down arrow key, or anything. And I also find out the tab order is strange. When package list has focus, tab change focus to the filter. I think it should change to class list.
For some reasons it is possible to escape the filter input by pressing shift+tab, but not by pressing tab. So I wanted to try to change the âtab" order.
Thanks, Jura
El 26-12-2013, a las 16:34, GOUBIER Thierry <thierry.goubier@cea.fr> escribió:
Hi Jura,
it's implemented at the Morphic level; it follow the chain of owners / submorphs and should correctly tab to all morphs in the window, except when going through text fields which will catch the tab for themselves (but Ctrl+tab should work).
To change the order, you may have a look at the order in which the morphs are added to the window.
Another thing which may be of interest to you, Spec has the necessary code to override the default Morphic tab navigation and force an application defined order.
What is the issue you are facing ?
Thierry ________________________________________ De : Pharo-dev [pharo-dev-bounces@lists.pharo.org] de la part de Juraj Kubelka [juraj.kubelka@gmail.com] Date d'envoi : jeudi 26 décembre 2013 17:09 à : Pharo Development List Objet : [Pharo-dev] Nautilus: tab key change focus
Hi,
Can someone give me any glue how tab-key-order and handling works in Nautilus? I am trying to fix the tab order in Nautilus but I do not see how it is implemented.
Thanks, Jura
Hi Jura, I had a short look (kind of hard at the moment) and I noticed that Ctrl+tab was working to switch the focus around correctly, but maybe in an incorrect order. This could be fixed by adding the morphs at creation time in a different order. However, Ctrl+Shift+Tab wasn't working :( And tab has no effect in the filter (neither focus change nor text input). Your solution is a bit heavy handed for me, I was thinking of something more like: searchWidget onKeyCombination: Character tab asKeyCombination do: [self giveFocusToPackage]. Don't forget that, as you're touching the focus tab order, you have a duty to make it complete (i.e. all widgets can be tabbed to starting from any widget). Thierry ________________________________ De : Pharo-dev [pharo-dev-bounces@lists.pharo.org] de la part de Juraj Kubelka [juraj.kubelka@gmail.com] Date d'envoi : vendredi 27 décembre 2013 18:49 à : Pharo Development List Objet : Re: [Pharo-dev] Nautilus: tab key change focus Thanks for the advice. I have just tried to add my own key stroke handling and I face interesting issue. The first time I enter the package filter input field, everything works. When I press down-key, it change focus to package list. But since then whenever I enter again the filter, any key stroke change the focus back to package list. I do not see any glue right now. The code is like this: buildPackageSearch "It is an search dialog which filters package list" searchWidget := SearchMorph new model: self; updateSelector: #packageSearchUpdate:; ghostText: 'Type: Pkg1|^Pkg2|Pk.*Core$'; list: SharedValueHolder instance; useSelectionIndex: false; setIndexSelector: #packageSearchUpdate:; keystrokeSelector: #packageSearchKeyStroke:; yourself. ^ searchWidget packageSearchKeyStroke: anEvent (anEvent keyCharacter = Character arrowDown) ifTrue: [ self giveFocusToPackage. ^ true ]. ^ false Thanks. Jura
participants (2)
-
GOUBIER Thierry -
Juraj Kubelka