5 Replies Latest reply: Aug 6, 2013 9:16 AM by DigitalLogick RSS

    Hotkey into a textbox


      Hello everybody, happy Friday


      Alright, so... I have this form in Forms 10g. It is FULL of info. Multiple records displayed, buttons to open other windows and so on. At the very bottom of the form is a tiny square which is really a text box that pops up when clicked and allows the users to leave personal notes. Basically everything on this form can be navigated to with hot keys. The one thing that can't be selected with a hot key is the tiny comment box. Unfortunately, simply using tab to navigate to it is out of the question because the tab button is used to swap between multiple windows that need to be open for this form. I've mapped hot keys to buttons all over the thing with '&Letter' in their labels, but that doesn't seem to work for text items.


      Does anyone know if hot keys can be mapped to an individual text box on a particular form?

        • 1. Re: Hotkey into a textbox

          Hello, I think You Should use triggers at focus in text item..Hope helpfull..

          • 2. Re: Hotkey into a textbox
            Michael Ferrante-Oracle

            Since text fields don't have "labels", you can't do hotkeys as you described.  I assume you want to navigate to the text field upon pressing a particular key.  You could do this by remapping a set of keys.  Then create the appropriate trigger where you would do something like a GO_ITEM.  So for example, go into fmrweb.res (ORACLE_HOME\forms) and add this:


            #120  : 3 : "Shift+Ctrl+F9"  : 91 : "Function 9"
            90   : 2 : "Ctrl+Z"         : 91 : "Function 9"


            Comment any other entries that use function 91 (91 is the Forms KEY-F9 trigger) as I did above.


            In your form, at the Module (form) level, create a KEY-F9 trigger.  In that trigger, add something like:


            GO_ITEM ('someBlock.someTextField');


            Now when you run the form and press Ctrl+Z, focus should move to that text field.

            • 3. Re: Hotkey into a textbox

              Unfortunately, that doesn't seem to be an option. The function keys and alternate function keys are already used.


              Is there a way to make the tab key go to the text box if its particular window had focus and then any other tab presses still switch between open windows?

              • 4. Re: Hotkey into a textbox
                Michael Ferrante-Oracle

                Are you saying that all of the KEY-Fx triggers are already used?  I am not talking about the function keys on the keyboard.  These have nothing to do with the KEY-Fx triggers in Forms.  In my example, I showed how you can re-map Ctrl+Z to a Forms KEY-F9 trigger.  Both the keyboard keys and the Forms trigger I chose where just examples.  Carefully read the comments included in fmrweb.res as it explains how to remap almost any key sequences.


                In your case, I don't recommend remapping Tab as for most users, Tab has a very specific function.  But that's just my opinion.  To change what I suggested to use the Tab key simply make this change to my example:


                9   : 0 : "Tab"         : 91 : "Function 9"


                Again, be sure to comment out (use #) any other line that is coded to use this key combination ( 9 : 0 ) already.  Also, my use of the Forms Function 9 is just an example.  There are a total of 10 that can be used.  If in fact, your app does use all of them already, then there will be no other easy way to do what you want.  It may be possible to create a Java Bean that monitors for the Tab, but in my opinion this would be somewhat of a hack.  If you want to consider the bean option, here is one example to get you started.



                • 5. Re: Hotkey into a textbox

                  I meant that all the forms Key-triggers are already used, except for Key-Others. But I believe I have a decent fix. Better than hacking the tab behavior I think. I'm just going to create a button that indicates clicking it allows entry into the pop up text box and map a hot key to that with it's label. Put that button right next to the text box and ... hope the users like it


                  Thanks for the help. I appreciate it!