Author Topic: USBKBD now supports multimedia keys and system keys, but ...  (Read 8871 times)

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
USBKBD now supports multimedia keys and system keys, but ...
« on: October 28, 2018, 07:07:43 pm »
I finally managed to get USBKBD.SYS to properly recognize and translate the additional keyboard keys (like fast forward, WWW home etc.).
USBKBD.SYS will now properly read these keys and translate them to the proper PS/2 make and break scancodes as defined in this document:
https://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/translate.pdf

But we now have this limitation: the created PS/2 scancodes are passed to IBMKBD.SYS. It now appears that the scancode range that is now possible exceed that of what IBMKBD.SYS can handle. There are now scancodes that need 2 bytes to be fully represented which IBMKBD.SYS does not properly handle.

Is there an interest to have the full key range ? That would require to rework IBMKBD.SYS.

What does work already is to register these keys as new function keys if you have XWorkplace installed.
And use them from the "symbol" page in the setup notebook. For example I have registered the "WWW home" key to start my Firefox object.
« Last Edit: October 28, 2018, 07:37:20 pm by Lars »

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: USBKBD now supports multimedia keys and system keys, but ...
« Reply #1 on: October 29, 2018, 03:10:53 am »
Hi Lars

Having a Wireless/PS2 connected keyboard with a few extra keys that are not seen by OS/2 I would certainly appreciate an updated IBMKBD.SYS if you are thinking of building that driver.

The keyboard is a Logitech Wireless Desktop Comfort Laser https://support.logitech.com/en_gb/product/cordless-desktop-comfort-laser

Regards

Pete

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: USBKBD now supports multimedia keys and system keys, but ...
« Reply #2 on: October 29, 2018, 11:27:00 am »
After having a brief look into the IBMKBD.SYS code I think it's even more involved:

USBKBD.SYS calls into IBMKBD.SYS which calls into KBDBASE.SYS.

I have to admit that currently I have no clue of WHAT exactly would need to be updated WHERE to have, for example, the F13 - F24 keys available in a PM application.
There are virtual PM keycodes for the F13 - F24 keys (which abstract from these stupid PS/2 scancodes which is a good thing) but I have no clue how KBDBASE.SYS would create these virtual PM keycodes / how KBDBASE.SYS interfaces with PM.

But as I said: it should be possible via XWorkplace to register these multimedia keys and use them to start objects, for example.
« Last Edit: October 29, 2018, 11:29:37 am by Lars »

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: USBKBD now supports multimedia keys and system keys, but ...
« Reply #3 on: October 29, 2018, 07:18:14 pm »
Hi Lars

Using xWorkplace almost all extra keys on this keyboard are seen; the exception is the "4" key in the "Presets" group at the top of the keyboard which is simply not seen at all - no scan code when pressed.


Regards

Pete



Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: USBKBD now supports multimedia keys and system keys, but ...
« Reply #4 on: October 29, 2018, 10:04:46 pm »
Are you using the AN drivers ? They might have fixed that problem already, I don't know.
The only thing I can say is that finally all the media keys on my keyboard are supported. Even the "Volume Up/Volume Down" spin knob.

xynixme

  • Guest
Re: USBKBD now supports multimedia keys and system keys, but ...
« Reply #5 on: October 31, 2018, 06:00:43 am »
I have no clue how KBDBASE.SYS would create these virtual PM keycodes / how KBDBASE.SYS interfaces with PM.

Does that matter? AFAICT the OS/2 toolkit is aware of F13-F24, so perhaps all you need is a PM app which supports (processes) those keys. If you write a PM app which uses F12 to produce a DosBeep(), then e.g. replacing VK_F12 bij VK_F24 may be all it takes to use F24 instead of F12 to produce the beep. FWIW, for one I don't have such a keyboard.

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: USBKBD now supports multimedia keys and system keys, but ...
« Reply #6 on: October 31, 2018, 06:19:45 am »
Hi Lars

Yes, using AN drivers on ArcaOS5.

I'll have to boot windows sometime and check that the "Presets 4" key actually works I guess as it is the only key not seen by xWorkplace.


Regards

