VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've just been checking https://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html again.
And an AT keyboard image for reference:
https://en.wikipedia.org/wiki/Model_M_keyboar … IBM_Model_M.png

The documentation says that the fake shift up and down are sent with the grey keys (so the ones below the printscreen/scroll lock/pause keys). Why doesn't it do that for the lighter numlock area keys instead?
It doesn't make much sense to alter scancodes that don't apply to the numlock afaik? Or does it for some weird reason?

Edit: Although you wouldn't expect it to work that way, trying CheckIt with both numlock enabled and disabled the keys work as documented?
Tried all kinds of combinations (both host numlock on and off and client numlock on and off) and all of the numlock and non-numlock variants of the keys (home,insert,del,pgup,pgdn,arrow keys) all kept responding as they should (telling the CheckIt program to use the 104-key AT keyboard on a XT)?

Although I did manage to find and fix a bug in the accent grave key testing all keys, where the release XT code was incorrect (wrong value in scancode set 0).

Last edited by superfury on 2022-11-22, 10:26. Edited 1 time in total.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 6, by Jo22

User metadata
Rank l33t++
Rank
l33t++

That may not answer your question, but the LEDs on an AT keyboard can be software-controlled.

One of the terminal programs, Telex or Telemate, did feature this in the form of a running light..

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 2 of 6, by superfury

User metadata
Rank l33t++
Rank
l33t++
Jo22 wrote on 2022-11-22, 08:08:

That may not answer your question, but the LEDs on an AT keyboard can be software-controlled.

One of the terminal programs, Telex or Telemate, did feature this in the form of a running light..

The how does the keyboard know if it's supposed to add fake shift up and downs for numlocked keys?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 3 of 6, by Azarien

User metadata
Rank Oldbie
Rank
Oldbie
superfury wrote on 2022-11-22, 00:29:

That is not the original AT keyboard layout. This is:
https://en.wikipedia.org/wiki/Model_F_keyboar … inal_layout.png
As you can see, there's no separate navigational block, only the numpad.

Now if you re-read the "Fake shifts" section keeping in mind that the "old AT keyboard" they speak of is the Model F keyboard, while the Model M is "the new thing", it kinda start making sense.

The how does the keyboard know if it's supposed to add fake shift up and downs for numlocked keys?

The keyboard knows if its LEDs are lit. But their state is not toggled by the keys themselves, instead the key sends its scancode to the computer and the OS responds "turn this LED on/off".

Reply 4 of 6, by superfury

User metadata
Rank l33t++
Rank
l33t++
Azarien wrote on 2022-11-22, 15:48:
That is not the original AT keyboard layout. This is: https://en.wikipedia.org/wiki/Model_F_keyboar … inal_layout.png As you can […]
Show full quote
superfury wrote on 2022-11-22, 00:29:

That is not the original AT keyboard layout. This is:
https://en.wikipedia.org/wiki/Model_F_keyboar … inal_layout.png
As you can see, there's no separate navigational block, only the numpad.

Now if you re-read the "Fake shifts" section keeping in mind that the "old AT keyboard" they speak of is the Model F keyboard, while the Model M is "the new thing", it kinda start making sense.

The how does the keyboard know if it's supposed to add fake shift up and downs for numlocked keys?

The keyboard knows if its LEDs are lit. But their state is not toggled by the keys themselves, instead the key sends its scancode to the computer and the OS responds "turn this LED on/off".

OK. So it looks at the currently set keyboard NumLock LED and when it's set it adds the fake shifts when:
- Release left/right fake shift when off w/ left/right shift(temporarily undoing the shift).
- Press left fake shift when on w/o shift(forcing the shift).
- NumLock pad slash: release left/right shift w/ left/right shift(temporarily undoing the shift).

That's what my keyboard emulation is doing right now.

Is that correct?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 5 of 6, by superfury

User metadata
Rank l33t++
Rank
l33t++

Hmmm... I've read here that the Num Lock and Scroll Lock keys depress the control key.
Is that true? I've just implemented a plain LCTRL and RCTRL release when pressing the button, pressing it again when the key is released(only as long as rctrl and lctrl is still pressed).

Is that correct behaviour? I can't seem to find out anything about it in the other sources?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 6 of 6, by Azarien

User metadata
Rank Oldbie
Rank
Oldbie

I don't know all the details. However, this paper by Microsoft gives explicit scancode sequences for at least some of those special cases:

https://download.microsoft.com/download/1/6/1 … 6c/scancode.doc

No special treatment given to Scroll Lock, which probably means it's not required.