Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2004-07

how-to disable CTRL-C in readkey

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jose Pascual

Hi,

I have a program which use keypressed and readkey (crt unit) in linux. When I press CTRL-C readkey return #3. It's okey and working but I like to disable this option in keyboard subsystem because I want to use my only CTRL-C function.

I have implemented my function for signal SIGINT but I think keyboard subsystem is caching this signal and it doesn't reach to the my function.

best regards

Reply by email

Michael Van Canneyt
to Jose Pascual
Jose Pascual wrote 10 lines
Hi, I have a program which use keypressed and readkey (crt unit) in linux. When I press CTRL-C readkey return #3. It's okey and working but I like to disable this option in keyboard subsystem because I want to use my only CTRL-C function. I have implemented my function for signal SIGINT but I think keyboard subsystem is caching this signal and it doesn't reach to the my function.

This is correct.

The CRT unit puts the terminal in RAW mode, and then the the CTRL-C key combination is not mapped to SIGINT any more. (normally the shell handles this). So if you want to use CTRL-C, just react to key #3.

Michael.

Reply by email