CRAW now runs on Windows 7 too - the problem was that Windows 7 has moved some functi...
[craw.git] / craw / keyboard.cpp
blob092904ac98c94d6271e52c8ec250a4f50bff1d01
1 #include <windows.h>
2 #include <ail/string.hpp>
3 #include "python.hpp"
4 #include "keyboard.hpp"
5 #include "d2_functions.hpp"
6 #include "utility.hpp"
8 namespace
10 bool chat_box = false;
13 void process_key(unsigned virtual_key)
15 if(!player_is_in_game())
16 //only process key presses when the player is in game
17 return;
19 if(chat_box)
21 if(virtual_key == VK_RETURN || virtual_key == VK_ESCAPE)
22 chat_box = false;
24 else
26 if(virtual_key == VK_RETURN)
27 chat_box = true;
28 else
30 //write_line("Key down: " + ail::hex_string_32(virtual_key));
31 python::perform_keyboard_callback(virtual_key);