windows build fix and other small things, Windows 2000 support broken

develop
Petr Mrázek 2009-12-13 19:46:40 +00:00
parent 1d25a995b8
commit e5fa10c268
3 changed files with 6 additions and 6 deletions

@ -63,11 +63,11 @@ using namespace std;
#include <fcntl.h> #include <fcntl.h>
#include <sys/wait.h> #include <sys/wait.h>
#else #else
#define _WIN32_WINNT 0x0500 // needed for INPUT struct #define _WIN32_WINNT 0x0501 // needed for INPUT struct
#define WINVER 0x0500 // OpenThread(), PSAPI, Toolhelp32 #define WINVER 0x0501 // OpenThread(), PSAPI, Toolhelp32
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <winbase.h> //#include <winbase.h>
#include <winnt.h> #include <winnt.h>
#include <psapi.h> #include <psapi.h>
#include <tlhelp32.h> #include <tlhelp32.h>

@ -189,7 +189,7 @@ void API::TypeStr (const char *lpszString, int delay, bool useShift)
{ {
// HACK: the timing here is a strange beast // HACK: the timing here is a strange beast
xkeycode = XKeysymToKeycode (dpy, cChar); xkeycode = XKeysymToKeycode (dpy, cChar);
send_xkeyevent(dpy,dfWin,rootWin,ksTable[DFHack::LEFT_SHIFT],0,false, realDelay); send_xkeyevent(dpy,dfWin,rootWin,XKeysymToKeycode(dpy, ksTable[DFHack::LEFT_SHIFT]),0,false, realDelay);
if (useShift || cChar >= 'A' && cChar <= 'Z') if (useShift || cChar >= 'A' && cChar <= 'Z')
{ {
send_xkeyevent(dpy,dfWin,rootWin,xkeycode,ShiftMask,true, realDelay); send_xkeyevent(dpy,dfWin,rootWin,xkeycode,ShiftMask,true, realDelay);
@ -228,7 +228,7 @@ void API::TypeSpecial (t_special command, int count, int delay)
// HACK: the timing here is a strange beast // HACK: the timing here is a strange beast
mykeysym = ksTable[command]; mykeysym = ksTable[command];
xkeycode = XKeysymToKeycode (dpy, mykeysym); xkeycode = XKeysymToKeycode (dpy, mykeysym);
send_xkeyevent(dpy,dfWin,rootWin,ksTable[DFHack::LEFT_SHIFT],0,false, realDelay); send_xkeyevent(dpy,dfWin,rootWin,XKeysymToKeycode(dpy, ksTable[DFHack::LEFT_SHIFT]),0,false, realDelay);
send_xkeyevent(dpy,dfWin,rootWin,xkeycode,0,true, realDelay); send_xkeyevent(dpy,dfWin,rootWin,xkeycode,0,true, realDelay);
send_xkeyevent(dpy,dfWin,rootWin,xkeycode,0,false, realDelay); send_xkeyevent(dpy,dfWin,rootWin,xkeycode,0,false, realDelay);
XSync (dpy, false); XSync (dpy, false);

@ -61,7 +61,7 @@ enum t_special
PAGE_UP, PAGE_UP,
PAGE_DOWN, PAGE_DOWN,
INSERT, INSERT,
DELETE, DFK_DELETE, // stupid windows fails here
HOME, HOME,
END, END,
KEYPAD_DIVIDE, KEYPAD_DIVIDE,