Ketboard driver and buffer

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Unexpected

Ketboard driver and buffer

Post by Unexpected »

[attachment deleted by admin]
jrfritz

Re:Ketboard driver and buffer

Post by jrfritz »

You need a asm stub that pusha's and calles the C code.
Unexpected

Re:Ketboard driver and buffer

Post by Unexpected »

My handler looks like this:

Code: Select all

_IRQ1_Handler:
     CLI
     PUSHA
     PUSHF
     CALL _KBD_Handler
     POPF
     POPA
     STI
IRET
And here is another problem:
When pressing a key, OS prints all keys correctly but shift is not working.
Maby errors with buffer?
Loss...
jrfritz

Re:Ketboard driver and buffer

Post by jrfritz »

I'm about to enter your situation...but I need to bet my kernel loaded at 1 meg....

Then we'll work together on this problem ( I have it too )...
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re:Ketboard driver and buffer

Post by df »

scancodes dont change for shifted keys. you neede to track shift+capslock yourself and make them uppercase, or numlock numbers/arrows, etc.
-- Stu --
Unexpected

Re:Ketboard driver and buffer

Post by Unexpected »

Ok Tom! ;)
df:
If there something wrong?

Code: Select all

     if (KBD_Shift = false && CapsLock == true) KeyASCII = KBD_ASCII_KEY_S[ScanCode];
     if (KBD_Shift = false && CapsLock == false) KeyASCII = KBD_ASCII_KEY_NS[ScanCode];

     if (KBD_Shift = true && CapsLock == false) KeyASCII = KBD_ASCII_KEY_S[ScanCode];
     if (KBD_Shift = true && CapsLock == true) KeyASCII = KBD_ASCII_KEY_NS[ScanCode];
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Ketboard driver and buffer

Post by Pype.Clicker »

so, basically

Code: Select all

if (shift == caps) keyAscii = KbdAsciiKeyNS[scancode];
else keyAscii=KbdAsciiKeyS[scancode];
Unexpected

Re:Ketboard driver and buffer

Post by Unexpected »

Thanx Pype.Clicker for optimization ;)
I forgot to do keybourd overflow protection :) And write = not == :)
Now is only one trouble, printing key two times. But I think it will be ease to correct.
Thnx you all!
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re:Ketboard driver and buffer

Post by df »

Unexpected wrote: Ok Tom! ;)
df:
If there something wrong?

Code: Select all

     if (KBD_Shift = false && CapsLock == true) KeyASCII = KBD_ASCII_KEY_S[ScanCode];
     if (KBD_Shift = false && CapsLock == false) KeyASCII = KBD_ASCII_KEY_NS[ScanCode];

     if (KBD_Shift = true && CapsLock == false) KeyASCII = KBD_ASCII_KEY_S[ScanCode];
     if (KBD_Shift = true && CapsLock == true) KeyASCII = KBD_ASCII_KEY_NS[ScanCode];
kbd_shift ==... your setting value not comparing.
-- Stu --
Unexpected

Re:Ketboard driver and buffer

Post by Unexpected »

Now corrected all bugs!
All works!
It was 3 bugs:
1) I write = not == (just typo)
2) Forgot buffer overflow
3) When key released KB_Hit must be 0 not 1
Thanx you all again!
Post Reply