How do I make the Enter key behave as a Tab key

Linux specific forum
thierry94
User
User
Posts: 14
Joined: Mon Oct 08, 2007 12:37 pm
Location: france

How do I make the Enter key behave as a Tab key

Post by thierry94 »

Hi,

How do I make the Enter key behave as a Tab key in all gadgets ?


Thanks.
IdeasVacuum
Always Here
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

Post by IdeasVacuum »

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:

Code: Select all

AddKeyboardShortcut(#MyWindow,#VK_RETURN,#KeyEnter)
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).
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
thierry94
User
User
Posts: 14
Joined: Mon Oct 08, 2007 12:37 pm
Location: france

Re: How do I make the Enter key behave as a Tab key

Post by thierry94 »

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
IdeasVacuum
Always Here
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

Post by IdeasVacuum »

........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.
thierry94
User
User
Posts: 14
Joined: Mon Oct 08, 2007 12:37 pm
Location: france

Re: How do I make the Enter key behave as a Tab key

Post by thierry94 »

For information

gtk_widget_child_focus_(gtk_widget_get_toplevel_(GadgetID(GetActiveGadget())), #GTK_DIR_TAB_FORWARD)
Post Reply