<< Click to Display Table of Contents >> DefineKey |
[GUI Control Only, not supported by the Community Edition]
This method allows you to define your own key for each available keyboard function.
method void VPE.DefineKey(
KeyFunction [long] Function,
Keys [long] KeyCode,
Keys [long] AddKeyCode1,
Keys [long] AddKeyCode2
)
KeyFunction [long] Function
All available keyboard functions are enumerated in the VKEY_xyz constants (see below).
Keys [long] KeyCode, AddKeyCode1, AddKeyCode2
Virtual keycode constants (defined in the Windows SDK) for the keys that need to be pressed at once for the specified function. Add-on keys like Ctrl, Alt and Shift may not be used in the parameter KeyCode, use these key codes in the parameters AddKeyCode1 or AddKeyCode2.
Remarks:
A keyboard function can be set to "undefined" = no key is associated with this keyboard function by setting all key code parameters to zero.
Example:
Active X / VCL:
Doc.DefineKey(VKEY_CLOSE, VK_ESCAPE, 0, 0)
Defines the key <ESC> to close the preview when pressed.
Doc.DefineKey(VKEY_CLOSE, VK_ESCAPE, VK_SHIFT, 0)
Defines the key pair <SHIFT> + <ESC> to close the preview when pressed.
Doc.DefineKey(VKEY_PRINT, 0, 0, 0)
There is no key associated with the keyboard function VKEY_PRINT.
.NET:
Doc.DefineKey(KeyFunction.Close, Keys.Escape, 0, 0)
Defines the key <ESC> to close the preview when pressed.
Doc.DefineKey(KeyFunction.Close, Keys.Escape, Keys.ShiftKey, 0)
Defines the key pair <SHIFT> + <ESC> to close the preview when pressed.
Doc.DefineKey(KeyFunction.Print, 0, 0, 0)
There is no key associated with the keyboard function "Print".
Possible values for the parameter "Function" are:
Constant |
Value |
Enum |
Default Key(s) |
VKEY_SCROLL_LEFT |
0 |
ScrollLeft |
Arrow Left |
VKEY_SCROLL_PAGE_LEFT |
1 |
ScrollPageLeft |
Ctrl-Arrow Left |
VKEY_SCROLL_RIGHT |
2 |
ScrollRight |
Arrow Right |
VKEY_SCROLL_PAGE_RIGHT |
3 |
ScrollPageRight |
Ctrl-Arrow Right |
VKEY_SCROLL_UP |
4 |
ScrollUp |
Arrow Up |
VKEY_SCROLL_PAGE_UP |
5 |
ScrollPageUp |
Ctrl-Arrow Up |
VKEY_SCROLL_DOWN |
6 |
ScrollDown |
Arrow Down |
VKEY_SCROLL_PAGE_DOWN |
7 |
ScrollPageDown |
Ctrl-Arrow Down |
VKEY_SCROLL_TOP |
8 |
ScrollTop |
Pos1 |
VKEY_SCROLL_BOTTOM |
9 |
ScrollBottom |
End |
VKEY_PRINT |
10 |
F2 |
|
VKEY_MAIL |
11 |
F3 |
|
VKEY_FULL_PAGE |
12 |
FullPage |
Ctrl-Ins |
VKEY_PAGE_WIDTH |
13 |
PageWidth |
Ctrl-Del |
VKEY_ZOOM_IN |
14 |
ZoomIn |
Ins |
VKEY_ZOOM_OUT |
15 |
ZoomOut |
Del |
VKEY_GRID |
16 |
Grid |
"G" |
VKEY_PAGE_FIRST |
17 |
PageFirst |
Ctrl-Page Up |
VKEY_PAGE_LEFT |
18 |
PageLeft |
Page Up |
VKEY_PAGE_RIGHT |
19 |
PageRight |
Page Down |
VKEY_PAGE_LAST |
20 |
PageLast |
Ctrl-Page Down |
VKEY_HELP |
21 |
Help |
F1 |
VKEY_INFO |
22 |
Info |
"I" |
VKEY_CLOSE |
23 |
Close |
<not defined> |
VKEY_GOTO_PAGE |
24 |
GotoPage |
ENTER |
VKEY_OPEN |
25 |
Open |
Ctrl-O |
VKEY_SAVE |
26 |
Save |
Ctrl-S |
VKEY_ESCAPE |
27 |
Escape |
Esc |