Customizing Keymapping and Resource Files for Forms on the Web -fmrweb.res, fmrpcweb.res

Customizing Keymapping and Resource Files for Forms on the Web -fmrweb.res, fmrpcweb.res

Customizing Keymapping and Resource Files for Forms on the Web -fmrweb.res, fmrpcweb.res

Titleimage

Posted by Patrick Hamou on 2017:09:06 14:38:11

APPLIES TO:

Oracle Forms - Version 6.0.8.26.0 and later
Information in this document applies to any platform.
***Checked for relevance on 02-Jan-2014*** 
Checked for relevance on 09-Aug-2015

Applies to all version of Forms on the web from Forms 6i through Forms 11g. Note that some differences in key mappings may differ depending on the version.

GOAL

Describes how key mapping works with Forms on the Web and how keys and functions can be re-mapped.

SOLUTION

For forms on the web, an editable text file is used to specify key mappings. Oracle Terminal is no longer used. The resource key mappings used are actually in memory. By default, these mappings reflect the mappings in the fmrweb.res. This file does NOT reflect the earlier MS Windows client-server keyboard mappings. Rather it reflects the key mapping if running client-server on Unix X-Windows/ Motif. The fmrweb.res and other resource files can be found as follows:

10gR2

UNIX -> ORACLE_HOME/forms/admin/resource/<country>/fmrweb.res
Windows -> ORACLE_HOME\forms\fmrweb.res

11g

UNIX -> ORACLE_INSTANCE/config/FormsComponent/forms/admin/resource/<country>/fmrweb.res
Windows -> ORACLE_INSTANCE\config\FormsComponent\forms\fmrwebs.res


A file called fmrpcweb.res has been provided which contains MS Windows client-server keyboard mappings. To use this file, you may:

a. Specify fmrpcweb.res in the term parameter in the url. For example, http://machine.domain:port/forms/frmservlet?term=<path to file>/fmrpcweb.res
b. Specify fmrpcweb.res in the formsweb.cfg. For example, term=<path to file>/fmrpcweb.res

Note: If running with different NLS_LANG settings a different resource file will be used. For example, if NLS_LANG=GERMAN_GERMANY=WE8ISO8859P1 then fmrwebd.res file will be used.  There is a resource file for each supported language.


Customizing the Resource file
------------------------------
Since the resource files are text, any of them may be customized using a standard text editor such as notepad, vi, etc.  The text file contains documentation and is relatively self explanatory.

Note: Customization are limited, particularly compared to character mode forms.
Also, to ensure that the correct resource file is being used, specify it using the term parameter as explained above.



Here is the contents of the fmrweb.res file with some additional comments added for further clarification.

# FMRWEB.RES is the key definition file for webforms. The syntax is:
#
# JFN : JMN : URKS : FFN : URFD (whitespace ignored)
#
# JFN = Java function number - This corresponds to a key on the windows PS/2 keyboard
# JMN = Java modifiers number - Specifies additional key(s) required to be pressed along with the JFN key.
# URKS = User-readable key sequence (double-quoted) - Used to display the key(s) corresponding to the function.
# FFN = Forms function number - Number internally coded to a specific forms function such as "Enter-query", "Execute-query",etc.
# URFD = User-readable function description (double-quoted) - Used to display the function that Forms will perform when the specified key is pressed
#
# JAVA FUNCTION NUMBER
# 33 = PageUp
# 34 = PageDown
# 35 = End
# 36 = Home
# 37 = LeftArrow
# 38 = UpArrow
# 39 = RightArrow
# 40 = DownArrow
# 65 - 90 = Ctrl+A thru Ctrl+Z (These will always have the control
# modifier explicitly included, as well as any other
# modifiers that might be used.)
# 112 - 123 = F1 thru F12
# 9 = Tab (Ctrl+I, without the control modifier)
# 10 = Return (Ctrl+J, without the control modifier)
#
# JAVA MODIFIERS NUMBER
# Equal to the sum of the values for the modifier keys:
# 0 = None
# 1 = Shift
# 2 = Control
# 4 = Meta - This refers to the windows logo key between the Ctrl and Alt key and currently cannot be mapped
# 8 = Alt

# Note that 3 corresponds to Shift + Control. 9 would correspond to Shift + Alt
#
# FORMS FUNCTION NUMBER
# The Forms function numbers match the function numbers found in a typical Forms key binding file.
#
# USER-READABLE STRINGS 
# The double-quoted strings appear when users click [Show Keys], and
# are used for this purpose only. These strings can be translated as
# needed. Note that the strings do not affect what actually happens
# when end users press a particular key sequence.
#
9   : 0 : "Tab"            : 1 : "Next Field"
9   : 1 : "Shift+Tab"      : 2 : "Previous Field"
116 : 0 : "F5"             : 3 : "Clear Field"
38  : 0 : "Up"             : 6 : "Up"
40  : 0 : "Down"           : 7 : "Down"
33  : 0 : "PageUp"         : 12 : "Scroll Up"
34  : 0 : "PageDown"       : 13 : "Scroll Down"
69  : 2 : "Ctrl+E"         : 22 : "Edit"
10  : 0 : "Return"         : 27 : "Return"
76  : 2 : "Ctrl+L"         : 29 : "List of Values"
115 : 0 : "F4"             : 32 : "Exit"
75  : 2 : "Ctrl+K"         : 35 : "Show Keys"
83  : 2 : "Ctrl+S"         : 36 : "Commit"
118 : 1 : "Shift+F7"       : 61 : "Next Primary Key"
117 : 0 : "F6"             : 62 : "Clear Record"
38  : 2 : "Ctrl+Up"        : 63 : "Delete Record"
117 : 1 : "Shift+F6"       : 64 : "Duplicate Record"
40  : 2 : "Ctrl+Down"      : 65 : "Insert Record"
119 : 1 : "Shift+F8"       : 66 : "Next Set of Records"
1005: 0 : "Down"           : 67 : "Next Record"
1004: 0 : "Up"             : 68 : "Previous Record"
118 : 0 : "F7"             : 69 : "Clear Block"
66  : 2 : "Ctrl+B"         : 70 : "Block Menu"
34  : 1 : "Shift+PageDown" : 71 : "Next Block"
33  : 1 : "Shift+PageUp"   : 72 : "Previous Block"
116 : 1 : "Shift+F5"       : 73 : "Duplicate Field"
119 : 0 : "F8"             : 74 : "Clear Form"
122 : 0 : "F11"            : 76 : "Enter Query"
122 : 2 : "Ctrl+F11"       : 77 : "Execute Query"
69  : 3 : "Shift+Ctrl+E"   : 78 : "Display Error"
80  : 2 : "Ctrl+P"         : 79 : "Print"
123 : 0 : "F12"            : 80 : "Count Query"
85  : 2 : "Ctrl+U"         : 81 : "Update Record"
121 : 3 : "Shift+Ctrl+F10" : 82 : "Function 0"
112 : 3 : "Shift+Ctrl+F1"  : 83 : "Function 1"
113 : 3 : "Shift+Ctrl+F2"  : 84 : "Function 2"
114 : 3 : "Shift+Ctrl+F3"  : 85 : "Function 3"
115 : 3 : "Shift+Ctrl+F4"  : 86 : "Function 4"
116 : 3 : "Shift+Ctrl+F5"  : 87 : "Function 5"
117 : 3 : "Shift+Ctrl+F6"  : 88 : "Function 6"
118 : 3 : "Shift+Ctrl+F7"  : 89 : "Function 7"
119 : 3 : "Shift+Ctrl+F8"  : 90 : "Function 8"
120 : 3 : "Shift+Ctrl+F9"  : 91 : "Function 9"
113 : 0 : "F2"             : 95 : "List Tab Pages"
72  : 2 : "Ctrl+H"         : 30 : "Help"

 

NOTE: Always ensure you have a backup copy of the original resource file you are modifying whether it be fmrweb.res, fmrpcweb.res, or another one. The examples here assume you are modifying the fmrweb.res file.



Examples
=========

Reversing the Enter and Execute function mappings:


122 : 0 : "F11" : 76 : "Enter Query"
122 : 2 : "Ctrl+F11" : 77 : "Execute Query"

Change to:

122 : 2 : "Ctrl+F11" : 76 : "Enter Query"
122 : 0 : "F11" : 77 : "Execute Query"


Exceptions/ Special Key Mappings 
--------------------------------------------------

A: Mapping F2

Change the default entry for F2, "List Tab Pages", to another key. 

Here is an example of the default entry:
113: 0 : "F2" : 95 : "List Tab Pages"

This must be explicitly changed to another key mapping such as the following:
113: 8 : "F2" : 95 : "List Tab Pages"

