Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

International keyboard support (Developers)

posted by mbbrutman Homepage, Washington, USA, 21.01.2023, 21:44

I'm working on enabling some of my programs for Unicode. Specially, being able to decode UTF-8 and map Unicode codepoints to the machine's 256 available characters. My machine uses CP437 which is limited, but UTF-8 things already look much better.

I'd like to check my understanding of keyboard input handling.

At the lowest level, the keyboard just returns scan codes to the BIOS. The BIOS is responsible for mapping the keyboard scan codes to the built-in character set, or to special keys (F1, Alt-X, etc.)

If a machine strayed from the standard US keyboard layout or built-in character set, then the BIOS had to do the mapping for the differences. Which also becomes problematic for software that is expecting one character set and gets a different one. In that case you just get the wrong thing displayed.

Around DOS 3.x timeframe the hardware (EGA) allowed for loadable character sets (code pages) and DOS provided a mechanism to specify which should be resident. So that takes care of the limitation of the fixed code page that earlier machines (MDA/CGA) had.

On the keyboard side there is the KEYB.COM program. From what I can tell when you use KEYB it just fixes or replaces the standard BIOS handling, converting scan codes to something different from the default. It also allows for some shift/meta type operations to generate additional characters. But ultimately, the output is still going to be a value from 0 to 255 representing a character, and hopefully the matching code page for the video display is resident. Otherwise, you get the correct character but an incorrect display.

Does this sound about right?

---
mTCP - TCP/IP apps for vintage DOS machines!
http://www.brutman.com/mTCP

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 76 users online (0 registered, 76 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum