Fix keypress in SDL

git-svn-id: svn://kolibrios.org@6384 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
ashmew2 2016-03-28 11:57:25 +00:00
parent a71fccce10
commit 7ec2b06ca1

View File

@ -163,20 +163,28 @@ void MenuetOS_PumpEvents(_THIS)
SDL_keysym key; SDL_keysym key;
static int ext_code=0; static int ext_code=0;
static uint8_t old_mode=0; static uint8_t old_mode=0;
for (;;) { for (;;) {
i=check_os_event(); i=check_os_event();
unsigned int k;
switch(i) switch(i)
{ {
case 0: case 0:
return; return;
case 1: case 1:
MenuetOS_SDL_RepaintWnd(); MenuetOS_SDL_RepaintWnd();
break; break;
case 2: case 2:
key.scancode = get_key().code; __asm__ __volatile__("int $0x40":"=a"(k):"a"(2));
key.scancode = (k >> 8) & 0xFF;
if (key.scancode == 0xE0 || key.scancode == 0xE1) if (key.scancode == 0xE0 || key.scancode == 0xE1)
{ext_code=key.scancode;break;} {ext_code=key.scancode;break;}
if (ext_code == 0xE1 && (key.scancode & 0x7F) == 0x1D) break;
if (ext_code == 0xE1 && (key.scancode & 0x7F) == 0x1D) { break;}
if (ext_code == 0xE1 && key.scancode == 0xC5) {ext_code=0;break;} if (ext_code == 0xE1 && key.scancode == 0xC5) {ext_code=0;break;}
key.mod = GetModState(); key.mod = GetModState();
if (ext_code == 0xE1) key.mod &= ~KMOD_CTRL; if (ext_code == 0xE1) key.mod &= ~KMOD_CTRL;