To map the F2 function to the F2 key, comment out the lines that begin with "113 : 0" and "113 : 8" with a # symbol and add the following lines to the bottom of the resource file.

113: 0 : "F2" : 84 : "Function 2"
113: 8 : " " : 95 : " "

Explanation:

A new function has been added which uses F2 by default. It is necessary to explicitly map this new function to something else in order to map the F2 key. This function was added to allow for keyboard navigation between the tab canvas pages and it defaults to F2. 
Even if it is commented out and not assigned to F2, the F2 key cannot be mapped unless this function, Forms Function Number 95, is mapped to another key.


B: Mapping for ENTER to fire KEY-ENTER-TRIGGER over the Web

By default, whether deploying client-server or over the web, pressing the ENTER key takes the cursor to the next navigable item in the block. To override this default behavior it is necessary to modify the forms resource file to revise the key mapping details.

Modify the appropriate resource file. In this example we are using fmrweb.res and change the Forms Function Number (FFN) from 27 to 75 for the Return Key. The line should be changed to the following:

10 : 0 : "Return" : 75 : "Return"

By default, the line is displayed with an FFN of 27 and looks as follows:

10 : 0 : "Return" : 27 : "Return"

This line should NOT fire the Key-Enter trigger since the Return or Enter key is actually returning the Return function represented by the FFN of 27. The FFN of 75 represents the Enter function and will fire the Key-Enter trigger.


C: Number Keys

The objective is to map CTRL+<number> keys in fmrweb.res for numbers 0 to 9. There are no Java Function keys mentioned for the numbers in fmrweb.res so they have been listed at the bottom of this note:

This example shows how to map CTRL+1 to 'Next Record'


(1) From the Java Function Number Value list below, note that VK_1,  corresponds to the keyboard "1" key.  The decimal reference for this key is 49.
(2) Use this decimal value to map the number key 1 in fmrweb.res. For example, CTRL+1 can be mapped to 'Next Record' as:

49 : 2 : "CTRL+1" : 67 : "Next Record"

D: Customizing a Keystroke to a Particular Pre-migration Behavior

Migrating your forms application may require to keep a specific key stroke to some behavior that is no longer available out of the box in the newer release.

This may require performing some custom code that could eventually be placed in a KEY-FN trigger activated by your specific keystroke. (FFN 82 through 91)


E: Mapping for Esc Key to exit a Web Form

27 : 0 : "Esc" : 32 : "Exit" 

Ensure that you comment or delete the old entry

#115 : 0 : "F4" : 32 : "Exit"

The first number (115) might differ on different versions or platforms.

When you run the Web Form and press the Esc key the Form will exit.


Java Function Number Values
===========================
The following Java Function Number Values (corresponding to keyboard keys) were derived from Oracle Terminal in order to present a more complete list than fmrwerb.res and other resource files contain. Use the decimal value when specifying the key.

Note that all listed keys may not be able to be mapped.

 


Key and Hex Value                                      Decimal Value

public static final int VK_ENTER = '\n'; 
public static final int VK_BACK_SPACE = '\b'; 
public static final int VK_TAB = '\t'; 
public static final int VK_CANCEL = 0x03;                   3 
public static final int VK_CLEAR = 0x0C;                    12 
public static final int VK_SHIFT = 0x10;                    16
public static final int VK_CONTROL = 0x11;                  17            
public static final int VK_ALT = 0x12;                      18 
public static final int VK_PAUSE = 0x13;                    19
public static final int VK_CAPS_LOCK = 0x14;                20 
public static final int VK_ESCAPE = 0x1B;                   27
public static final int VK_SPACE = 0x20;                    32
public static final int VK_PAGE_UP = 0x21;                  33
public static final int VK_PAGE_DOWN = 0x22;                34
public static final int VK_END = 0x23;                      35
public static final int VK_HOME = 0x24;                     36
public static final int VK_LEFT = 0x25;                     37
public static final int VK_UP = 0x26;                       38
public static final int VK_RIGHT = 0x27;                    39
public static final int VK_DOWN = 0x28;                     40
public static final int VK_COMMA = 0x2C;                    44
public static final int VK_PERIOD = 0x2E;                   46
public static final int VK_SLASH = 0x2F;                    47

Keyboard 0-9 keys

