Hi,
How do I make the Enter key behave as a Tab key in all gadgets ?
Thanks.
How do I make the Enter key behave as a Tab key
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: How do I make the Enter key behave as a Tab key
Well, if they are a similar size and shape, you can easily swap them over on your keyboard............
Could it be that you want the focus to move to the next (string) Gadget when the Enter Key is hit in the current one? If so, detect the Enter Key, then use SetActiveGadget(#Gadget).
Add a short cut to the Procedure that defines your app window:
If this is just for your own use of course it's absolutely fine, but others might find the behaviour to be unexpected.
Edit: I do not know if the above short cut code would work in Linux, #VK_RETURN is definitely Windows and needs to be replaced by the Linux equivalent (if it exists).
Could it be that you want the focus to move to the next (string) Gadget when the Enter Key is hit in the current one? If so, detect the Enter Key, then use SetActiveGadget(#Gadget).
Add a short cut to the Procedure that defines your app window:
Code: Select all
AddKeyboardShortcut(#MyWindow,#VK_RETURN,#KeyEnter)
Edit: I do not know if the above short cut code would work in Linux, #VK_RETURN is definitely Windows and needs to be replaced by the Linux equivalent (if it exists).
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: How do I make the Enter key behave as a Tab key
hi
But how know the next gadget to activate, the window contain 100 gadgets.
I think we should use the APIs to retrieve the list of gadgets in the container, and find the gadget activated and activate the following.
or
trap key enter et send key tab
But how know the next gadget to activate, the window contain 100 gadgets.
I think we should use the APIs to retrieve the list of gadgets in the container, and find the gadget activated and activate the following.
or
trap key enter et send key tab
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: How do I make the Enter key behave as a Tab key
........Simply number the gadgets in the sequence that you feel is most appropriate, then you always know the next gadget since it is the current gadget ID + 1.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: How do I make the Enter key behave as a Tab key
For information
gtk_widget_child_focus_(gtk_widget_get_toplevel_(GadgetID(GetActiveGadget())), #GTK_DIR_TAB_FORWARD)
gtk_widget_child_focus_(gtk_widget_get_toplevel_(GadgetID(GetActiveGadget())), #GTK_DIR_TAB_FORWARD)