We help IT Professionals succeed at work.

Change the ASCII symbols under DOS

razor111
razor111 asked
on
I want to create a program (prefer Turbo Pascal) which change the default ASCII table.
Also I need to change the symbol of the pressed key... e.g. the user press 'a' but it is displayed as 'f'

The main idea is to make a cyrillic keyboard under DOS (I hope you know what is cyrillic :) )
Comment
Watch Question

dbruntonQuid, Me Anxius Sum?  Illegitimi non carborundum.
CERTIFIED EXPERT

Commented:
Shouldn't have to do that.  You can load a code page under dos that should do that for you.

Rather than invent the wheel try the following link.  The jobs been done for you

http://www.fingertipsoft.com/ref/cyrillic/charsets.html
dbruntonQuid, Me Anxius Sum?  Illegitimi non carborundum.
CERTIFIED EXPERT

Commented:
And

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnintl/html/S2580.asp

To load a code page under dos place the following in your config.sys file

device=c:\dos\display.sys    con:=(ega,x)

where x is the code page for the language concerned.  This also presumes that display.sys is in the c:\dos folder.

To load the code page type

nlsfunc

and then

mode con cp prep=((x) c:\dos\ega.cpi)

where x is the code page concerned.

Now I may have got the commands not quite right so check a dos manual.  You may also have to download the cyrillic code page from microsoft above.

Author

Commented:
Well...then I just need to know how to simulate another pressed key. Eg.. press 'a' and display 'b' on the DOS screen.
Can you paste me some lines of code in Turbo Pascal which do this task?
dbruntonQuid, Me Anxius Sum?  Illegitimi non carborundum.
CERTIFIED EXPERT

Commented:
In Turbo Pascal it would be

var
  ch : char;
  funckey : char;

ch := readkey;
if ch = #0 then   ( was it a function key ?  if so then read keyboard buffer again }
  begin
    funckey := char
    ch := readkey;
  end;  
if ch = 'a'  then
  write('b");    { or you could use lots of case statements for different keys }
dbrunton, the above will work when the program is in control, but for true character translation, shouldnt
a TSR be written?  Just my 2 cents.

Commented:
If you want it to work in other programs as well, a TSR must be written. But even then it won't work on all programs, only those who use interrupts to write to screen... (INT 21h usually)

  Erez Sh.
erezsh,  Forgive me, but if you grab the Keyboard interupt, rather than the one for writing to the screen, you
have the ability to interogate the keyboard, and post whatever you want to the KB buffer.  There are very few (i would guess) programs that go to this low a level to get keyboard input.  tons of wedge thingy's work this way.   SO I think that a TSR which grabs the inturupt for the KB would work for most higher level programs.

So much for the keyboard,  There is also a Dos program GRAFTABL.EXE or something like that (it's been a real long time,  but it used to come with DOS 3.3 - 6.2 as far as I can remember that would allow you to define how characters would appear on the screen but as erezsh points out,  I think this would only work on programs that use 21h for Display output.  any program that does direct writes to the screen will be a problem.  However,  there used to be some EGA cards and you can probably do this with VGA as well, which allow you to update the bitmaps for the character modes.  

I guess finding a Cyrillic keyboard and operating system are out of the question?

Commented:

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - PAQ'd and pts removed
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
Commented:
Finalized as proposed

modulo

Community Support Moderator
Experts Exchange

Explore More ContentExplore courses, solutions, and other research materials related to this topic.