29 #include "../../idlib/precompiled.h"
33 #include "../../renderer/tr_local.h"
37 static bool s_alttab_disabled;
39 static void WIN_DisableAltTab(
void ) {
44 RegisterHotKey( 0, 0, MOD_ALT, VK_TAB );
48 SystemParametersInfo( SPI_SCREENSAVERRUNNING, 1, &old, 0 );
50 s_alttab_disabled =
true;
53 static void WIN_EnableAltTab(
void ) {
58 UnregisterHotKey( 0, 0 );
62 SystemParametersInfo( SPI_SCREENSAVERRUNNING, 0, &old, 0 );
65 s_alttab_disabled =
false;
78 int width = rect->right - rect->left;
79 int height = rect->bottom - rect->top;
82 RECT decoRect = { 0, 0, 0, 0 };
84 int decoWidth = decoRect.right - decoRect.left;
85 int decoHeight = decoRect.bottom - decoRect.top;
94 if ( width < minWidth ) {
97 if ( height < minHeight ) {
104 rect->left = rect->right - width - decoWidth;
108 rect->right = rect->left + width + decoWidth;
112 case WMSZ_BOTTOMRIGHT:
113 rect->bottom = rect->top + height + decoHeight;
118 rect->top = rect->bottom - height - decoHeight;
121 case WMSZ_BOTTOMLEFT:
122 rect->bottom = rect->top + height + decoHeight;
126 rect->top = rect->bottom - height - decoHeight;
137 static byte s_scantokey[128] =
141 0, 27,
'1',
'2',
'3',
'4',
'5',
'6',
143 'q',
'w',
'e',
'r',
't',
'y',
'u',
'i',
145 'd',
'f',
'g',
'h',
'j',
'k',
'l',
';',
146 '\'',
'`',
K_SHIFT,
'\\',
'z',
'x',
'c',
'v',
153 0, 0, 0, 0, 0, 0, 0, 0,
154 0, 0, 0, 0, 0, 0, 0, 0,
155 0, 0, 0, 0, 0, 0, 0, 0,
156 0, 0, 0, 0, 0, 0, 0, 0
159 static byte s_scantoshift[128] =
163 0, 27,
'!',
'@',
'#',
'$',
'%',
'^',
165 'Q',
'W',
'E',
'R',
'T',
'Y',
'U',
'I',
167 'D',
'F',
'G',
'H',
'J',
'K',
'L',
':',
168 '|' ,
'~',
K_SHIFT,
'\\',
'Z',
'X',
'C',
'V',
175 0, 0, 0, 0, 0, 0, 0, 0,
176 0, 0, 0, 0, 0, 0, 0, 0,
177 0, 0, 0, 0, 0, 0, 0, 0,
178 0, 0, 0, 0, 0, 0, 0, 0
195 modified = ( key >> 16 ) & 255;
197 if ( modified > 127 )
200 if ( key & ( 1 << 24 ) ) {
279 case WM_WINDOWPOSCHANGED:
282 if (::GetClientRect(
win32.
hWnd, &rect)) {
323 int fActive, fMinimized;
325 fActive = LOWORD(wParam);
326 fMinimized = (
BOOL) HIWORD(wParam);
335 if ( fActive == WA_INACTIVE ) {
354 xPos = (short) LOWORD(lParam);
355 yPos = (short) HIWORD(lParam);
362 style = GetWindowLong( hWnd, GWL_STYLE );
363 AdjustWindowRect( &r, style,
FALSE );
379 if ( wParam == SC_SCREENSAVE || wParam == SC_KEYMENU ) {
385 if ( wParam == 13 ) {
420 case WM_NCLBUTTONDOWN:
424 case WM_ENTERSIZEMOVE:
428 case WM_EXITSIZEMOVE:
443 case WM_MOUSEWHEEL: {
444 int delta = GET_WHEEL_DELTA_WPARAM( wParam ) / WHEEL_DELTA;
446 delta = abs( delta );
447 while( delta-- > 0 ) {
455 return DefWindowProc( hWnd, uMsg, wParam, lParam );
idCVarSystem * cvarSystem
CONST PIXELFORMATDESCRIPTOR UINT
idRenderSystem * renderSystem
void WIN_Sizing(WORD side, RECT *rect)
int Icmp(const char *text) const
virtual void Frame(void)=0
virtual void BufferCommandText(cmdExecution_t exec, const char *text)=0
virtual bool IsFullScreen(void) const =0
virtual void SetPlayingSoundWorld()=0
virtual const char * GetCVarString(const char *name) const =0
static idCVar win_allowAltTab
void GLW_WM_CREATE(HWND hWnd)
void SetInteger(const int value)
virtual void SetCVarBool(const char *name, const bool value, int flags=0)=0
void Sys_QueEvent(int time, sysEventType_t type, int value, int value2, int ptrLength, void *ptr)
GLenum GLsizei GLsizei height
LONG WINAPI MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
GLdouble GLdouble GLdouble r
static idCVar win_timerUpdate
const unsigned char * Sys_GetScanTable(void)
void Sys_GrabMouseCursor(bool)