Key triggers in Oracle Forms are used to define and enhance keyboard functionality. Key triggers can be defined at different levels and can contain built-in functions to execute actions like committing records or exiting forms. Common types of key triggers include function key triggers, Key-Fn triggers, Key-Others triggers, and mouse-event key triggers. Key triggers provide consistent functionality across function keys, buttons, menus, and mouse events.
2. Objectives
• Defining Key Trigger and their Uses
• Characteristics of Key Triggers
• Types of Key Triggers
• Associate Function Keys with Interface Controls
http://ebiztechnics.blogspot.com
3. Key Trigger
• What is a key trigger?
• Example:
Using a Key-Exit trigger display an Alert, If user selects Yes. Exit the
form.
SET_ALERT_PROPERTY(‘exit_alert’,
ALERT_MESSAGE_TEXT,
‘Do you really want to leave the form?’);
IF SHOW_ALERT(‘exit_alert’) = ALERT_BUTTON1 THEN
EXIT_FORM;
END IF;
http://ebiztechnics.blogspot.com
4. Characteristics of Key Triggers
• You cannot redefine all function keys with
key triggers.
• Key triggers are defined at all three levels.
• A key trigger can contain SELECT statements and all built-ins.
• Key triggers can fire in Enter Query mode.
http://ebiztechnics.blogspot.com
6. Types of Key Triggers
• Function key triggers
• Key-Fn triggers and Oracle Terminal
• Key-Others triggers
• Oracle Terminal Used for mapping keys.
• Key mappings are done in following Resource files:
– Client/Server FMRUSW.RES
– Web mode FMRWEB.RES
http://ebiztechnics.blogspot.com
8. Using Key Triggers
• Adjust user interface
• Disable a (set of) function keys
• Replace or extend functionality of function keys
• Add additional function keys
• Be careful with Key-Others
• Do not use for validation
http://ebiztechnics.blogspot.com
9. Specific Uses of Key Triggers
• Call an LOV form
• Check for detail records before deleting a
master record
• Prevent duplication of the primary key
• Adjust toolbar buttons for Enter Query mode
http://ebiztechnics.blogspot.com
10. Associating with other Interface Controls
• DO_KEY(’Key-Exit’) gives run-time
error
• Corresponding interface control
descriptions
In When-Button-Pressed and Menu item code:
DO_KEY(‘EXIT_FORM’);
http://ebiztechnics.blogspot.com
11. Summary
• Define key triggers in order to
– enhance keyboard functionality
– replace keyboard key
• Provide consistent functionality between
Function keys, buttons, menu items, and
mouse events
• Define Key-Fn, Key-Others, and mouse-event key triggers
http://ebiztechnics.blogspot.com
Editor's Notes
What is a key trigger?
A key trigger, like any other trigger, is a subprogram that is executed when a
Certain event occurs. In the case of a key trigger, the event is pressing the
Function key for which the trigger is defined. The trigger is usually named after
The event that causes it to fire. When the key trigger is defined for a function
Key, the usual functionality of the key is replaced by the PL/SQL text of the
Trigger. In respect, key triggers resemble “on triggers”.
Note: If you also want to execute the default functionality of the function
Key, you must ensure that the key trigger includes the built-in function
Associated with the key.
Technical Note
Since mouse-event key triggers are not executed when the mouse is used to
Initiate window interaction, you should not place code that needs to be executed
Every time the window interaction occurs in a mouse-event key trigger.