[comp.sys.atari.st] problem with interrupt programming

roeder@sbsvax.UUCP (Edgar Roeder) (10/19/89)

I have a serious problem with the keyboard interrupt and the 200 Hz timer.

What i want to do is the following:
	 Every time when a special key (eg. ^C) is pressed (thus giving a
	signal to the running program) call a 'signal-handler' (which may
	decide to not interpret the key). The signal-handler is provided
	by the actual running program. Also the special key to look for is
	specified by this program.
This is what i already have:
	 A new ikbdsys-handler calls first the old ikbdsys and then tests the
	character returned against a global var. When the special key is
	recognized and several other constraints are satisfied (the running
	process is my own program, there is no other signal pending and the
	user has not specified that the next character should be interpreted
	literally) a global flag is set.
	 Another routine in the VBL-queue checks the global flag and also some
	other conditions (again wether act_pd is my own program and the program
	was in user-mode when the VBL-routine is called) and then arranges
	everything such that the programs signal-handler is called after the
	VBL-interrupt is finished (with the same SR as before, especially the
	program is in user mode and so not at the os-level). Before the users
	handler is called, pending input is consumed with Bconstat/Bconin.
Now to the problem:
	When a key is pressed, ikbdsys is called. But when you hold down the
	key, thus getting another ^C via the keyboard repeat you don't get a
	new interrupt. This is because the keyboard repeat is done by the
	200 Hz system-timer interrupt.

????????????????????????????????????????????????????????????????????????????
?? How can i get ALL characters send to the Bios before they arrive there ??
?? and before they can be (mis-)interpreted by the operating system ???   ??
????????????????????????????????????????????????????????????????????????????

For example, when ^C is pressed during screen output (with Fwrite), it should
not be seen by the operating system (because the os would otherwise terminate
the actual program).
I know already how to use etv_term to ignore ^C. But i don't want to use this,
because i want to be able to interrupt a program at any time (even in the
middle of a large computation) and i want also be able to continue the program
after the ^C-signal (and getting another signal at once due to the keyboard
repeat). With my current implementation the repeated chars get through to the
user program where i have to interpret them a second time.

Does anybody out there know how to avoid this ?

	Hoping for an answer
		- Edgar