[HELP]

Programming, for all ages and all languages.
Post Reply
audiotore
Posts: 2
Joined: Sat Feb 11, 2023 11:05 am

[HELP]

Post 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!
Octocontrabass
Member
Member
Posts: 5516
Joined: Mon Mar 25, 2013 7:01 pm

Re: [HELP]

Post 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".
User avatar
SeaLiteral
Posts: 19
Joined: Wed Sep 27, 2017 1:44 pm

Re: [HELP]

Post 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.
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: [HELP]

Post 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?
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
Post Reply