An invoice list form in a Uniface customer app had grown to about 50 buttons. The people using it every day asked for the keyboard: load the list, book a payment, clear the filters without reaching for the mouse. One constraint: the keyboard translation table and the .ini file stay untouched, because every form and every other application using the same assignment would be affected.

It turned out that most of the work was already done by Uniface. This article shows the four triggers that did the job, the double-click that only worked after the second attempt, and one idea that did not work at all.

Tested with Rocket Uniface 10.4.03 Community Edition (10.4.03.021) on Windows with SQLite, November 2026.

What the keys already send

In the keyboard table of this installation, the function keys are bound to structure editor functions:

Key Structure editor function Component trigger
F2, Ctrl+A ^ACCEPT accept
F3 ^STORE store
F4 ^RETRIEVE retrieve
Shift+F2 ^CLEAR clear
Shift+F3 ^ERASE erase

Check your own table before you rely on this list; bindings can differ between installations.

Each of these functions fires the component trigger with the same name. The list form works on a non-database entity that is filled from a service, so the default behaviour (retrieve from the database, store to the database) is of no use here anyway. Writing the triggers costs nothing and breaks nothing.

Four triggers

trigger retrieve ; F4 call DO_LOAD return 0 end trigger store ; F3 call DO_PAY return 0 end trigger clear ; Shift+F2 call DO_CLEARALL return 0 end trigger erase ; Shift+F3: nothing is deleted from this form INFO.QIN_FTR = "Nothing is deleted here: use Reverse last for payments." return 0 end 

Three decisions behind these few lines:

  • Each trigger calls the same entry as the button. DO_PAY is what the "Record payment" button calls. Validation, questions and messages are identical whether the user clicks or presses F3. A shortcut with its own code path is a second implementation that will drift.
  • erase is blocked on purpose. Shift+F3 sits right next to Shift+F2. A key that reverses a payment one finger away from "clear the filters" is an accident waiting to happen. The trigger only explains where the explicit action is.
  • accept was already there. F2 and Ctrl+A load the list; in a form without a database entity, Ctrl+A would otherwise close the form. See Ctrl+A that saves instead of closing for that part.

DO_CLEARALL resets the form completely, including the component variables the filter uses:

entry DO_CLEARALL $cCust$ = 0 $cTotal$ = "" F_CUST.QIN_HDR = "" CUST_NAME.QIN_HDR = "all customers" F_STATUS.QIN_HDR = "ALL" F_FROM.QIN_HDR = "" F_TO.QIN_HDR = "" F_AMT.QIN_FTR = "" F_PDATE.QIN_FTR = "" F_METHOD.QIN_FTR = "" F_REF.QIN_FTR = "" RESULT.QIN_FTR = "" call RESET_GRID call SHOW_TOTAL INFO.QIN_FTR = "Filters and list cleared." return 0 end 

Telling the user

Shortcuts nobody knows about do not exist. A "Keys" button writes the overview into the multi-line result field. %%^ is the line break in a ProcScript string:

entry DO_KEYS RESULT.QIN_FTR = "Keys in Quick invoices:%%^F2 or Ctrl+A, F4 = Load the list%%^F3 = Record payment for the current row%%^Shift+F2 = Clear filters and list%%^Shift+F3 = nothing is deleted (use Reverse last)%%^Double-click on the invoice number = Invoice info, on the customer field = Statement" INFO.QIN_FTR = "Keyboard shortcuts shown below." return 0 end 

The first version was one long line, and the field cut it off at the right edge. The second version had one key per line, and in a second form the result field showed six lines while the text had seven. The hidden line was the one about double-click. Count the visible lines of the field and write the text for them.

What did not work: & in a runtime button label

The button texts in these forms are assigned in ProcScript when the form starts (BTN_PAY.QIN_FTR = "Record payment"). The obvious idea for Alt shortcuts was "&Record payment". The result: the ampersand was displayed as a character, and Alt+R did nothing. I did not test whether a label painted in the form definition behaves differently; for runtime labels in this setup, the ampersand is just text. The function keys above made the Alt shortcuts unnecessary.

Double-click: the trigger alone is not enough

The plan: double-click on an invoice number shows the invoice details, double-click on the customer field shows the account statement. The field script got a detail trigger:

trigger detail call DO_INFO return 0 end 

Compiled with 0 errors. In the running form, a double-click selected the text in the field and nothing else happened.

The widget property Double-Click (DblClk) decides what a double-click does in an edit box. The default selects a word; with the value Detail it fires the detail trigger. The property can be set at runtime.

For a field in the header, once is enough, for example in exec:

operation exec $fieldproperties(F_CUST.QIN_HDR) = "DblClk=Detail" call SET_LABELS ... 

For a field in a grid, it is not. Field properties set with $fieldproperties belong to an occurrence. Set once in exec, the property applies to the first row only; every row created later behaves like the default. The form already had an entry that prepares each new row (it makes the display columns read-only), and the load loop calls it after every creocc:

entry SETUP_ROW $fieldproperties(L_NO.QIN_LIN) = "DblClk=Detail" ; field properties are set per occurrence $fieldsyntax(L_ID.QIN_LIN) = "NED" $fieldsyntax(L_NO.QIN_LIN) = "NED" ... return 0 end 
 clear/e "QIN_LIN" forlist vRow in vData creocc "QIN_LIN", -1 call SETUP_ROW ... 

With that line the double-click works in every row, including on L_NO, which is read-only (NED): the field cannot be edited, but it still takes the double-click.

Test in the running application, and restart it

Every step above compiled without errors, including the versions that did nothing. Only a click test showed the difference. What I checked in the running form: F4 with and without a customer filter, F3 on a payable and on a paid invoice, Shift+F2, Shift+F3, the Keys text, double-click on the first, second and last row, and double-click on the header field.

One more trap during these tests: after importing and compiling a new version of the form, the application that was still running showed the old version, even after closing and reopening the form. Only a restart of the application loaded the new one. When a fix "does not work", check first that you are looking at it.

Summary

  • F2/Ctrl+A, F3, F4, Shift+F2 and Shift+F3 already fire accept, store, retrieve, clear and erase. In a form on a non-database entity, these triggers are free for shortcuts.
  • Call the same entry as the button. Block keys that would be destructive.
  • Show the shortcuts in the form, and fit the text to the visible lines of the field.
  • & in a button label assigned at runtime is displayed literally.
  • Double-click fires detail only with DblClk=Detail. In a grid, set it for every new occurrence, not once in exec.
  • Compile results say nothing about shortcuts. Test each one in the running application, after a restart.