Define NS_VK keycodes in terms of nsIDOMKeyEvent keycodes. r=saari. Requires undefining ERROR on Win32, r=cmanske

This commit is contained in:
akkana%netscape.com 2000-08-17 21:43:26 +00:00
Родитель ae00b95484
Коммит c07e47ef49
1 изменённых файлов: 125 добавлений и 115 удалений

Просмотреть файл

@ -26,6 +26,14 @@
#include "nsPoint.h"
#include "nsRect.h"
// nsIDOMEvent contains a long enum which includes a member called ERROR,
// which conflicts with something that Windows defines somewhere.
// So, undefine it:
#ifdef WIN32
#undef ERROR
#endif
#include "nsIDOMKeyEvent.h"
class nsIRenderingContext;
class nsIRegion;
class nsIWidget;
@ -476,132 +484,134 @@ enum nsDragDropEventStatus {
((evnt)->message == NS_COMPOSITION_QUERY))
/*
* Virtual key bindings for keyboard events
* NOTE: These are repeated in nsIDOMEvent.h and must be kept in sync
* Virtual key bindings for keyboard events.
* These come from nsIDOMKeyEvent.h, which is generated from MouseKeyEvent.idl.
* Really, it would be better if we phased out the NS_VK symbols altogether
* in favor of the DOM ones, but at least this way they'll be in sync.
*/
#define NS_VK_CANCEL 0x03
#define NS_VK_BACK 0x08
#define NS_VK_TAB 0x09
#define NS_VK_CLEAR 0x0C
#define NS_VK_RETURN 0x0D
#define NS_VK_ENTER 0x0E
#define NS_VK_SHIFT 0x10
#define NS_VK_CONTROL 0x11
#define NS_VK_ALT 0x12
#define NS_VK_PAUSE 0x13
#define NS_VK_CAPS_LOCK 0x14
#define NS_VK_ESCAPE 0x1B
#define NS_VK_SPACE 0x20
#define NS_VK_PAGE_UP 0x21
#define NS_VK_PAGE_DOWN 0x22
#define NS_VK_END 0x23
#define NS_VK_HOME 0x24
#define NS_VK_LEFT 0x25
#define NS_VK_UP 0x26
#define NS_VK_RIGHT 0x27
#define NS_VK_DOWN 0x28
#define NS_VK_PRINTSCREEN 0x2C
#define NS_VK_INSERT 0x2D
#define NS_VK_DELETE 0x2E
#define NS_VK_CANCEL nsIDOMKeyEvent::DOM_VK_CANCEL
#define NS_VK_BACK nsIDOMKeyEvent::DOM_VK_BACK_SPACE
#define NS_VK_TAB nsIDOMKeyEvent::DOM_VK_TAB
#define NS_VK_CLEAR nsIDOMKeyEvent::DOM_VK_CLEAR
#define NS_VK_RETURN nsIDOMKeyEvent::DOM_VK_RETURN
#define NS_VK_ENTER nsIDOMKeyEvent::DOM_VK_ENTER
#define NS_VK_SHIFT nsIDOMKeyEvent::DOM_VK_SHIFT
#define NS_VK_CONTROL nsIDOMKeyEvent::DOM_VK_CONTROL
#define NS_VK_ALT nsIDOMKeyEvent::DOM_VK_ALT
#define NS_VK_PAUSE nsIDOMKeyEvent::DOM_VK_PAUSE
#define NS_VK_CAPS_LOCK nsIDOMKeyEvent::DOM_VK_CAPS_LOCK
#define NS_VK_ESCAPE nsIDOMKeyEvent::DOM_VK_ESCAPE
#define NS_VK_SPACE nsIDOMKeyEvent::DOM_VK_SPACE
#define NS_VK_PAGE_UP nsIDOMKeyEvent::DOM_VK_PAGE_UP
#define NS_VK_PAGE_DOWN nsIDOMKeyEvent::DOM_VK_PAGE_DOWN
#define NS_VK_END nsIDOMKeyEvent::DOM_VK_END
#define NS_VK_HOME nsIDOMKeyEvent::DOM_VK_HOME
#define NS_VK_LEFT nsIDOMKeyEvent::DOM_VK_LEFT
#define NS_VK_UP nsIDOMKeyEvent::DOM_VK_UP
#define NS_VK_RIGHT nsIDOMKeyEvent::DOM_VK_RIGHT
#define NS_VK_DOWN nsIDOMKeyEvent::DOM_VK_DOWN
#define NS_VK_PRINTSCREEN nsIDOMKeyEvent::DOM_VK_PRINTSCREEN
#define NS_VK_INSERT nsIDOMKeyEvent::DOM_VK_INSERT
#define NS_VK_DELETE nsIDOMKeyEvent::DOM_VK_DELETE
// NS_VK_0 - NS_VK_9 match their ascii values
#define NS_VK_0 0x30
#define NS_VK_1 0x31
#define NS_VK_2 0x32
#define NS_VK_3 0x33
#define NS_VK_4 0x34
#define NS_VK_5 0x35
#define NS_VK_6 0x36
#define NS_VK_7 0x37
#define NS_VK_8 0x38
#define NS_VK_9 0x39
#define NS_VK_0 nsIDOMKeyEvent::DOM_VK_0
#define NS_VK_1 nsIDOMKeyEvent::DOM_VK_1
#define NS_VK_2 nsIDOMKeyEvent::DOM_VK_2
#define NS_VK_3 nsIDOMKeyEvent::DOM_VK_3
#define NS_VK_4 nsIDOMKeyEvent::DOM_VK_4
#define NS_VK_5 nsIDOMKeyEvent::DOM_VK_5
#define NS_VK_6 nsIDOMKeyEvent::DOM_VK_6
#define NS_VK_7 nsIDOMKeyEvent::DOM_VK_7
#define NS_VK_8 nsIDOMKeyEvent::DOM_VK_8
#define NS_VK_9 nsIDOMKeyEvent::DOM_VK_9
#define NS_VK_SEMICOLON 0x3B
#define NS_VK_EQUALS 0x3D
#define NS_VK_SEMICOLON nsIDOMKeyEvent::DOM_VK_SEMICOLON
#define NS_VK_EQUALS nsIDOMKeyEvent::DOM_VK_EQUALS
// NS_VK_A - NS_VK_Z match their ascii values
#define NS_VK_A 0x41
#define NS_VK_B 0x42
#define NS_VK_C 0x43
#define NS_VK_D 0x44
#define NS_VK_E 0x45
#define NS_VK_F 0x46
#define NS_VK_G 0x47
#define NS_VK_H 0x48
#define NS_VK_I 0x49
#define NS_VK_J 0x4A
#define NS_VK_K 0x4B
#define NS_VK_L 0x4C
#define NS_VK_M 0x4D
#define NS_VK_N 0x4E
#define NS_VK_O 0x4F
#define NS_VK_P 0x50
#define NS_VK_Q 0x51
#define NS_VK_R 0x52
#define NS_VK_S 0x53
#define NS_VK_T 0x54
#define NS_VK_U 0x55
#define NS_VK_V 0x56
#define NS_VK_W 0x57
#define NS_VK_X 0x58
#define NS_VK_Y 0x59
#define NS_VK_Z 0x5A
#define NS_VK_A nsIDOMKeyEvent::DOM_VK_A
#define NS_VK_B nsIDOMKeyEvent::DOM_VK_B
#define NS_VK_C nsIDOMKeyEvent::DOM_VK_C
#define NS_VK_D nsIDOMKeyEvent::DOM_VK_D
#define NS_VK_E nsIDOMKeyEvent::DOM_VK_E
#define NS_VK_F nsIDOMKeyEvent::DOM_VK_F
#define NS_VK_G nsIDOMKeyEvent::DOM_VK_G
#define NS_VK_H nsIDOMKeyEvent::DOM_VK_H
#define NS_VK_I nsIDOMKeyEvent::DOM_VK_I
#define NS_VK_J nsIDOMKeyEvent::DOM_VK_J
#define NS_VK_K nsIDOMKeyEvent::DOM_VK_K
#define NS_VK_L nsIDOMKeyEvent::DOM_VK_L
#define NS_VK_M nsIDOMKeyEvent::DOM_VK_M
#define NS_VK_N nsIDOMKeyEvent::DOM_VK_N
#define NS_VK_O nsIDOMKeyEvent::DOM_VK_O
#define NS_VK_P nsIDOMKeyEvent::DOM_VK_P
#define NS_VK_Q nsIDOMKeyEvent::DOM_VK_Q
#define NS_VK_R nsIDOMKeyEvent::DOM_VK_R
#define NS_VK_S nsIDOMKeyEvent::DOM_VK_S
#define NS_VK_T nsIDOMKeyEvent::DOM_VK_T
#define NS_VK_U nsIDOMKeyEvent::DOM_VK_U
#define NS_VK_V nsIDOMKeyEvent::DOM_VK_V
#define NS_VK_W nsIDOMKeyEvent::DOM_VK_W
#define NS_VK_X nsIDOMKeyEvent::DOM_VK_X
#define NS_VK_Y nsIDOMKeyEvent::DOM_VK_Y
#define NS_VK_Z nsIDOMKeyEvent::DOM_VK_Z
#define NS_VK_NUMPAD0 0x60
#define NS_VK_NUMPAD1 0x61
#define NS_VK_NUMPAD2 0x62
#define NS_VK_NUMPAD3 0x63
#define NS_VK_NUMPAD4 0x64
#define NS_VK_NUMPAD5 0x65
#define NS_VK_NUMPAD6 0x66
#define NS_VK_NUMPAD7 0x67
#define NS_VK_NUMPAD8 0x68
#define NS_VK_NUMPAD9 0x69
#define NS_VK_MULTIPLY 0x6A
#define NS_VK_ADD 0x6B
#define NS_VK_SEPARATOR 0x6C
#define NS_VK_SUBTRACT 0x6D
#define NS_VK_DECIMAL 0x6E
#define NS_VK_DIVIDE 0x6F
#define NS_VK_F1 0x70
#define NS_VK_F2 0x71
#define NS_VK_F3 0x72
#define NS_VK_F4 0x73
#define NS_VK_F5 0x74
#define NS_VK_F6 0x75
#define NS_VK_F7 0x76
#define NS_VK_F8 0x77
#define NS_VK_F9 0x78
#define NS_VK_F10 0x79
#define NS_VK_F11 0x7A
#define NS_VK_F12 0x7B
#define NS_VK_F13 0x7C
#define NS_VK_F14 0x7D
#define NS_VK_F15 0x7E
#define NS_VK_F16 0x7F
#define NS_VK_F17 0x80
#define NS_VK_F18 0x81
#define NS_VK_F19 0x82
#define NS_VK_F20 0x83
#define NS_VK_F21 0x84
#define NS_VK_F22 0x85
#define NS_VK_F23 0x86
#define NS_VK_F24 0x87
#define NS_VK_NUMPAD0 nsIDOMKeyEvent::DOM_VK_NUMPAD0
#define NS_VK_NUMPAD1 nsIDOMKeyEvent::DOM_VK_NUMPAD1
#define NS_VK_NUMPAD2 nsIDOMKeyEvent::DOM_VK_NUMPAD2
#define NS_VK_NUMPAD3 nsIDOMKeyEvent::DOM_VK_NUMPAD3
#define NS_VK_NUMPAD4 nsIDOMKeyEvent::DOM_VK_NUMPAD4
#define NS_VK_NUMPAD5 nsIDOMKeyEvent::DOM_VK_NUMPAD5
#define NS_VK_NUMPAD6 nsIDOMKeyEvent::DOM_VK_NUMPAD6
#define NS_VK_NUMPAD7 nsIDOMKeyEvent::DOM_VK_NUMPAD7
#define NS_VK_NUMPAD8 nsIDOMKeyEvent::DOM_VK_NUMPAD8
#define NS_VK_NUMPAD9 nsIDOMKeyEvent::DOM_VK_NUMPAD9
#define NS_VK_MULTIPLY nsIDOMKeyEvent::DOM_VK_MULTIPLY
#define NS_VK_ADD nsIDOMKeyEvent::DOM_VK_ADD
#define NS_VK_SEPARATOR nsIDOMKeyEvent::DOM_VK_SEPARATOR
#define NS_VK_SUBTRACT nsIDOMKeyEvent::DOM_VK_SUBTRACT
#define NS_VK_DECIMAL nsIDOMKeyEvent::DOM_VK_DECIMAL
#define NS_VK_DIVIDE nsIDOMKeyEvent::DOM_VK_DIVIDE
#define NS_VK_F1 nsIDOMKeyEvent::DOM_VK_F1
#define NS_VK_F2 nsIDOMKeyEvent::DOM_VK_F2
#define NS_VK_F3 nsIDOMKeyEvent::DOM_VK_F3
#define NS_VK_F4 nsIDOMKeyEvent::DOM_VK_F4
#define NS_VK_F5 nsIDOMKeyEvent::DOM_VK_F5
#define NS_VK_F6 nsIDOMKeyEvent::DOM_VK_F6
#define NS_VK_F7 nsIDOMKeyEvent::DOM_VK_F7
#define NS_VK_F8 nsIDOMKeyEvent::DOM_VK_F8
#define NS_VK_F9 nsIDOMKeyEvent::DOM_VK_F9
#define NS_VK_F10 nsIDOMKeyEvent::DOM_VK_F10
#define NS_VK_F11 nsIDOMKeyEvent::DOM_VK_F11
#define NS_VK_F12 nsIDOMKeyEvent::DOM_VK_F12
#define NS_VK_F13 nsIDOMKeyEvent::DOM_VK_F13
#define NS_VK_F14 nsIDOMKeyEvent::DOM_VK_F14
#define NS_VK_F15 nsIDOMKeyEvent::DOM_VK_F15
#define NS_VK_F16 nsIDOMKeyEvent::DOM_VK_F16
#define NS_VK_F17 nsIDOMKeyEvent::DOM_VK_F17
#define NS_VK_F18 nsIDOMKeyEvent::DOM_VK_F18
#define NS_VK_F19 nsIDOMKeyEvent::DOM_VK_F19
#define NS_VK_F20 nsIDOMKeyEvent::DOM_VK_F20
#define NS_VK_F21 nsIDOMKeyEvent::DOM_VK_F21
#define NS_VK_F22 nsIDOMKeyEvent::DOM_VK_F22
#define NS_VK_F23 nsIDOMKeyEvent::DOM_VK_F23
#define NS_VK_F24 nsIDOMKeyEvent::DOM_VK_F24
#define NS_VK_NUM_LOCK 0x90
#define NS_VK_SCROLL_LOCK 0x91
#define NS_VK_NUM_LOCK nsIDOMKeyEvent::DOM_VK_NUM_LOCK
#define NS_VK_SCROLL_LOCK nsIDOMKeyEvent::DOM_VK_SCROLL_LOCK
#define NS_VK_COMMA 0xBC
#define NS_VK_PERIOD 0xBE
#define NS_VK_SLASH 0xBF
#define NS_VK_BACK_QUOTE 0xC0
#define NS_VK_OPEN_BRACKET 0xDB
#define NS_VK_BACK_SLASH 0xDC
#define NS_VK_CLOSE_BRACKET 0xDD
#define NS_VK_QUOTE 0xDE
#define NS_VK_COMMA nsIDOMKeyEvent::DOM_VK_COMMA
#define NS_VK_PERIOD nsIDOMKeyEvent::DOM_VK_PERIOD
#define NS_VK_SLASH nsIDOMKeyEvent::DOM_VK_SLASH
#define NS_VK_BACK_QUOTE nsIDOMKeyEvent::DOM_VK_BACK_QUOTE
#define NS_VK_OPEN_BRACKET nsIDOMKeyEvent::DOM_VK_OPEN_BRACKET
#define NS_VK_BACK_SLASH nsIDOMKeyEvent::DOM_VK_BACK_SLASH
#define NS_VK_CLOSE_BRACKET nsIDOMKeyEvent::DOM_VK_CLOSE_BRACKET
#define NS_VK_QUOTE nsIDOMKeyEvent::DOM_VK_QUOTE
#define NS_VK_META 0xE0
#define NS_VK_META nsIDOMKeyEvent::DOM_VK_META
#define NS_EVENT_FLAG_NONE 0x0000
#define NS_EVENT_FLAG_INIT 0x0001