How To Simulate A Key Pressed: Oracle Forms Francois Degrelle
How To Simulate A Key Pressed: Oracle Forms Francois Degrelle
How To Simulate A Key Pressed: Oracle Forms Francois Degrelle
Home page
Sometimes, you need to simulate a keyboard action at runtime, for instance go to the end of the text
in a Text Item, to add information or simply to put the cursor at the end.
Syntax
PROCEDURE Win_Api_Shell.SendKeys
(hWnd IN PLS_INTEGER,
Keys IN VARCHAR2,
Parameters
Target
The Window handle of the window you want to send the keystrokes to. You can get this handle by
using the GET_WINDOW_PROPERTY built-in.
Keystrokes
The keystrokes that you want to send to the window. Use these characters for modifier keys:
Shift = +;
Control = ^;
Alt = %.
{Backspace}
{Break}
{CapsLock}
{Clear}
{Delete}
{End}
{Enter}
{Esc}
{Help}
{Home}
{Insert}
{NumLock}
{PgDown}
{PgUp}
{PrtSc}
{ScrollLock}
{Tab}
{F1} - {F12}
{Up}
{Down}
{Left}
{Right}
RaiseExceptions If TRUE, then if the procedure fails to send or parse the keystrokes, the explicit
PL/SQL exception NO_DATA_FOUND will be raised
Examples:
win_api_shell.sendkeys(get_window_property('WINDOW1',window_handle),'{End}',
TRUE);
Simulate a menu action, for instance : Action -> Exit of the standard menu:
win_api_shell.sendkeys(get_window_property('WINDOW1',window_handle),'%(ae)',
TRUE);
D2KWUTIL download and install
I am not sure that d2kwutil is still reachable from the OTN Forms page, but you can download it
here.