From 7ec2b06ca11bcdb1737a1fc2a5e0a7470b898f78 Mon Sep 17 00:00:00 2001 From: ashmew2 Date: Mon, 28 Mar 2016 11:57:25 +0000 Subject: [PATCH] Fix keypress in SDL git-svn-id: svn://kolibrios.org@6384 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../src/video/menuetos/SDL_menuetevents.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/contrib/sdk/sources/SDL-1.2.2/src/video/menuetos/SDL_menuetevents.c b/contrib/sdk/sources/SDL-1.2.2/src/video/menuetos/SDL_menuetevents.c index b96e3c3775..bdc54eff47 100644 --- a/contrib/sdk/sources/SDL-1.2.2/src/video/menuetos/SDL_menuetevents.c +++ b/contrib/sdk/sources/SDL-1.2.2/src/video/menuetos/SDL_menuetevents.c @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -163,20 +163,28 @@ void MenuetOS_PumpEvents(_THIS) SDL_keysym key; static int ext_code=0; static uint8_t old_mode=0; + for (;;) { i=check_os_event(); - switch(i) - { + unsigned int k; + + switch(i) + { case 0: return; case 1: + MenuetOS_SDL_RepaintWnd(); break; + 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) {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;} key.mod = GetModState(); if (ext_code == 0xE1) key.mod &= ~KMOD_CTRL;