Page 1 of 1

[HELP]

Posted: Sat Feb 11, 2023 11:16 am
by audiotore
:?: Hello everyone! I am working on my own operating system just for fun and taking up my time :)
So far so good! I am actually almost done with the OS. I even got a keyboard driver to work (although not fully done)

I even got a upper case seperate scancode to work. However im having a shift flag issue.
I can get it to detect if the left shift or right shift key is pressed. However im having issues with
detecting if the shift key has been let go. My goal here is to get it so when I hold down the shift
key it prints out the capital letters like most modern computer operating systems do.

Here is my code :)
Note: this isn't ALL My code but I believe this is the part I'm having issues although if you need
more code to fully understand the issue than please ask thank you!

Code: Select all

if (scancode == 0x2A || scancode == 0x36)
{
  shift_hold = true; // Shift flag
  print_string("Pressed!");
}
else if (scancode == 0xAA || scancode == 0xB6)
{
  shift_hold = false;
   print_string("Released!");
}
Any help would be nice!

Re: [HELP]

Posted: Mon Apr 03, 2023 5:27 pm
by Octocontrabass
audiotore wrote:However im having issues with
detecting if the shift key has been let go.
What kind of issues?
audiotore wrote:Note: this isn't ALL My code but I believe this is the part I'm having issues although if you need
more code to fully understand the issue than please ask thank you!
I don't see anything wrong with the code you posted. I think the problem is somewhere else.

You should choose a more descriptive thread title than just "help".

Re: [HELP]

Posted: Tue Apr 04, 2023 2:39 pm
by SeaLiteral
I'm guessing your issue is probably somewhere else, but one thing I do notice with that code is that if you press one shift key, then press the other one, then release one of them, it seems it would count as no longer holding shift. But that's kind of an edge case that I would assume isn't the issue you're dealing with.

Re: [HELP]

Posted: Tue Apr 04, 2023 10:06 pm
by Schol-R-LEA
audiotore wrote:Note: this isn't ALL My code but I believe this is the part I'm having issues although if you need
more code to fully understand the issue than please ask thank you!
As Octocontrabass says, we would need to see more of your code before we could say much.

Do you have an offsite repository at, say, GitHub or Sourceforge? If so, could you please provide a link to it for us to view? Being able to view your whole project, without you needing to post the whole thing here, might be helpful.

EDIT: would this be your project, or at least a project you own, or is the username a coincidence?