| | |
Keyboard Communication Help
![]() |
•
•
Join Date: Sep 2007
Posts: 36
Reputation:
Solved Threads: 1
First of all, if you have not done any hardware interfacing then you probably won't know the answer to this question, just to save you time of reading this post and then realising you don't know.
I'm having some trouble figuring out how to structure commands properly when communicating via the keyboard, and in this instance, turning on the capitals lock.
The following code is in C but should be easy to figure out from whatever language you prefer:
Note: out/inportb() is the same as out/inb()
apart from the first argument is the port, and
the second is the value.
What i have got is not correct, as no matter what values i write to the port, it never turns the capitals L.E.D on, so far i can get the number lock and scroll lock to go on, but not the capitals lock.
I would very much appriciate help on this, thanks.
EDIT: Sorry i wasn't sure which forum to put this in, but i thought that because this is not really based on the C language, it should be in the hardware section.
I'm having some trouble figuring out how to structure commands properly when communicating via the keyboard, and in this instance, turning on the capitals lock.
The following code is in C but should be easy to figure out from whatever language you prefer:
Note: out/inportb() is the same as out/inb()
apart from the first argument is the port, and
the second is the value.
outportb(0x60, 0xED); // Send the KB command
if (inportb(0x60) == 'ú') // Check the KB sent ACK
{
outportb(0x60, 0x2); // Send the Caps lock ID (2)
if (inportb(0x60) == 'ú') // Check the KB sent ACK
{
outportb(0x60, 0x1); // Write the option bit: 1 (on)
}
}What i have got is not correct, as no matter what values i write to the port, it never turns the capitals L.E.D on, so far i can get the number lock and scroll lock to go on, but not the capitals lock.
I would very much appriciate help on this, thanks.
EDIT: Sorry i wasn't sure which forum to put this in, but i thought that because this is not really based on the C language, it should be in the hardware section.
Last edited by Webbsta; Dec 16th, 2008 at 9:16 pm.
Hi,
What are you trying achieve by turning capital lock on after receiving a character ? If you are trying to get upper case letters into your program, then if you switch it on after what will you do with that character ?
Why not instead just convert the character to upper case if it is lower case ?
Or am I missing something ?
Denis
What are you trying achieve by turning capital lock on after receiving a character ? If you are trying to get upper case letters into your program, then if you switch it on after what will you do with that character ?
Why not instead just convert the character to upper case if it is lower case ?
Or am I missing something ?
Denis
![]() |
Similar Threads
- Computer Randomly Shuts Down (Troubleshooting Dead Machines)
- Windows Xp Freezes Ramdomly (Viruses, Spyware and other Nasties)
- HD problems (Windows NT / 2000 / XP)
- Mouse dead, trying to load drivers for WinXP (Troubleshooting Dead Machines)
- Reading from USB port using php? (PHP)
- "The Everest Report" (Windows Software)
- Quiet student (Computer Science)
- 35 processes, need to trim the fat (Viruses, Spyware and other Nasties)
- would somebody buy this for me? (Troubleshooting Dead Machines)
Other Threads in the USB Devices and other Peripherals Forum
- Previous Thread: Video Camera - Fixing Geometry Issue
- Next Thread: Cursor Problems with HP xb3000 docking station
| Thread Tools | Search this Thread |
advancedmicrodevices amd analogdevices apple at&t buffett cellphones chips chipstocks crm directtv dish dolcegmail firewire gadget gmail hacking handhelddevices hardware ieee intel logitech mice microchips microndevices mouse news obama openliven peripherals photoframe plug-in port printer removabledevices satellite security semiconductors semiconductorstocks specification stocks sugarcrm technology television texasinstruments text usb usb3.0 usbkey xeon





