Enterprise Forever

:UK => Programming => Topic started by: JSP on 2018.April.16. 18:49:19

Title: Use of KEYBOARD: device
Post by: JSP on 2018.April.16. 18:49:19
Hi

I am a bit curious about how to reopen the KEYBOARD: device in MC code. In my scenario I work from ISDOS. I am aware that only one keyboard channel can be open at any time

Obviously the keyboard driver is initially active via the EDITOR: when working from ISDOS.

First I disable interrupts, then I read the $KEY_EDIT EXOS variable to find the existing keyboard device channel. I use this value to close the keyboard channel. Both actions return code 0 (no error).

Then I attempt to open a new keyboard channel (HL equals bytestring...... 9,"KEYBOARD:"). This fails. Return code is different from 0.

Is there some mechanism that keeps the default keyboard channel open at all times in ISDOS.

I can of  course make EXOS call 5 to read the keyboard by using the channel no from the $KEY_EDIT EXOS variable or use I/O ports directly. I just wanted to try using another channel.

I have seen some examples of code that opened another channel for the keyboard. Yet their code did not close the default channel, and only one channel can be used at any time. So what am I missing?

regards
Jesper
Title: Re: Use of KEYBOARD: device
Post by: IstvanV on 2018.April.16. 20:15:25
Then I attempt to open a new keyboard channel (HL equals bytestring...... 9,"KEYBOARD:"). This fails. Return code is different from 0.

The address of the file or device name needs to be passed in DE. If you used HL in the code, that could have caused the error.
Title: Re: Use of KEYBOARD: device
Post by: Zozosoft on 2018.April.16. 20:23:20
Also very know solution search the existing keyboard channel.