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.
• Defining Key Trigger and their Uses
• Characteristics of Key Triggers
• Types of Key Triggers
• Associate Function Keys with Interface Controls
• What is a key trigger?
Using a Key-Exit trigger display an Alert, If user selects Yes. Exit the
‘Do you really want to leave the form?’);
IF SHOW_ALERT(‘exit_alert’) = ALERT_BUTTON1 THEN
Characteristics of Key Triggers
• You cannot redefine all function keys with
• 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.
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
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
Specific Uses of Key Triggers
• Call an LOV form
• Check for detail records before deleting a
• Prevent duplication of the primary key
• Adjust toolbar buttons for Enter Query mode
Associating with other Interface Controls
• DO_KEY(’Key-Exit’) gives run-time
• Corresponding interface control
In When-Button-Pressed and Menu item code:
• Define key triggers in order to
– enhance keyboard functionality
– replace keyboard key
• Provide consistent functionality between
Function keys, buttons, menu items, and
• Define Key-Fn, Key-Others, and mouse-event key triggers