git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed strncmp
[tpg/acess2.git]
/
Kernel
/
drv
/
kb.c
diff --git
a/Kernel/drv/kb.c
b/Kernel/drv/kb.c
index
013e953
..
d6124e7
100644
(file)
--- a/
Kernel/drv/kb.c
+++ b/
Kernel/drv/kb.c
@@
-12,6
+12,9
@@
// === CONSTANTS ===
#define KB_BUFFER_SIZE 1024
// === CONSTANTS ===
#define KB_BUFFER_SIZE 1024
+// === IMPORTS ===
+void Threads_Dump();
+
// === PROTOTYPES ===
int KB_Install(char **Arguments);
void KB_IRQHandler();
// === PROTOTYPES ===
int KB_Install(char **Arguments);
void KB_IRQHandler();
@@
-23,7
+26,7
@@
void KB_UpdateLEDs();
// === GLOBALS ===
MODULE_DEFINE(0, 0x0100, PS2Keybard, KB_Install, NULL, NULL);
tDevFS_Driver gKB_DevInfo = {
// === GLOBALS ===
MODULE_DEFINE(0, 0x0100, PS2Keybard, KB_Install, NULL, NULL);
tDevFS_Driver gKB_DevInfo = {
- NULL, "PS2K
b
",
+ NULL, "PS2K
eyboard
",
{
.NumACLs = 0,
.Size = -1,
{
.NumACLs = 0,
.Size = -1,
@@
-63,7
+66,7
@@
void KB_IRQHandler()
{
Uint8 scancode;
Uint32 ch;
{
Uint8 scancode;
Uint32 ch;
-
int
keyNum;
+
// int
keyNum;
//if( inportb(0x64) & 0x20 ) return;
//if( inportb(0x64) & 0x20 ) return;
@@
-102,7
+105,7
@@
void KB_IRQHandler()
// Translate
ch = gpKB_Map[giKB_KeyLayer][scancode];
// Translate
ch = gpKB_Map[giKB_KeyLayer][scancode];
- keyNum = giKB_KeyLayer * 256 + scancode;
+
//
keyNum = giKB_KeyLayer * 256 + scancode;
// Check for unknown key
if(!ch && !gbKB_KeyUp)
Warning("UNK %i %x", giKB_KeyLayer, scancode);
// Check for unknown key
if(!ch && !gbKB_KeyUp)
Warning("UNK %i %x", giKB_KeyLayer, scancode);
@@
-114,7
+117,7
@@
void KB_IRQHandler()
if (gbKB_KeyUp)
{
gbKB_KeyUp = 0;
if (gbKB_KeyUp)
{
gbKB_KeyUp = 0;
- gbaKB_States[
keyNum ] = 0;
// Unset key state flag
+ gbaKB_States[
ch ] = 0;
// Unset key state flag
if( !gbaKB_States[KEY_LSHIFT] && !gbaKB_States[KEY_RSHIFT] )
gbKB_ShiftState = 0;
if( !gbaKB_States[KEY_LSHIFT] && !gbaKB_States[KEY_RSHIFT] )
gbKB_ShiftState = 0;
@@
-126,7
+129,7
@@
void KB_IRQHandler()
}
// Set the bit relating to the key
}
// Set the bit relating to the key
- gbaKB_States[
keyNum
] = 1;
+ gbaKB_States[
ch
] = 1;
if(ch == KEY_LSHIFT || ch == KEY_RSHIFT)
gbKB_ShiftState = 1;
if(ch == KEY_LSHIFT || ch == KEY_RSHIFT)
gbKB_ShiftState = 1;
@@
-138,7
+141,17
@@
void KB_IRQHandler()
// Ignore Non-Printable Characters
if(ch == 0 || ch & 0x80) return;
// Ignore Non-Printable Characters
if(ch == 0 || ch & 0x80) return;
-
+
+ // --- Check for Kernel Magic Combos
+ if(gbaKB_States[KEY_LCTRL] && gbaKB_States[KEY_LALT])
+ {
+ switch(ch)
+ {
+ case 'd': __asm__ __volatile__ ("xchg %bx, %bx"); break;
+ case 'p': Threads_Dump(); break;
+ }
+ }
+
// Is shift pressed
if(gbKB_ShiftState ^ gbKB_CapsState)
{
// Is shift pressed
if(gbKB_ShiftState ^ gbKB_CapsState)
{
@@
-172,17
+185,7
@@
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);
+ if(gKB_Callback) gKB_Callback(ch);
}
/**
}
/**
UCC
git Repository :: git.ucc.asn.au