For keyboard handling I always use an idea from Dbug, which consists in updating a virtual matrix of 1s and 0s representing the state of each key (pressed or released). This matrix is updated from the interrupt service routine. You can find the code in assembler here http://miniserve.defence-force.org/svn/ ... keyboard.s

The routine is called ReadKeyboard. There are also 3 more routines used to read a single key and return its ASCII code, with and without bouncing (repeating) and one to wait for a key press.

It is surely possible to add the Readkeyboard routine in asm to your C project and export the virtual matrix as a global C variable so you can use it from C. The ReadKeyboard routine should be called from the interrupt handler, but that can be done with the chain_irq library function or directly in asm in your project.

I could give some examples, but I am not near my laptop now. Holidays, you know

But for multi-key handling there is already another routine from Geoff Philips's
Oric Atmos and Oric 1 Graphics and Machine code techniques - in DF library (see chap.4).
The idea is to "ask" for status of particular key. Here is the code (ready for copy/paste):

But for multi-key handling there is already another routine from Geoff Philips's
Oric Atmos and Oric 1 Graphics and Machine code techniques - in DF library (see chap.4).
The idea is to "ask" for status of particular key. Here is the code (ready for copy/paste):

For keyboard handling I always use an idea from Dbug, which consists in updating a virtual matrix of 1s and 0s representing the state of each key (pressed or released). This matrix is updated from the interrupt service routine. You can find the code in assembler here http://miniserve.defence-force.org/svn/ ... keyboard.s

The routine is called ReadKeyboard. There are also 3 more routines used to read a single key and return its ASCII code, with and without bouncing (repeating) and one to wait for a key press.

It is surely possible to add the Readkeyboard routine in asm to your C project and export the virtual matrix as a global C variable so you can use it from C. The ReadKeyboard routine should be called from the interrupt handler, but that can be done with the chain_irq library function or directly in asm in your project.

I could give some examples, but I am not near my laptop now. Holidays, you know