Welcome, Guest. Please login or register.


Author Topic: Use of KEYBOARD: device (Read 2808 times)

Offline JSP

  • Beginner
  • *
  • Posts: 27
  • Country: dk
Use of KEYBOARD: device
« 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

Offline IstvanV

  • EP addict
  • *
  • Posts: 4822
Re: Use of KEYBOARD: device
« Reply #1 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.

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14775
  • Country: hu
    • http://enterprise.iko.hu/
Re: Use of KEYBOARD: device
« Reply #2 on: 2018.April.16. 20:23:20 »
Also very know solution search the existing keyboard channel.