Pete

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: USBKBD now supports multimedia keys and system keys, but ...
« Reply #7 on: October 31, 2018, 09:09:00 am »
I have no clue how KBDBASE.SYS would create these virtual PM keycodes / how KBDBASE.SYS interfaces with PM.

Does that matter? AFAICT the OS/2 toolkit is aware of F13-F24, so perhaps all you need is a PM app which supports (processes) those keys. If you write a PM app which uses F12 to produce a DosBeep(), then e.g. replacing VK_F12 bij VK_F24 may be all it takes to use F24 instead of F12 to produce the beep. FWIW, for one I don't have such a keyboard.

so you think only because IBM defined virtual keycodes for F13-F24 that these are supported ? Dream on.
Fact is, the OS/2 keyboard drivers support the keys that existed 20 years ago. For everything that is newer, I would not count on it.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: USBKBD now supports multimedia keys and system keys, but ...
« Reply #8 on: October 31, 2018, 01:48:16 pm »
Hi Lars.

I guess that the latest USBKBD.SYS you are talking about is available from the usbdrv224 version, right?
I want to give it a try with some USB keyboards that have special keys and see the results. I no longer have any PS2 keyboards on "production"

Regards
« Last Edit: October 31, 2018, 02:59:10 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

xynixme

  • Guest
Re: USBKBD now supports multimedia keys and system keys, but ...
« Reply #9 on: October 31, 2018, 02:19:17 pm »
so you think only because IBM defined virtual keycodes for F13-F24 that these are supported ? Dream on.[/qoute]

Please don't make up what I'm, according to you, thinking and dreaming.

Quote
Fact is, the OS/2 keyboard drivers support the keys that existed 20 years ago. For everything that is newer, I would not count on it.

If anything I would count on OS/2 apps supporting the usual number of IBM PC F-keys, which was 12. Even 20 years ago.

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: USBKBD now supports multimedia keys and system keys, but ...
« Reply #10 on: October 31, 2018, 09:38:57 pm »
Hi Lars.

I guess that the latest USBKBD.SYS you are talking about is available from the usbdrv224 version, right?
I want to give it a try with some USB keyboards that have special keys and see the results. I no longer have any PS2 keyboards on "production"

Regards
No. It is going to be in 225.

Valery Sedletski

  • Sr. Member
  • ****
  • Posts: 368
  • Karma: +2/-0
    • View Profile
Re: USBKBD now supports multimedia keys and system keys, but ...
« Reply #11 on: November 01, 2018, 01:47:45 am »
Hi Lars! This is cool feature to have all keys on the keyboard working. I have Logitech K800 wireless USB keyboard, which, together with Logitech M280 USB wireless mouse, are connected to a Logitech Unifying wireless transceiver. Since these two devices are paired with the transceiver with a windows utility, they work in any OS without additional drivers (unlike bluetooth devices, which require a bluetooth stack). So, this setup works just fine in OS/2. I'd like to test your drivers with this keyboard later and see, how it works.

As for the question how keyboard drivers interface with PM, and how scancodes are translated to PM virtual keycodes, I don't know exactly. But what I know that there is kbdbase.sys and ibmkbd.sys. The 1st one seems to be a hardware-independent driver, the second one is a hardware dependent driver. And also, there is usbkbd.sys, which handles USB devices.

For mouse support, it is similar way too. There is mouse.sys (or amouse.sys which is a mouse.sys replacement with extra features), which is a hardware-independent mouse driver with support for some hardware built-in. There are additional hardware-dependent drivers, like pclogic.sys and rodent.sys, which add support for additional hardware. They communicate with mouse.sys via IDC and parse the input events, then inject them into mouse.sys. I think, usbmouse.sys also does the same thing for standard USB mice.

I think, the same way usbkbd.sys should work with kbdbase.sys/ibmkbd.sys, injecting extra input events into them. (maybe, ibmkbd.sys is for PS/2 keyboards, only, but I'm not sure).

For a PM input events queue, there is also pmdd.sys (aka \dev\singleq$, the famous OS/2 PM single input queue). It communicates with mouse.sys and kbdbase.sys via IDC, and it is a source for PM input events. So, it merges the input events from different sources, like mouse, keyboard, touchscreen etc. Where the scancode translation to PM scan codes occurs, I'm not sure, but probably, it occurs in pmdd.sys.