Added catch for when rand() sticks
[tpg/acess2.git] / Kernel / drv / kb.c
index 0de8fe1..2e07aef 100644 (file)
@@ -12,6 +12,9 @@
 // === CONSTANTS ===
 #define        KB_BUFFER_SIZE  1024
 
+// === IMPORTS ===
+void   Threads_Dump();
+
 // === PROTOTYPES ===
  int   KB_Install(char **Arguments);
 void   KB_IRQHandler();
@@ -138,7 +141,18 @@ void KB_IRQHandler()
 
        // Ignore Non-Printable Characters
        if(ch == 0 || ch & 0x80)                return;
-               
+       
+       // --- Check for Kernel Magic Combos
+       if(gbaKB_States[KEY_LCTRL])// && gbaKB_States[KEY_LALT])
+       {
+               LOG("ch = 0x%02x", ch);
+               switch(ch)
+               {
+               case 'd':       __asm__ __volatile__ ("xchg %bx, %bx"); break;
+               case 'p':       Threads_Dump(); break;
+               }
+       }
+       
        // Is shift pressed
        if(gbKB_ShiftState ^ gbKB_CapsState)
        {
@@ -172,15 +186,6 @@ void KB_IRQHandler()
                }
        }
        
-       // --- Check for Kernel Magic Combos
-       if(gbaKB_States[KEY_LSHIFT] && gbaKB_States[KEY_RSHIFT])
-       {
-               switch(ch)
-               {
-               case 'D':       __asm__ __volatile__ ("xchg %bx, %bx"); break;
-               }
-       }
-       
        if(gKB_Callback)        gKB_Callback(ch);
 }
 

UCC git Repository :: git.ucc.asn.au