Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

input.h

Go to the documentation of this file.
00001 /*++ 00002 00003 Copyright (c) 1985 - 1999, Microsoft Corporation 00004 00005 Module Name: 00006 00007 input.h 00008 00009 Abstract: 00010 00011 This module contains the internal structures and definitions used 00012 by the input (keyboard and mouse) component of the NT console subsystem. 00013 00014 Author: 00015 00016 Therese Stowell (thereses) 12-Nov-1990 00017 00018 Revision History: 00019 00020 --*/ 00021 00022 #define DEFAULT_NUMBER_OF_EVENTS 50 00023 #define INPUT_BUFFER_SIZE_INCREMENT 10 00024 00025 typedef struct _INPUT_INFORMATION { 00026 PINPUT_RECORD InputBuffer; 00027 DWORD InputBufferSize; // size in events 00028 CONSOLE_SHARE_ACCESS ShareAccess; // share mode 00029 DWORD AllocatedBufferSize; // size in bytes of entire buffer 00030 DWORD InputMode; 00031 ULONG RefCount; // number of handles to input buffer 00032 ULONG_PTR First; // ptr to base of circular buffer 00033 ULONG_PTR In; // ptr to next free event 00034 ULONG_PTR Out; // ptr to next available event 00035 ULONG_PTR Last; // ptr to end+1 of buffer 00036 LIST_ENTRY ReadWaitQueue; 00037 HANDLE InputWaitEvent; 00038 #if defined(FE_SB) 00039 #if defined(FE_IME) 00040 struct { 00041 DWORD Disable : 1; // High : specifies input code page or enable/disable in NLS state 00042 DWORD Unavailable : 1; // Middle : specifies console window doing menu loop or size move 00043 DWORD Open : 1; // Low : specifies open/close in NLS state or IME hot key 00044 00045 DWORD ReadyConversion:1;// if conversion mode is ready by succeed communicate to ConIME. 00046 // then this field is TRUE. 00047 DWORD Conversion; // conversion mode of ime (i.e IME_CMODE_xxx). 00048 // this field uses by GetConsoleNlsMode 00049 } ImeMode; 00050 HWND hWndConsoleIME; // validate hWnd when open property window by ImmConfigureIME 00051 #endif // FE_IME 00052 struct _CONSOLE_INFORMATION *Console; 00053 INPUT_RECORD ReadConInpDbcsLeadByte; 00054 INPUT_RECORD WriteConInpDbcsLeadByte[2]; 00055 #endif 00056 } INPUT_INFORMATION, *PINPUT_INFORMATION; 00057 00058 typedef struct _INPUT_READ_HANDLE_DATA { 00059 00060 // 00061 // the following seven fields are solely used for input reads. 00062 // 00063 00064 CRITICAL_SECTION ReadCountLock; // serializes access to read count 00065 ULONG ReadCount; // number of reads waiting 00066 ULONG InputHandleFlags; 00067 00068 // 00069 // the following four fields are used to remember input data that 00070 // wasn't returned on a cooked-mode read. we do our own buffering 00071 // and don't return data until the user hits enter so that she can 00072 // edit the input. as a result, there is often data that doesn't fit 00073 // into the caller's buffer. we save it so we can return it on the 00074 // next cooked-mode read to this handle. 00075 // 00076 00077 ULONG BytesAvailable; 00078 PWCHAR CurrentBufPtr; 00079 PWCHAR BufPtr; 00080 } INPUT_READ_HANDLE_DATA, *PINPUT_READ_HANDLE_DATA; 00081 00082 #define UNICODE_BACKSPACE ((WCHAR)0x08) 00083 #define UNICODE_BACKSPACE2 ((WCHAR)0x25d8) 00084 #define UNICODE_CARRIAGERETURN ((WCHAR)0x0d) 00085 #define UNICODE_LINEFEED ((WCHAR)0x0a) 00086 #define UNICODE_BELL ((WCHAR)0x07) 00087 #define UNICODE_TAB ((WCHAR)0x09) 00088 #define UNICODE_SPACE ((WCHAR)0x20) 00089 00090 #define TAB_SIZE 8 00091 #define TAB_MASK (TAB_SIZE-1) 00092 #define NUMBER_OF_SPACES_IN_TAB(POSITION) (TAB_SIZE - ((POSITION) & TAB_MASK)) 00093 00094 #define AT_EOL(COOKEDREADDATA) ((COOKEDREADDATA)->BytesRead == ((COOKEDREADDATA)->CurrentPosition*2)) 00095 #define INSERT_MODE(COOKEDREADDATA) ((COOKEDREADDATA)->InsertMode) 00096 00097 #define VIRTUAL_KEY_CODE_S 0x53 00098 #define VIRTUAL_KEY_CODE_C 0x43 00099 00100 #define VK_OEM_SCROLL 0x91 00101 00102 #define KEY_PRESSED 0x8000 00103 #define KEY_TOGGLED 0x01 00104 #define KEY_ENHANCED 0x01000000 00105 #define KEY_UP_TRANSITION 1 00106 #define KEY_PREVIOUS_DOWN 0x40000000 00107 #define KEY_TRANSITION_UP 0x80000000 00108 00109 #define CONSOLE_CTRL_C_SEEN 1 00110 #define CONSOLE_CTRL_BREAK_SEEN 2 00111 00112 #define LockReadCount(HANDLEPTR) RtlEnterCriticalSection(&(HANDLEPTR)->InputReadData->ReadCountLock) 00113 #define UnlockReadCount(HANDLEPTR) RtlLeaveCriticalSection(&(HANDLEPTR)->InputReadData->ReadCountLock) 00114 00115 #define LoadKeyEvent(PEVENT,KEYDOWN,CHAR,KEYCODE,SCANCODE,KEYSTATE) { \ 00116 (PEVENT)->EventType = KEY_EVENT; \ 00117 (PEVENT)->Event.KeyEvent.bKeyDown = KEYDOWN; \ 00118 (PEVENT)->Event.KeyEvent.wRepeatCount = 1; \ 00119 (PEVENT)->Event.KeyEvent.uChar.UnicodeChar = CHAR; \ 00120 (PEVENT)->Event.KeyEvent.wVirtualKeyCode = KEYCODE; \ 00121 (PEVENT)->Event.KeyEvent.wVirtualScanCode = SCANCODE; \ 00122 (PEVENT)->Event.KeyEvent.dwControlKeyState = KEYSTATE; \ 00123 }

Generated on Sat May 15 19:40:24 2004 for test by doxygen 1.3.7