Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4106
Number of posts: 14016

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Help with key codes Posted by ccaveman on 6 May 2006 at 7:31 PM
This is the key code I need to know:

what is the key code for "enter"?

eg. Shift key is 0
Report
Re: Help with key codes Posted by zibadian on 6 May 2006 at 8:51 PM
: This is the key code I need to know:
:
: what is the key code for "enter"?
:
: eg. Shift key is 0
:
13
Report
Re: Help with key codes Posted by IDK on 7 May 2006 at 2:05 AM
: : This is the key code I need to know:
: :
: : what is the key code for "enter"?
: :
: : eg. Shift key is 0
: :
: 13
:
I don't know pascall, so if this seems completly wrong then don't read it

No, 13 is the ascii for newline, the makecode for Enter is 36.
What does keycode really mean?
The return value of INT 21h,1 (aka getc() in C in windows)?
Report
Re: Help with key codes Posted by zibadian on 7 May 2006 at 2:17 AM
: : : This is the key code I need to know:
: : :
: : : what is the key code for "enter"?
: : :
: : : eg. Shift key is 0
: : :
: : 13
: :
: I don't know pascall, so if this seems completly wrong then don't read it
:
: No, 13 is the ascii for newline, the makecode for Enter is 36.
: What does keycode really mean?
: The return value of INT 21h,1 (aka getc() in C in windows)?
:
13 isn't newline, but cariage return (returns cursor to first character). newline is 10. The distinction comes from the old mechanical type-writers. The string 'abc'#10'def' should look like this:
abc
   def

while 'abc'#13'def' is
def

and 'abc'#13#10'def' and 'abc'#10#13'def':
abc
def

KeyCode is the code, which is returned by the ReadKey() function. This function maps the "normal" keys to ASCII mapping, while the extended keys are mapped in a 16-bit code space.

Report
Re: Help with key codes Posted by IDK on 7 May 2006 at 2:50 AM
: : I don't know pascall, so if this seems completly wrong then don't read it
: :
: : No, 13 is the ascii for newline, the makecode for Enter is 36.
: : What does keycode really mean?
: : The return value of INT 21h,1 (aka getc() in C in windows)?
: :
: 13 isn't newline, but cariage return (returns cursor to first character). newline is 10. The distinction comes from the old mechanical type-writers. The string 'abc'#10'def' should look like this:

Oops, I mixed them up...

: KeyCode is the code, which is returned by the ReadKey() function. This function maps the "normal" keys to ASCII mapping, while the extended keys are mapped in a 16-bit code space.
:
:
OK, so then it's eqvivalent with INT 21h,1

Thanks and happy programming!!!



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.