public static final int VK_0 = 0x30;                        48
public static final int VK_1 = 0x31;                        49
public static final int VK_2 = 0x32;                        50
public static final int VK_3 = 0x33;                        51
public static final int VK_4 = 0x34;                        52
public static final int VK_5 = 0x35;                        53
public static final int VK_6 = 0x36;                        54
public static final int VK_7 = 0x37;                        55
public static final int VK_8 = 0x38;                        56
public static final int VK_9 = 0x39;                        57

public static final int VK_SEMICOLON = 0x3B;                59
public static final int VK_EQUALS = 0x3D;                   61

Keyboard a - z keys

public static final int VK_A = 0x41;                        65 
public static final int VK_B = 0x42;                        66
public static final int VK_C = 0x43;                        67
public static final int VK_D = 0x44;                        68
public static final int VK_E = 0x45;                        69
public static final int VK_F = 0x46;                        70
public static final int VK_G = 0x47;                        71
public static final int VK_H = 0x48;                        72
public static final int VK_I = 0x49;                        73
public static final int VK_J = 0x4A;                        74
public static final int VK_K = 0x4B;                        75
public static final int VK_L = 0x4C;                        76
public static final int VK_M = 0x4D;                        77
public static final int VK_N = 0x4E;                        78
public static final int VK_O = 0x4F;                        79
public static final int VK_P = 0x50;                        80
public static final int VK_Q = 0x51;                        81
public static final int VK_R = 0x52;                        82
public static final int VK_S = 0x53;                        83
public static final int VK_T = 0x54;                        84
public static final int VK_U = 0x55;                        85
public static final int VK_V = 0x56;                        86
public static final int VK_W = 0x57;                        87
public static final int VK_X = 0x58;                        88
public static final int VK_Y = 0x59;                        89
public static final int VK_Z = 0x5A;                        90

public static final int VK_OPEN_BRACKET = 0x5B;             91
public static final int VK_BACK_SLASH = 0x5C;               92
public static final int VK_CLOSE_BRACKET = 0x5D;            93
public static final int VK_NUMPAD0 = 0x60;                  96
public static final int VK_NUMPAD1 = 0x61;                  97
public static final int VK_NUMPAD2 = 0x62;                  98
public static final int VK_NUMPAD3 = 0x63;                  99
public static final int VK_NUMPAD4 = 0x64;                  100
public static final int VK_NUMPAD5 = 0x65;                  101
public static final int VK_NUMPAD6 = 0x66;                  102
public static final int VK_NUMPAD7 = 0x67;                  103
public static final int VK_NUMPAD8 = 0x68;                  104
public static final int VK_NUMPAD9 = 0x69;                  105
public static final int VK_MULTIPLY = 0x6A;                 106 
public static final int VK_ADD = 0x6B;                      107
public static final int VK_SEPARATER = 0x6C;                108
public static final int VK_SUBTRACT = 0x6D;                 109
public static final int VK_DECIMAL = 0x6E;                  110
public static final int VK_DIVIDE = 0x6F;                   111

F1 - F12

public static final int VK_F1 = 0x70;                       112
public static final int VK_F2 = 0x71;                       113
public static final int VK_F3 = 0x72;                       114
public static final int VK_F4 = 0x73;                       115
public static final int VK_F5 = 0x74;                       116
public static final int VK_F6 = 0x75;                       117
public static final int VK_F7 = 0x76;                       118
public static final int VK_F8 = 0x77;                       119
public static final int VK_F9 = 0x78;                       120
public static final int VK_F10 = 0x79;                      121
public static final int VK_F11 = 0x7A;                      122
public static final int VK_F12 = 0x7B;                      123

public static final int VK_DELETE = 0x7F;                   127 /* ASCII DEL */ 
public static final int VK_NUM_LOCK = 0x90;                 144
public static final int VK_SCROLL_LOCK = 0x91;              145
public static final int VK_PRINTSCREEN = 0x9A;              154
public static final int VK_INSERT = 0x9B;                   155
public static final int VK_HELP = 0x9C;                     156
public static final int VK_META = 0x9D;                     157
public static final int VK_BACK_QUOTE = 0xC0;               192
public static final int VK_QUOTE = 0xDE;                    222

REFERENCES

NOTE:209671.1 - How to Change / Customize the Key Mappings for Webforms?
NOTE:66534.1 - Java Function Numbers And Key Mappings For Forms Deployed Over Web

Posted by Patrick Hamou on 2017:09:06 14:38:11

Return to Blog