Sun Jan 22 18:55:33 1995 Alexandre Julliard (julliard@lamisun.epfl.ch) * [loader/resource.c] [objects/dib.c] Fixed icon loading and drawing, now that BitBlt() works correctly. * [objects/clipping.c] [objects/region.c] Implemented elliptic regions with a set of rectangle. This greatly simplifies the region code and should boost clipping performance. * [objects/color.c] Fixed bug that caused seg-fault on 24bpp displays. * [objects/bitblt.c] Fixed bug when shrinking a bitmap to more than half its size. * [windows/graphics.c] Fixed bugs in PaintRgn() and Polyline(). * [windows/nonclient.c] [windows/painting.c] [windows/winpos.c] Fixed some problems with window background painting. Thu Jan 12 12:20:25 PST 1995 Ross Biro (biro@yggdrasil.com) * [tools/build.c] * [tools/newbuild.c] * [Imakefile] * [include/wine.h] * [loader/call.S] * [loader/selector.c] * [include/segmem.h] * [misc/main.c] Changed selector code and 16/32 bit xfer code so that wine no longer has to be loaded low in memory. Changed wine to work with ELF binary formats under Linux. Sat Sep 17 11:08:49 1994 Eric Youngdale (eric@esp22) * [debugger/db_disasm.c] New instruction disassembler - borrowed from Mach kernel. Has a BSD style of license as opposed to the gdb code we were previously using which was under the GPL. Mon Jan 9 18:27:11 1995 Alexandre Julliard (julliard@lamisun.epfl.ch) * [Imakefile] Compiling with -Wall flag. * [*/*] Fixes to minimize the number of compilation warnings. * [objects/bitblt.c] Fixed BitBlt() and used the same code to rewrite PatBlt() and StretchBlt(). The three *Blt() functions should now be correct in every case (famous last words). * [objects/brush.c] [objects/dither.c] Merged the two files into brush.c * [objects/dc.c] Fixed bug when the Windows programs forget to re-select the original bitmap in a memory DC. * [objects/font.c] Tty to use 'fixed' font when the system font can't be found. * [windows/dialog.c] Tentative fix to make dialogs look better when using fixed-width fonts. * [windows/graphics.c] Partially implemented the PS_INSIDEFRAME pen style. * [windows/nonclient.c] Fix for windows that have the WS_EX_DLGMODALFRAME style bit without the WS_DLGFRAME style.
87 lines
2.3 KiB
C
87 lines
2.3 KiB
C
/*
|
|
* Keyboard related functions
|
|
*
|
|
* Copyright 1993 Bob Amstadt
|
|
*/
|
|
#include <string.h>
|
|
#include "win.h"
|
|
#include "windows.h"
|
|
|
|
extern BOOL MouseButtonsStates[3];
|
|
extern BOOL AsyncMouseButtonsStates[3];
|
|
extern BYTE KeyStateTable[256];
|
|
extern BYTE AsyncKeyStateTable[256];
|
|
|
|
/**********************************************************************
|
|
* GetKeyState [USER.106]
|
|
*/
|
|
int GetKeyState(int keycode)
|
|
{
|
|
switch(keycode) {
|
|
case VK_LBUTTON:
|
|
return MouseButtonsStates[0];
|
|
case VK_MBUTTON:
|
|
return MouseButtonsStates[1];
|
|
case VK_RBUTTON:
|
|
return MouseButtonsStates[2];
|
|
default:
|
|
return KeyStateTable[keycode];
|
|
}
|
|
}
|
|
|
|
/**********************************************************************
|
|
* GetKeyboardState [USER.222]
|
|
*/
|
|
void GetKeyboardState(BYTE FAR *lpKeyState)
|
|
{
|
|
if (lpKeyState != NULL) {
|
|
KeyStateTable[VK_LBUTTON] = MouseButtonsStates[0];
|
|
KeyStateTable[VK_MBUTTON] = MouseButtonsStates[1];
|
|
KeyStateTable[VK_RBUTTON] = MouseButtonsStates[2];
|
|
memcpy(lpKeyState, KeyStateTable, 256);
|
|
}
|
|
}
|
|
|
|
/**********************************************************************
|
|
* GetAsyncKeyState (USER.249)
|
|
*
|
|
* Determine if a key is or was pressed. retval has high-order
|
|
* byte set to 1 if currently pressed, low-order byte 1 if key has
|
|
* been pressed.
|
|
*
|
|
* This uses the variable AsyncMouseButtonsStates and
|
|
* AsyncKeyStateTable (set in event.c) which have the mouse button
|
|
* number or key number (whichever is applicable) set to true if the
|
|
* mouse or key had been depressed since the last call to
|
|
* GetAsyncKeyState.
|
|
*/
|
|
int GetAsyncKeyState(int nKey)
|
|
{
|
|
short retval;
|
|
|
|
switch (nKey) {
|
|
|
|
case VK_LBUTTON:
|
|
retval = AsyncMouseButtonsStates[0] |
|
|
(MouseButtonsStates[0] << 8);
|
|
break;
|
|
case VK_MBUTTON:
|
|
retval = AsyncMouseButtonsStates[1] |
|
|
(MouseButtonsStates[1] << 8);
|
|
break;
|
|
case VK_RBUTTON:
|
|
retval = AsyncMouseButtonsStates[2] |
|
|
(MouseButtonsStates[2] << 8);
|
|
break;
|
|
default:
|
|
retval = AsyncKeyStateTable[nKey] |
|
|
(KeyStateTable[nKey] << 8);
|
|
break;
|
|
}
|
|
|
|
bzero(AsyncMouseButtonsStates, 3); /* all states to false */
|
|
bzero(AsyncKeyStateTable, 256);
|
|
|
|
return retval;
|
|
}
|
|
|