VpeDefineKey

<< Click to Display Table of Contents >>

Navigation:  Management Functions >

VpeDefineKey

Previous pageReturn to chapter overviewNext page

[Windows platform only; not supported by the Community Edition]

This method allows you to define your own key for each available keyboard function.

void VpeDefineKey(

VpeHandle hDoc,

int function,

int key_code,

int add_key_code1,

int add_key_code2

)

VpeHandle hDoc

Document Handle

int function

All available keyboard functions are enumerated in the VKEY_xyz constants (see below).

int key_code, add_key_code1, add_key_code2

Virtual keycode constants (defined in the Windows SDK) for the keys that need to be pressed at once for the specified function.

Remarks:

A keyboard function can be set to "undefined" = no key is associated with this keyboard function by setting all key codes to zero.

Example:

VpeDefineKey(hDoc, VKEY_CLOSE, VK_ESCAPE, 0, 0)

Defines the key <ESC> to close the preview when pressed.

 

VpeDefineKey(hDoc, VKEY_CLOSE, VK_ESCAPE, VK_SHIFT, 0)

Defines the key pair <SHIFT> + <ESC> to close the preview when pressed.

 

VpeDefineKey(hDoc, VKEY_PRINT, 0, 0, 0)

There is no key associated with the keyboard function VKEY_PRINT.

 

Possible values for the parameter "function" are:

Constant

Value

Default Key(s)

VKEY_SCROLL_LEFT

0

Arrow Left

VKEY_SCROLL_PAGE_LEFT

1

Ctrl-Arrow Left

VKEY_SCROLL_RIGHT

2

Arrow Right

VKEY_SCROLL_PAGE_RIGHT

3

Ctrl-Arrow Right

VKEY_SCROLL_UP

4

Arrow Up

VKEY_SCROLL_PAGE_UP

5

Ctrl-Arrow Up

VKEY_SCROLL_DOWN

6

Arrow Down

VKEY_SCROLL_PAGE_DOWN

7

Ctrl-Arrow Down

VKEY_SCROLL_TOP

8

Pos1

VKEY_SCROLL_BOTTOM

9

End

VKEY_PRINT

10

F2

VKEY_MAIL

11

F3

VKEY_FULL_PAGE

12

Ctrl-Ins

VKEY_PAGE_WIDTH

13

Ctrl-Del

VKEY_ZOOM_IN

14

Ins

VKEY_ZOOM_OUT

15

Del

VKEY_GRID

16

"G"

VKEY_PAGE_FIRST

17

Ctrl-Page Up

VKEY_PAGE_LEFT

18

Page Up

VKEY_PAGE_RIGHT

19

Page Down

VKEY_PAGE_LAST

20

Ctrl-Page Down

VKEY_HELP

21

F1

VKEY_INFO

22

"I"

VKEY_CLOSE

23

<not defined>

VKEY_GOTO_PAGE

24

ENTER

VKEY_OPEN

25

Ctrl-O

VKEY_SAVE

26

Ctrl-S

VKEY_ESCAPE

27

Esc

 

See Also:

VpeSendKey