XT/AT/PS2/Terminal to USB Converter with NKRO
- IonutZ
- Location: Detroit
- Main keyboard: HHKB Pro 2 / 87u 55g
- Main mouse: RAT9
- Favorite switch: Topre / Buckling Spring
- DT Pro Member: -
- Contact:
You mean get a new teensy lol. What about DP DM for the actual keyboard being hooked up to the teensy?
- IonutZ
- Location: Detroit
- Main keyboard: HHKB Pro 2 / 87u 55g
- Main mouse: RAT9
- Favorite switch: Topre / Buckling Spring
- DT Pro Member: -
- Contact:
Of course not, I'm talking about which pinout on the teensy is for DP and which one is for DM...
PD0 = Data = DP
PD1 = Clock = DM
?
PD0 = Data = DP
PD1 = Clock = DM
?
- IonutZ
- Location: Detroit
- Main keyboard: HHKB Pro 2 / 87u 55g
- Main mouse: RAT9
- Favorite switch: Topre / Buckling Spring
- DT Pro Member: -
- Contact:
Yea but I want to use my USB 6kro keyboard to your converter to get NKRO... I understood this was possible.
- Soarer
- Location: UK
- Favorite switch: F
- DT Pro Member: -
As long as it supports NKRO over PS/2, sure. Then it connects to PD0 and PD1. To make the connection you could either...
a) use a passive USB-PS/2 adapter (the likes of which may have come with your keyboard) and a PS/2 socket wired to the Teensy,
b) remove the cable from your keyboard and wire the Teensy direct to the keyboard's controller, or
c) butcher the keyboard's cable and wire that to the Teensy.
In any of those cases, the keyboard attaches to PD0, PD1, +5V and GND, recognises that it's hooked up to a PS/2 port, and switches to that mode.
But I guess what you're asking is 'how is one of these passive thingies wired?'...
I reckon D+ is Clock, and D- is Data (from Holtek datasheet).
a) use a passive USB-PS/2 adapter (the likes of which may have come with your keyboard) and a PS/2 socket wired to the Teensy,
b) remove the cable from your keyboard and wire the Teensy direct to the keyboard's controller, or
c) butcher the keyboard's cable and wire that to the Teensy.
In any of those cases, the keyboard attaches to PD0, PD1, +5V and GND, recognises that it's hooked up to a PS/2 port, and switches to that mode.
But I guess what you're asking is 'how is one of these passive thingies wired?'...
I reckon D+ is Clock, and D- is Data (from Holtek datasheet).
- IonutZ
- Location: Detroit
- Main keyboard: HHKB Pro 2 / 87u 55g
- Main mouse: RAT9
- Favorite switch: Topre / Buckling Spring
- DT Pro Member: -
- Contact:
you were right! Made it work! Thanks Soarer.
- Muirium
- µ
- Location: Edinburgh, Scotland
- Main keyboard: HHKB Type-S with Bluetooth by Hasu
- Main mouse: Apple Magic Mouse
- Favorite switch: Gotta Try 'Em All
- DT Pro Member: µ
Blast! I figured it out. I was in the middle of writing this…
I still seek the illusive layer lock for my nonstandard stuff…
But now all is revealed. The combo Shift + Num Lock is recognised natively by the Mac and engages that integrated numpad anyway. In fact, I modified my layer 3 on purpose just to test, and the alterations are ignored: this numpad mode is independent of my code. Oh well. I thought I was onto something there!Okay, here's a weird one.
I recently picked up an SSK, and so I'd like to implement the integrated numberpad as suggested by its caps. (That's the usual square around the I key arrangement that I'm already used to from my PowerBook, which reuses 7,8,9 as the top row of a virtual pad.) As my function layer is already full of HHKB arrows and such, I made a new layer. And then I got cunning and tried to make a layer lock.
The SSK has a Num Lock key, so I tried to use it as the trigger. Those are ignored on the Mac (it reads the row above the Insert/Home/Page Up block as F13-15) so I wrote a macro which fires when Num Lock is pressed, and manipulates a virtual fn3 key. Actually, I wrote two macros: one to press the fn3 key (using the MAKE command) and another to release it (using BREAK), the difference being Shift. But to my surprise I found that the MAKE macro was ignored entirely and the BREAK one is enough to act as a toggle by itself!
Here's my code.Code: Select all
layerblock fn1 1 fn2 1 # One for each hand, where available fn1 fn2 2 # Press them both for a hard to reach second layer fn3 3 # Numlock layer lock virtual key endblock remapblock layer 3 # SSK Num Lock Layer j pad_1 k pad_2 l pad_3 u pad_4 i pad_5 o pad_6 7 pad_7 8 pad_8 9 pad_9 m pad_0 period pad_period minus pad_minus equal pad_plus semicolon pad_asterix slash pad_slash endblock macroblock # Don't know what's going on, but simply breaking fn3 is acting as a toggle! # Num Lock = Layer 3 lock # macro scroll_lock -shift # make fn3 # endmacro # This one works, both ways!? # Num Lock = Layer 3 lock macro scroll_lock break fn3 endmacro endblock
I still seek the illusive layer lock for my nonstandard stuff…
- Halvar
- Location: Baden, DE
- Main keyboard: IBM Model M SSK / Filco MT 2
- Favorite switch: Beam & buckling spring, Monterey, MX Brown
- DT Pro Member: 0051
That's interesting -- definitely doesn't work in Windows. Are you sure that this shift-numpad mode isn't just a feature of the SSK controller? I can't test it myself because I don't use the original SSK controller in mine, but I coould imagine that the SSK controller has it own layering and sends scancodes of numpad keys when shift+num_lock was pressed (which in fact is shift+scroll_lock on the SSK).Muirium wrote: But now all is revealed. The combo Shift + Num Lock is recognised natively by the Mac and engages that integrated numpad anyway.
Does it work with every keyboard on your Mac?
- Muirium
- µ
- Location: Edinburgh, Scotland
- Main keyboard: HHKB Type-S with Bluetooth by Hasu
- Main mouse: Apple Magic Mouse
- Favorite switch: Gotta Try 'Em All
- DT Pro Member: µ
Good question! I have my homemade 60% plugged in now (running Soarer's Controller beta) and I've been furtively trying to pull off the same trick with it, but no success so far. Perhaps there is an IBM dimension to this cunning logicus!
- Soarer
- Location: UK
- Favorite switch: F
- DT Pro Member: -
Yup, whatever the SSK does for its numpad, it does it itself. I don't think it depends on numlock state. For remapping etc., treat the SSK just like a full-sized keyboard, and live with not being able to change the shift+numlock behaviour.
Re. make/break FN3 in a macro - won't work. See the dataflow diagram
Re. make/break FN3 in a macro - won't work. See the dataflow diagram
- Muirium
- µ
- Location: Edinburgh, Scotland
- Main keyboard: HHKB Type-S with Bluetooth by Hasu
- Main mouse: Apple Magic Mouse
- Favorite switch: Gotta Try 'Em All
- DT Pro Member: µ
Yeah, I figured after this that whatever I was doing, I was doing it wrong!Soarer wrote:Re. make/break FN3 in a macro - won't work. See the dataflow diagram
hid_listen shows the SSK at its work. Num Lock is on the same key as Scroll Lock (usual for PC boards, right?) but accessed with a shift. On my Acer switch PS/2 keyboard, that key sends 0x47 (SCROLL_LOCK) whether shift it pressed or not. But on the SSK, 0x47 becomes 0x53 (NUM_LOCK) when shift is pressed too. Not only that, but 7,8,9 are converted to pad_7, pad_8, pad_9 and so on. IBM's doing, not mine. But needless to say I like it!
- Soarer
- Location: UK
- Favorite switch: F
- DT Pro Member: -
I don't have a 64-bit install to try things out on, but something like this might help:
Otherwise, the tools ought to be fairly to compile, especially scas and scdis which don't even use the HID library. What errors do you get?
Code: Select all
apt-get install ia32-libs-multiarch
- urbancamo
- Location: Windermere, UK
- Main keyboard: HHKB PRo 2
- Main mouse: Kensington Pro
- Favorite switch: Topre
- DT Pro Member: -
- Contact:
Hi Soarer,
Have you tried the PS/2 variant of the DEC/HP LK series of keyboards at all? I have plugged an LK461-A2 into your converter and it works reasonably well, but not well enough to distinguish between all the keys. These keyboards have an OpenVMS layout, and I believe they work using scan code set 3.
When I set config to force set 3 it worked reasonably well, but I got stuck when I started looking at the higher keys such as F19,F20 and the PF1-PF4 keys. Also, there is a key unshifted is < and shifted is > - wasn't sure how that would work.
I'd be happy to lend you one to get it going with Or I could dump out the hid_listen output for each key if that would help.
Regards, Mark
Have you tried the PS/2 variant of the DEC/HP LK series of keyboards at all? I have plugged an LK461-A2 into your converter and it works reasonably well, but not well enough to distinguish between all the keys. These keyboards have an OpenVMS layout, and I believe they work using scan code set 3.
When I set config to force set 3 it worked reasonably well, but I got stuck when I started looking at the higher keys such as F19,F20 and the PF1-PF4 keys. Also, there is a key unshifted is < and shifted is > - wasn't sure how that would work.
I'd be happy to lend you one to get it going with Or I could dump out the hid_listen output for each key if that would help.
Regards, Mark
- urbancamo
- Location: Windermere, UK
- Main keyboard: HHKB PRo 2
- Main mouse: Kensington Pro
- Favorite switch: Topre
- DT Pro Member: -
- Contact:
OK, I'll make a table up with HID output. The LK450 which is the same layout but designed (more) to work with PCs works OK - I was successfully able to map everything well enough to work with Reflection terminal software. The ESCAPE key and PF1 key both send ESCAPE - I don't think there is any way round that however.
Thanks, Mark.
Thanks, Mark.
- PJE
- Location: Michigan, USA
- Main keyboard: Happy Hacking 2 Lite
- Main mouse: Microsoft 4000
- DT Pro Member: -
Hi Soarer, apologies if this has been discussed on the thread. I'm on my tablet at the moment and it's a little slow scanning through the thread...
Question: Is it possible to use any other pins for the keyboard input, or are you using the I2C hardware within your code?
The reason I ask is that I'd love to look at incorporating your converter into a modified OneHand keyboard. I'd like to keep away from the I2C and Serial pins as I was planning on using them for displays and a Twiddler V1 converter. I'm also planning on using a Pro Micro board rather than the Teensy which reduces the available I/O.
Keep up the excellent work. You're documentation is on a totally different level to what I'm used to!
Question: Is it possible to use any other pins for the keyboard input, or are you using the I2C hardware within your code?
The reason I ask is that I'd love to look at incorporating your converter into a modified OneHand keyboard. I'd like to keep away from the I2C and Serial pins as I was planning on using them for displays and a Twiddler V1 converter. I'm also planning on using a Pro Micro board rather than the Teensy which reduces the available I/O.
Keep up the excellent work. You're documentation is on a totally different level to what I'm used to!
- PJE
- Location: Michigan, USA
- Main keyboard: Happy Hacking 2 Lite
- Main mouse: Microsoft 4000
- DT Pro Member: -
I understand.Soarer wrote:There's one big problem with that idea - I haven't released the source code yet, and no idea when I will!
Theoretically, could your software be modified to work from any pin pair, or do you need specific functions associated with the I2C pins? I suppose I could look at the PS/2 keyboard timing.
I'm making a RS232 to USB converter for an old Handkey Twiddler V1 (which can also be used for serial Bar Code scanners), and thought about adding it to my OneHand design. At that point it would also make sense to add a PS/2 input capability as well, which would allow a PS/2 keyboard to be used to configure the chords on the OneKey using a simple press PS/2 key followed by OneKey chord... I could also pass the RS232, PS/2 and OneHand characters through the same Macro function block before sending it to USB.
I use I2C on my OneHand to connect an OLED display and also a second OneHand to make a split keyboard, so the I2C pins are not available for the PS/2 interface.
- PJE
- Location: Michigan, USA
- Main keyboard: Happy Hacking 2 Lite
- Main mouse: Microsoft 4000
- DT Pro Member: -
Thanks for the response.Soarer wrote:The data signal could use any pin, but for my code the clock signal needs to be on an pin capable of generating interrupts on both low-high and high-low edges. So that's one of PD0..3 or PE6, on an ATmega32U4.
I may look at making my own much simpler PS/2 keyboard converter, my current design has a few pins including PE6 free. I'm using both the serial and i2c interfaces, but my design has a few pics available.
-
- Location: Houston, Texas
- Main keyboard: IBM Bigfoot
- Main mouse: CST trackball
- Favorite switch: IBM Model F
- DT Pro Member: -
I'm having trouble getting a macro working the way I want. What I want to do is remap the "Rule" key on a 122-key Model M terminal (the key in the middle of the cursor cluster) to HOME and make ALT-RULE send END.
Remapping "Rule" was no problem:
But when I try to add a macro to make ALT-HOME send END:
If I now type ALT-HOME, here is what hid_listen reports:
This seems to have the desired effect, i.e., the cursor goes to the end of the line in a text editor. Do I understand the hid_listen output correctly in that the Teensy is sending the sequence dE2 d4D u4D uE2 to the computer? If this is the case, then the computer should be seeing ALT-END and not END. If I actually press ALT-END on the keyboard, I get the following hid_listen output:Which would seem to be sending the same sequence to the computer; however, in this case nothing happens, as expected. The cursor does not move to the end of the line because it does not have a translatable action for ALT-END. This would be nothing but an academic curiosity except that now I want to be able to use additional meta keys in combination with ALT-HOME. For example, if I hit SHIFT-ALT-HOME, I would expect the computer to see SHIFT-END. In this case, hid_listen reports the following:
...and the cursor goes to the end of the line, but without selecting text, as if the shift wasn't pressed. Am I doing something wrong or am I not understanding hid_listen output correctly? Thanks for your help.
Remapping "Rule" was no problem:
Code: Select all
remapblock
LANG_4 HOME
endblock
Code: Select all
macroblock
macro HOME ALT
PUSH_META CLEAR_META ALL
PRESS END
POP_ALL_META
endmacro
endblock
Code: Select all
r19 +E2 dE2
r6E +4A d4D u4D
rF0 r6E -4A
rF0 r19 -E2 uE2
Code: Select all
r19 +E2 dE2
r65 +4D d4D
rF0 r65 -4D u4D
rF0 r19 -E2 uE2
Code: Select all
r12 +E1 dE1
r19 +E2 dE2
r6E +4A d4D u4D
rF0 r6E -4A
rF0 r19 -E2 uE2
rF0 r12 -E1 uE1
Last edited by quantalume on 17 Apr 2014, 23:19, edited 1 time in total.
-
- Location: Houston, Texas
- Main keyboard: IBM Bigfoot
- Main mouse: CST trackball
- Favorite switch: IBM Model F
- DT Pro Member: -
I was able to achieve the desired outcome by adding another macro:I needed to provide a macro for the particular case of SHIFT-ALT-HOME. Apparently my interpretation of the hid_listen output is incorrect. It is not actually sending all codes preceded by u or d to the computer.
Code: Select all
macroblock
macro HOME SHIFT ALT
PUSH_META CLEAR_META ALL
SET_META SHIFT
PRESS END
POP_ALL_META
endmacro
macro HOME ALT
PUSH_META CLEAR_META ALL
PRESS END
POP_ALL_META
endmacro
endblock
-
- Main keyboard: IBM XT
- Main mouse: IBM PC
- Favorite switch: Buckling Spring
- DT Pro Member: -
IBM XT SPANISH LAYOUT
Soarer’s converter works great, but found some problems to adapt to (1986) Spanish layout
Retrete (from spanish MEDIAVIDA) hinted me to ask Soarer directly for a solution…
1) Got this wonderful XT keyboard with this unusual Spanish layout (that I’d love to use):
https://plus.google.com/u/0/photos/1054 ... 1264614145
2) Once I installed the Teensy 2.0 with the "Soarer_at2usb_v1.12_atmega32u4.hex" file, I got this outcome:
3) By trial and error, from other .sc files, I’ve prepared the following SPANISH-XT.SC file, using also macro coding (it works, but I need some help to solve the remaining problems):
4) The main problem is that HID codes for the sustitutions (a) does not separate lower characters in each key from the UPPER ones, and (b) they are based on the US layout.
Problems remaining:
How to get that Shift+1 gives [¡] (Spanish opening exclamation)
Idem Shift+3 to get #
How to get that the = + key gives that, and not [¡] y [¿]
How to get that the [;] key gives that, and not [,] (but its capital is giving me [:] correctly …)
Any idea for this? Someone worked out other layouts than the US? - Ah, and a big thank you to Soarer (and Retrete).
Soarer’s converter works great, but found some problems to adapt to (1986) Spanish layout
Retrete (from spanish MEDIAVIDA) hinted me to ask Soarer directly for a solution…
1) Got this wonderful XT keyboard with this unusual Spanish layout (that I’d love to use):
https://plus.google.com/u/0/photos/1054 ... 1264614145
Code: Select all
¡ ¿ # $ % / & * ( ) ? +
1 2 3 4 5 6 7 8 9 0 ' =
Q W E R T Y U I O P : ^
q w e r t y u i o p ; `
A S D F G H J K L Ñ ¨ Ç
a s d f g h j k l ñ ´ ç
> Z X C V B N M " ! _
< z x c v b n m , . -
Code: Select all
! ” • $ % & / ( ) = ? ¿
1 2 3 4 5 6 7 8 9 0 ’ ¡
Q W E R T Y U I O P ^ *
q w e r t y u i o p ` +
A S D F G H J K L Ñ ¨ ª
A s d f g h j k l ñ ´ º
Ç Z X C V B N M ; : _
ç z x c v b n m , . -
Code: Select all
### IBM XT KEYBOARD QWERTY SPANISH
force set1
ifkeyboard any
ifselect any
# 83-key mappings
# On the XT, the ~/` key is located next to '/", and the key next to lshift is \|
# Remap this to match modern ISO layout
remapblock
layer 0
BACK_QUOTE BACKSLASH
BACKSLASH EUROPE_2
F10 FN1 # need to map the FN key into the base layer (0)
endblock
# Match the SPANISH XT's unusual legends
macroblock
# PROBLEM
# How to get [¡] when pressing Shift+1 ?
# Shift+2 = ¿
macro 2 shift -ctrl -alt
press EQUAL
endmacro
# Alt+Ctrl+2 = @
macro 2 -shift ctrl alt
push_meta set_meta
press 2
pop_meta
endmacro
# PROBLEM
# Shift+3 = #
macro 3 shift -ctrl -alt
press 3 # What I get is [•] (but I can get [#] withAlt+Ctrl+3)
endmacro
# Shift+6 = /
macro 6 shift -ctrl -alt
press 7
endmacro
# Shift+7 = &
macro 7 shift -ctrl -alt
press 6
endmacro
# Shift+8 = *
macro 8 shift -ctrl -alt
press RIGHT_BRACE
endmacro
# Shift+9 = (
macro 9 shift -ctrl -alt
press 8
endmacro
# Shift+0 = )
macro 0 shift -ctrl -alt
press 9
endmacro
# PROBLEM
# The key to the left of BACKSPACE should give [=] and [+], but I stil get [¡] y [¿]
# macro EQUAL -shift -ctrl -alt
# press EQUAL
# endmacro
# PROBLEM
# I can't get [;] in lower case (but I do get [:] in the upper)
macro LEFT_BRACE -shift -ctrl -alt
press COMMA
endmacro
# Shift+; = :
macro LEFT_BRACE shift -ctrl -alt
press PERIOD
endmacro
# Shift+, = ”
macro COMMA shift -ctrl -alt
press 2
endmacro
# ‘
macro RIGHT_BRACE -shift -ctrl -alt
press LEFT_BRACE
endmacro
# ^
macro RIGHT_BRACE shift -ctrl -alt
press LEFT_BRACE
endmacro
# [
macro QUOTE -shift ctrl alt
push_meta set_meta
press LEFT_BRACE
pop_meta
endmacro
# Shift+. = !
macro PERIOD shift -ctrl -alt
press 1
endmacro
# Alt+Ctrl < = \
macro EUROPE_2 -shift ctrl alt
push_meta set_meta
press BACK_QUOTE
pop_meta
endmacro
# PrtSc macro
macro PAD_ASTERIX shift
press PRINTSCREEN
endmacro
endblock
Problems remaining:
How to get that Shift+1 gives [¡] (Spanish opening exclamation)
Idem Shift+3 to get #
How to get that the = + key gives that, and not [¡] y [¿]
How to get that the [;] key gives that, and not [,] (but its capital is giving me [:] correctly …)
Any idea for this? Someone worked out other layouts than the US? - Ah, and a big thank you to Soarer (and Retrete).
Last edited by jorgej on 27 May 2014, 13:28, edited 1 time in total.
- Muirium
- µ
- Location: Edinburgh, Scotland
- Main keyboard: HHKB Type-S with Bluetooth by Hasu
- Main mouse: Apple Magic Mouse
- Favorite switch: Gotta Try 'Em All
- DT Pro Member: µ
Have you set a Spanish keyboard layout on your computer? For characters like ¡ you need a software layout with them available, first.
-
- Main keyboard: IBM XT
- Main mouse: IBM PC
- Favorite switch: Buckling Spring
- DT Pro Member: -
Yes Mu, my keyboard is working fine with an Spanish layout in Windows XP (for example, I got the Ñ and the question opening mark (¿).
At this point (using macro remapping) I'm stuck with the problem with HID codes (for the substitutions (a) does not separate normal characters from the CAPITALS, and (b) they are based on the US layout).
At this point (using macro remapping) I'm stuck with the problem with HID codes (for the substitutions (a) does not separate normal characters from the CAPITALS, and (b) they are based on the US layout).
- Muirium
- µ
- Location: Edinburgh, Scotland
- Main keyboard: HHKB Type-S with Bluetooth by Hasu
- Main mouse: Apple Magic Mouse
- Favorite switch: Gotta Try 'Em All
- DT Pro Member: µ
Where is ¡ on your computer's software layout? (A diagram would be good.) Because the idea is to use macros to simulate the same combinations when Shifted legends need moved.
Also, I don't think you need these opening lines:
The ifs are for handling multiple keyboards (like I do with my boxed converter).
Also, I don't think you need these opening lines:
Code: Select all
force set1
ifkeyboard any
ifselect any
-
- Main keyboard: IBM XT
- Main mouse: IBM PC
- Favorite switch: Buckling Spring
- DT Pro Member: -
First of all, thanks for your help, MU.
1) Ok to the ifs, I'll get rid of them
2) My ¡ is in the uppercase of the 1 . Here you have my keyboard as I see it now:
1) Ok to the ifs, I'll get rid of them
2) My ¡ is in the uppercase of the 1 . Here you have my keyboard as I see it now:
Code: Select all
¡ ¿ # $ % / & * ( ) ? +
1 2 3 4 5 6 7 8 9 0 ' =
Q W E R T Y U I O P : ^
q w e r t y u i o p ; `
A S D F G H J K L Ñ ¨ Ç
a s d f g h j k l ñ ´ ç
> Z X C V B N M " ! _
< z x c v b n m , . -
Last edited by jorgej on 27 May 2014, 14:36, edited 1 time in total.