Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4095
Number of posts: 14004

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

Report
Multi-key Keyboard Handler Posted by Phat Nat on 6 Apr 2009 at 7:34 PM
This keyboard handler will handle (I think) up to 5 keys at a time and is WAY faster that the CRT unit keypressed/Readkey().
*NOTE* this is a keyboard handler, so if you don't end your program, it will have full control of the keyboard! no CTRL-ALT-DEL, etc ***

Example on how to use it:
USES KeyHandler;

Begin
     Set_New_Int9;
     Repeat
           If Keypressed Then
           Begin
              If Keys[kLeftCtrl] Then WriteLn('You pressed the Left Control Key');
              If Keys[k1] Then WriteLn('You pressed the Number 1 Key');
              If Keys[kUArrow] Then WriteLn('You pressed the Up Arrow Key');
           End;
     Until Keys[kESC] = true;
     Set_Old_Int9;
End.


This is a very basic example. Have fun and don't forget to keep it named KEYHANDL.PAS



 

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.