Welcome, Guest. Please login or register.


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

Offline JSP

  • Newbie
  • Posts: 15
  • Country: dk
  • OS:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 58.0.3029.110 Chrome 58.0.3029.110
    • View Profile
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: 4756
  • OS:
  • Linux Linux
  • Browser:
  • Firefox 58.0 Firefox 58.0
    • View Profile
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.

Online Zozosoft

  • EP addict
  • *
  • Posts: 13081
  • Country: hu
  • OS:
  • Linux Linux
  • Browser:
  • Chrome 65.0.3325.109 Chrome 65.0.3325.109
    • View Profile
    • 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.