PCem

view src/win-keyboard.cc @ 124:457f666b38c1

Keyboard now uses raw input. Should fix international keyboard. Based on patch from Battler.
author TomW
date Fri Jul 11 20:35:37 2014 +0100
parents f85939140905
children d0d530adce12
line source
1 #define UNICODE
2 #include <stdio.h>
3 #include <string.h>
4 #include <stdint.h>
5 #define BITMAP WINDOWS_BITMAP
6 #include <windows.h>
7 #undef BITMAP
8 #include "plat-keyboard.h"
9 #include "win.h"
10 #include "video.h"
12 extern "C" int key[272];
14 extern "C" void fatal(const char *format, ...);
15 extern "C" void pclog(const char *format, ...);
17 extern "C" void keyboard_init();
18 extern "C" void keyboard_close();
19 extern "C" void keyboard_poll();
21 void keyboard_init()
22 {
23 atexit(keyboard_close);
25 memset(key, 0, sizeof(key));
26 pclog("Keyboard initialized!\n");
27 }
29 void keyboard_close()
30 {
31 }
33 void keyboard_poll_host()
34 {
35 int c;
37 for (c = 0; c < 272; c++)
38 key[c] = rawinputkey[c];
40 if ((rawinputkey[0x1D] || rawinputkey[0x9D]) &&
41 (rawinputkey[0x38] || rawinputkey[0xB8]) &&
42 (rawinputkey[0x51] || rawinputkey[0xD1]) &&
43 video_fullscreen)
44 leave_fullscreen();
45 }