OSDev.org

The Place to Start for Operating System Developers
It is currently Fri May 10, 2024 9:02 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: keyboard not so dumb?
PostPosted: Sat May 24, 2008 9:05 am 
Offline
Member
Member

Joined: Fri Jul 13, 2007 6:37 am
Posts: 199
Location: Stuttgart/Germany
hi

after having my os lay idle for quite a while, i was just playing around with it and noticed some strange behaviour.
i have a table for my keyboard driver which is laid out a bit like this:

table: [
actionWhenKeyUnshifted, actionWhenKeyShifted,
...
]

I used to have only entries for "normal" characters like abce..xyz in that table, completely leaving out numbers and special characters.
Now I just wante to add the colon,semicolon,commam and full stop characters (which on my german keyboard are entered by pressing the keys just right to the "m" key.

so i made the respective entries in the keyboard table:

table: [
...
',', ';',
'.', ':'
...
]

When I press the respective keys unshifted, everything is fine, but when I press the two keys shifted, their respective characters (';', ':') dont appear on the console.
I then inserted a putunsint call in the keyboard interrupt service just to see the scancode, an the result quite surprised me:
When I press the key just right beside the 'm' key unshifted, the make and break codes are 102 and 358. When I press the very same key shifted, the make and break codes are: 78 and 334. Shouldnt the keyboard ALWAYS send the same make and break codes irrespective of what other keys are pressed?
PS I use bochs...

_________________
www.com-eu-nication.eu


Top
 Profile  
 
 Post subject: Re: keyboard not so dumb?
PostPosted: Sat May 24, 2008 9:11 am 
Offline
Member
Member

Joined: Thu May 17, 2007 1:27 pm
Posts: 999
sancho1980 wrote:
PS I use bochs...

AFAIK bochs does not send the actual key presses to your os but translates them according to your keyboard layout settings. Some real keyboards also send different scancodes while control keys are pressed (e.g. laptops that have FN keys do that). One key may not always generate the same scancode in all situations.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 36 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