Page 1 of 1

Multiple Keys on Return at First

Posted: Sat May 16, 2009 9:14 pm
by AltexPape
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: Select all

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...

Re: Multiple Keys on Return at First

Posted: Sat May 16, 2009 10:00 pm
by AltexPape
The following code I tried also is buggy...

Code: Select all

	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...

Re: Multiple Keys on Return at First

Posted: Sat May 16, 2009 10:11 pm
by AltexPape
Sorry about posting on my own thing...


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