954,193 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Pascal and Hex etc

Hi

I'm trying to use "IBM PC Keyboard Scan Codes" in Pascal which involve Decimal Pair and/or Hex Pair codes. (similar to ASCII).

Could someone please tell me how to use these in VPascal. Preferably not Turbo Pascal, but any Pascal version would be appreciated!

A 'code' example would be
PageUp button being
(00,73) (decimal pair) or
(0x00,0x49) (hex pair).

(data from http://jimprice.com/jim-asc.htm )

Thanks :D

denzal2006
Newbie Poster
2 posts since Jul 2006
Reputation Points: 10
Solved Threads: 0
 

Hi,

Do you want to know how to obtain scan codes from keyboard or how to translate them to ASCII ?

Loren Soth

Lord Soth
Posting Whiz in Training
233 posts since Mar 2006
Reputation Points: 28
Solved Threads: 4
 

either translate into ASCII or use as they for use in Pascal!

denzal2006
Newbie Poster
2 posts since Jul 2006
Reputation Points: 10
Solved Threads: 0
 
Lord Soth
Posting Whiz in Training
233 posts since Mar 2006
Reputation Points: 28
Solved Threads: 4
 

what is that ASCII?

jan1024188
Posting Whiz in Training
254 posts since Aug 2006
Reputation Points: 27
Solved Threads: 2
 
Hi I'm trying to use "IBM PC Keyboard Scan Codes" in Pascal which involve Decimal Pair and/or Hex Pair codes. (similar to ASCII). Could someone please tell me how to use these in VPascal. Preferably not Turbo Pascal, but any Pascal version would be appreciated! A 'code' example would be PageUp button being (00,73) (decimal pair) or (0x00,0x49) (hex pair). (data from http://jimprice.com/jim-asc.htm ) Thanks :D


Hi Denzal,

You need to read port Hex60. The following would work in Turbo Pascal (sorry I don't know VPascal :-)). Please replace underscores (_) with spaces ( ).

uses crt;

var
__sc: byte;

begin
__clrscr;
__repeat
____gotoxy(35,12);
____sc := port[$60]; {this makes sc the value of the scan code}
____write(sc,'___');
__until sc = 1; {exit on escape character}
end.

Greetings,

YS

yashar
Newbie Poster
1 post since Nov 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You