Disabling Keys In Turbo Pascal/C and sensing a key pressed. 
Author Message
 Disabling Keys In Turbo Pascal/C and sensing a key pressed.

Any help would be greatly appreciated!!!

I am currently writing programs in turbo c++ (v 1.0) and turbo Pascal (v 6.0).

I am looking for code or any suggestions on how to do the following..

1) Disable a key like the break key so you can't break out of my program..
or diable any other key..

2) Sense that a key has been pressed.. like if someome presses f1 then
a message appears on the screen or if you try to break it tells you, you
can't...

Thanks..


Brian

*-----------------------------------------------------------------------------*
*                                                                             *
*  Brian Popkin                                                               *
*  Computer Science Major - Systems Programing                                *
*  Old Dominion University                                                    *
*  Norfolk, {*filter*}ia USA                                                      *
*                                                                             *
*  Others Areas Of Interest: Artificial Intelligence, Expert Systems,         *
*                            Networks, And Telecommunications                 *
*                                                                             *



*                                                                             *
*-----------------------------------------------------------------------------*



Tue, 19 Oct 1993 02:53:19 GMT  
 Disabling Keys In Turbo Pascal/C and sensing a key pressed.

:

Quote:
>I am currently writing programs in turbo c++ (v 1.0) and turbo pascal (v 6.0).
>I am looking for code or any suggestions on how to do the following..
>1) Disable a key like the break key so you can't break out of my program..
>or diable any other key..

For Turbo Pascal the ubiquitous /pc/ts/tsfaq20.arc has information
about disabling the break key.  If you use ReadKey for reading
keystrokes, then simply omit the undesirable other key from your
test loop.  But if you use readln, then I don't know if there is any
answer.

Quote:
>2) Sense that a key has been pressed.. like if someome presses f1 then
>a message appears on the screen or if you try to break it tells you, you
>can't...

In TP one can use ReadKey (or interrupts if one wants to avoid using
the Ctr unit) to trap keys F1, or otherwise.  If the break has been
disabled as per item 1, pressing break or ^C will give ascii code
value #3.

...................................................................
Prof. Timo Salmi
Moderating at garbo.uwasa.fi anonymous ftp archives 128.214.12.37
School of Business Studies, University of Vaasa, SF-65101, Finland



Tue, 19 Oct 1993 18:43:45 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. F10 Key disabling the other keys

2. How to capture key-presses (keyboard-presses)???

3. Interfacing Turbo Prolog to Turbo Pascal of Turbo C

4. IBM VA close window upon key pressed event

5. Tracking key presses, mouse clicks and mouse movements?

6. many keys pressed at the same time

7. Command-key presses

8. Changing the cursor when control key pressed.

9. Key press events on a window

10. Selecting TAB sheet by pressing TAB key

11. Keycode() - Getting a response to a key press

12. Trapping a key press event

 

 
Powered by phpBB® Forum Software