Detecting whether a key is being held down in realmode asm/C
Posted: Sun Jun 14, 2009 3:11 am
Hey there.
I'm working on, shall we say, "patching" GRUB Legacy for some specific requirements (I might as well make an unofficial release at some point since it isn't being actively developed anymore, heehee) and since I've dived into the code and sortakinda know my way around I thought I might add this feature I've wanted for a little while.
I'd like to create a function that will figure out if Shift is being held down and immediately return with an appropriate status (not a loop or code that needs to be executing before the key is pressed in order to return a value). I have a funny feeling it won't be that hard. If it's helpful to know, GRUB executes in real mode, AFAIK.
I'm not afraid to get my hands dirty since I already have to a fair bit (I've really ripped the code to shreds, heh, I plan to move my tree out of the way, unpack 0.97 to a fresh tree and apply my changes to that when I'm done), but please do realize that my assembly and low-level C is... undeveloped, to say the least. While a lot of you will probably cringe, (commented! Learning FTW ) code would be awesome, but I don't mind tutorials.
Thanks in advance!
-dav7
I'm working on, shall we say, "patching" GRUB Legacy for some specific requirements (I might as well make an unofficial release at some point since it isn't being actively developed anymore, heehee) and since I've dived into the code and sortakinda know my way around I thought I might add this feature I've wanted for a little while.
I'd like to create a function that will figure out if Shift is being held down and immediately return with an appropriate status (not a loop or code that needs to be executing before the key is pressed in order to return a value). I have a funny feeling it won't be that hard. If it's helpful to know, GRUB executes in real mode, AFAIK.
I'm not afraid to get my hands dirty since I already have to a fair bit (I've really ripped the code to shreds, heh, I plan to move my tree out of the way, unpack 0.97 to a fresh tree and apply my changes to that when I'm done), but please do realize that my assembly and low-level C is... undeveloped, to say the least. While a lot of you will probably cringe, (commented! Learning FTW ) code would be awesome, but I don't mind tutorials.
Thanks in advance!
-dav7