OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 2:18 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: [HELP]
PostPosted: Sat Feb 11, 2023 11:16 am 
Offline

Joined: Sat Feb 11, 2023 11:05 am
Posts: 2
:?: 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:
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!


Top
 Profile  
 
 Post subject: Re: [HELP]
PostPosted: Mon Apr 03, 2023 5:27 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
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".


Top
 Profile  
 
 Post subject: Re: [HELP]
PostPosted: Tue Apr 04, 2023 2:39 pm 
Offline
User avatar

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


Top
 Profile  
 
 Post subject: Re: [HELP]
PostPosted: Tue Apr 04, 2023 10:06 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 32 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group