PCem

view src/win-keyboard.cc @ 154:d0d530adce12

Initial port to Linux (using Allegro). 64-bit fixes. Some changes to aid portability. A few other tweaks.
author TomW
date Thu Sep 04 21:07:24 2014 +0100
parents 457f666b38c1
children
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 pcem_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 int pcem_key[272];
23 void keyboard_init()
24 {
25 atexit(keyboard_close);
27 memset(pcem_key, 0, sizeof(pcem_key));
28 pclog("Keyboard initialized!\n");
29 }
31 void keyboard_close()
32 {
33 }
35 void keyboard_poll_host()
36 {
37 int c;
39 for (c = 0; c < 272; c++)
40 pcem_key[c] = rawinputkey[c];
42 if ((rawinputkey[0x1D] || rawinputkey[0x9D]) &&
43 (rawinputkey[0x38] || rawinputkey[0xB8]) &&
44 (rawinputkey[0x51] || rawinputkey[0xD1]) &&
45 video_fullscreen)
46 leave_fullscreen();
47 }