OSDev.org
https://forum.osdev.org/

Multiple Keys on Return at First
https://forum.osdev.org/viewtopic.php?f=1&t=20080
Page 1 of 1

Author:  AltexPape [ Sat May 16, 2009 9:14 pm ]
Post subject:  Multiple Keys on Return at First

I implemented a fixed PIC and have set up the KeyCode Descriptor Table, but I have an error.
I already fixed the keys so that I shouldn't get a repeated (make/break) key, but I do have an issue.

Ok, so as a test right now I just have my OS infinitely call my getKey method and display that character on the screen. It works fine after you enter like three letters, but I get problems during the first part.

As a note when you look at the screenshot, any "unprintable characters" are at the moment being handled by just acting like the '*' character! Keep that in mind.


Code:
char Keyboard::getChar()
{
   char toRet;
   while (toRet == keyOp)
   {
      toRet = readInC(0x60);
   }
   if (stopRepeat)
   {
      keyOp = toRet;
      stopRepeat = false;
      return 0;
   }
   keyOp = toRet;
   stopRepeat = true;
   return KEYCODE[toRet-1];
}


Any ideas?

(Included a screen shot)
In my screen shot I typed the keys: "hello, world (enter) (enter) what is up?" to show you what it does...

Attachments:
File comment: Note that
"Hello"
"Welcome to A.E.R.I.O.S."
is printed by the OS.

error.jpg
error.jpg [ 24.42 KiB | Viewed 758 times ]

Author:  AltexPape [ Sat May 16, 2009 10:00 pm ]
Post subject:  Re: Multiple Keys on Return at First

The following code I tried also is buggy...

Code:
   char toRet = 0;
   do
   {
      toRet = readInC(0x60);
   } while (!(readInC(0x64) & 1));

   if ((toRet & 0x80))
   {
      return 0;
   }
   else
   {
      keyOp = toRet;
      return KEYCODE[toRet-1];
   }


what is ends up doing is screwing up at the start, but also some characters I have to press a couple times or hold down to get them to appear...

Author:  AltexPape [ Sat May 16, 2009 10:11 pm ]
Post subject:  Re: Multiple Keys on Return at First

Sorry about posting on my own thing...


Ignore this thread ya'll, I'm going to go the IRQ route.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/