XT/AT/PS2/Terminal to USB Converter with NKRO

I am honestly surprised that this is so easy!

Thank you for all of your help :D
sealclubber

Unread post04 Oct 2012, 19:43

X
sealclubber
 
Posts: 6
Joined: 04 Oct 2012, 16:40
Main keyboard: IBM Model M 1390876
Main mouse: N/A
Favorite switch: Space!
Club member: -
 
Cool! :D

I made a little mistake in the last three macros - well, not really a mistake, but... when setting modifiers it's usually more appropriate to just set one of them! So I've edited it now to say ASSIGN_META LCTRL instead of ASSIGN_META CTRL, which would make both controls. (Conversely, when clearing modifiers it's best to do both, so CLEAR_META SHIFT is correct in the other macro).
Soarer
User avatar

Unread post04 Oct 2012, 20:59

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
Heh, another minor mistake... the code prefixed by 'd' is after remapping. The one you want for remapping begins with a '+'. Of course, it's the same code if you haven't loaded any remappings!
Soarer
User avatar

Unread post05 Oct 2012, 17:57

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
Gotcha. Just popped in again to tell you everything is working all nice and smooth. The original ideas for remapping most of those other keys was because I thought my control key didn't work... thankfully it was just a matter of cleaning out the housing and it's working nicely now.

Thank you again for all of your great help sir!
sealclubber

Unread post05 Oct 2012, 22:38

X
sealclubber
 
Posts: 6
Joined: 04 Oct 2012, 16:40
Main keyboard: IBM Model M 1390876
Main mouse: N/A
Favorite switch: Space!
Club member: -
 
Aha, well, that's even better!

...

I finally finished my set of adapters...

converter_and_adapters.jpg

... by finding an ethernet extension cable and butchering it :D
Soarer
User avatar

Unread post06 Oct 2012, 00:05

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
feature request:

i know that all of the guys that like trackpoints would like to see a PS2 pass through and keyboard equivalent to left, right, center mouse buttons. i personally am not a trackpoint fan, but i would like to make this:
track.JPG
wcass
User avatar

Unread post26 Oct 2012, 04:59

User avatar
X
wcass
 
Posts: 450
Joined: 27 Nov 2011, 21:18
Location: Fort Lauderdale, FL, USA
Main keyboard: ibm model m
Main mouse: kensington expert mouse
Favorite switch: buckeling spring
Club member: 0185
 
Hmm. I might add mousekeys functions at some point (similar to hasu's code), but I'm not sure there's much benefit to adding another PS/2 input for pointer devices (apart from neatness) since existing converters work pretty well for them.
Soarer
User avatar

Unread post26 Oct 2012, 16:55

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
Soarer wrote:Hmm. I might add mousekeys functions at some point (similar to hasu's code), but I'm not sure there's much benefit to adding another PS/2 input for pointer devices (apart from neatness) since existing converters work pretty well for them.

a trackpoint mod would have bare leads rather than a proper PS2 plug. yes, i could cram a plug, PS2/USB converter, and USB hub and teensy adapter into my jumbo keyboard case, and finally run a single USB out of the case - but it would be better if i could just go from bare lead on trackpoint to bare lead on teensy. hasu included this feature with his origional code, but last i heard he had not used it in a while - but i don't think he is a trackpoint fan.
wcass
User avatar

Unread post26 Oct 2012, 21:15

User avatar
X
wcass
 
Posts: 450
Joined: 27 Nov 2011, 21:18
Location: Fort Lauderdale, FL, USA
Main keyboard: ibm model m
Main mouse: kensington expert mouse
Favorite switch: buckeling spring
Club member: 0185
 
wcass wrote:a trackpoint mod would have bare leads rather than a proper PS2 plug. yes, i could cram a plug, PS2/USB converter, and USB hub and teensy adapter into my jumbo keyboard case, and finally run a single USB out of the case - but it would be better if i could just go from bare lead on trackpoint to bare lead on teensy. hasu included this feature with his origional code, but last i heard he had not used it in a while - but i don't think he is a trackpoint fan.

Are you sure? I'd only spotted the Mouse Keys ("You can emulates mouse move and button click using keyboard"), and I recall him saying he didn't really find it as useful as he thought it would be.

I know it would be better for you, but you'll need to get a bunch more people to ask for it because it would be quite a lot of work for me! :evilgeek:
Soarer
User avatar

Unread post26 Oct 2012, 22:23

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
https://github.com/tmk/tmk_keyboard - Features section, 5th bullet item.
if you have a copy of his code, look for ps2_mouse.c and ps2_mouse.h and maybe usb_mouse.c and h

i dreamt up the idea for the 92key+trackball after reading his feature set but i don't have the programming skill to actually use it (i tried!). i did not have any problems building and customizing your code though and used it for 3 keyboards now.
wcass
User avatar

Unread post27 Oct 2012, 00:43

User avatar
X
wcass
 
Posts: 450
Joined: 27 Nov 2011, 21:18
Location: Fort Lauderdale, FL, USA
Main keyboard: ibm model m
Main mouse: kensington expert mouse
Favorite switch: buckeling spring
Club member: 0185
 
Ah, so it does :oops:
Soarer
User avatar

Unread post27 Oct 2012, 02:12

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
I'm a fan of trackpoint, sure :) But it is very difficult to integrate it into my favorite keyboard(HHKB/Poker) mainly because of keycap/case/PCB moding work. If you can use Trackpoint unit with PS/2 interface electrical or firmware part is not big problem. Also, we can obtain detail specification of Trackpoint extension commands to support exotic Trackpoint functions.

I'm currently happy with mousekey as main pointing device and living without real mouse most of the time except for funcy GUI apps. Mousekey is not complete replacement for real mouse, though, it is comfortable to do pointing job without leting my hand leave from keyboard. To be honest, I occasionally use physical mouse unintentionally if it is placed on side of keyboard.
hasu
User avatar

Unread post27 Oct 2012, 09:54

User avatar
X
hasu
 
Posts: 344
Joined: 02 Sep 2011, 14:47
Location: Japan
Main keyboard: HHKB
Main mouse: HHKB
Favorite switch: Topre
Club member: -
 
Actually there is another good reason for putting PS/2 through the Teensy but I haven't tried it yet. I would like to
1. be able to flip the coordinates on the trackpoint to have that option for mounting it
2. be able to map the motion to scrolling using a modifier

but I have no idea how much strain that would put on the Teensy and whether it is doable.
Icarium
User avatar

Unread post27 Oct 2012, 16:32

User avatar
X
Icarium
 
Posts: 1637
Joined: 11 Jan 2012, 16:22
Location: Germany
Main keyboard: These fields just
Main mouse: opened my eyes
Favorite switch: I need to bring stuff to work
 
I might pencil it in for v2.0 :P

It sounds like quite a lot of work to do it nicely - detect pointer device type, utilize trackpoint commands if trackpoint, deal with extra buttons / wheels (which are presumably not standardized on PS/2), add some config commands... and all of that after adding a mouse endpoint with all the bells and whistles so everything can be output, mousekeys for testing that, and optimizing my PS/2 code so that two of it can run at once. Not to mention a real risk of introducing bugs into code that's been pretty well tested by now, and dealing with them :lol:
Soarer
User avatar

Unread post27 Oct 2012, 21:05

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
Icarium wrote:I would like to
1. be able to flip the coordinates on the trackpoint to have that option for mounting it
2. be able to map the motion to scrolling using a modifier
but I have no idea how much strain that would put on the Teensy and whether it is doable.

I have used exactly such a setup in my custom board for the last couple of months, and it has been reliable and very responsive, so the Teensy is definitely capable of handling PS/2 in addition to the general keyboard functions. Implementation of these two features is also fairly trivial if you start with some established PS/2 code. And the trackpoint specifics are not that hard to implement thanks to the great reference manual of IBM that was already mentioned - that's where I got the idea to use press-to-select as a scrolling modifier from in the first place :D
suka
User avatar
frobiac

Unread post29 Oct 2012, 06:19

User avatar
X
suka
frobiac
 
Posts: 258
Joined: 20 Mar 2011, 12:47
Location: Germany
Main keyboard: custom split ergonomic "RedTilt"
Main mouse: IBM trackpoint
Favorite switch: MX red
Club member: 0046
 
Heh, I'm not saying it would be hard, just that it would take time :D

And I don't even have a trackpoint module!

To match the ethos of my keyboard code, I'd want it to handle most different PS/2 pointing devices without recompilation. That takes more effort, but allows people to do just a little DIY and get stuff working without having to learn how to compile and tweak the source code.
Soarer
User avatar

Unread post29 Oct 2012, 12:50

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
I've got a teensy coming for a 122 key terminal M. What would be the best way to connect it inside the case? Should I strip the wire or just remove the wire completely? What pins/wires are which?
fossala
User avatar
Elite +1

Unread post29 Oct 2012, 20:18

User avatar
X
fossala
Elite +1
 
Posts: 2730
Joined: 05 Aug 2011, 15:25
Location: UK
Main keyboard: HHKB Type-S
Main mouse: Rollermouse Free2
Favorite switch: Topre
Club member: -
 
fossala wrote:I've got a teensy coming for a 122 key terminal M. What would be the best way to connect it inside the case? Should I strip the wire or just remove the wire completely? What pins/wires are which?

I installed a teensy inside the case of my keyboard. i'll post pictures of how i did it when i get home.
Icarium wrote:Actually there is another good reason for putting PS/2 through the Teensy but I haven't tried it yet. I would like to
1. be able to flip the coordinates on the trackpoint to have that option for mounting it

Soarer wrote:To match the ethos of my keyboard code, I'd want it to handle most different PS/2 pointing devices without recompilation. That takes more effort, but allows people to do just a little DIY and get stuff working without having to learn how to compile and tweak the source code.

i would like this too. i am making a trackball out of a generic mouse, so one axis needs to be swapped. i could do it through a modified driver, but would prefer to use native drivers and be plug and play. the mouse buttons will be unused and instead i will be using regular keyboard keys.
wcass
User avatar

Unread post29 Oct 2012, 21:59

User avatar
X
wcass
 
Posts: 450
Joined: 27 Nov 2011, 21:18
Location: Fort Lauderdale, FL, USA
Main keyboard: ibm model m
Main mouse: kensington expert mouse
Favorite switch: buckeling spring
Club member: 0185
 
fossala wrote:I've got a teensy coming for a 122 key terminal M. What would be the best way to connect it inside the case? Should I strip the wire or just remove the wire completely? What pins/wires are which?

This is what i did and it has worked very well for me. You will need a 6' USB A-to-miniB cable. I just use old cell phone cables.

1. Cut the wire about 6” from the case.
2. Disassemble the case. The wire might be a bit tight – if so, lift the plastic piece around the grommet straight up while holding the cable and grommet down. The grommet should slide out the bottom of the plastic piece. Remove the wires from the controller. You might need to temporarily remove a mounting screw.
cut_cable.JPG

3. Pull the wires free of the wire casing if they come easily. Use a razor to slice the rubber grommet on one of the long sides (top or bottom). Slice all the way to the wire casing. Open the slice and pull the wire casing off of the grommet. Slide your USB cable into the grommet and check the fit. You may want to ream the hole to improve the fit.
cut_gromet.JPG

move_gromet.JPG

fit_gromet.JPG

fit_gromet2.JPG

4. Using the wires pulled free from the casing, attach as follows: black=VCC, white=GND, red=PD0, yellow=PD1. I prefer to use the VCC and GND from the pins furthest away from the USB port for this. I also like a caps-lock LED so I make a connection to GND and PF5. I feed the LED to a light pipe that replaces one of the rivets directly below the caps-lock key. Wrap the Teensy with electrical tape.
teensy.JPG

5. Attack the plug to the pins and USB cable and reassemble the case.
teensy2.JPG

tssk_drawer.JPG
wcass
User avatar

Unread post30 Oct 2012, 04:02

User avatar
X
wcass
 
Posts: 450
Joined: 27 Nov 2011, 21:18
Location: Fort Lauderdale, FL, USA
Main keyboard: ibm model m
Main mouse: kensington expert mouse
Favorite switch: buckeling spring
Club member: 0185
 
Looks good, lots of good info. I'll take mine apart and look at it later. I can see from looking at the back that it doesn't have a grommet though.
fossala
User avatar
Elite +1

Unread post30 Oct 2012, 06:38

User avatar
X
fossala
Elite +1
 
Posts: 2730
Joined: 05 Aug 2011, 15:25
Location: UK
Main keyboard: HHKB Type-S
Main mouse: Rollermouse Free2
Favorite switch: Topre
Club member: -
 
That's excellent, wcass!

I'll just add my usual caveat about not trusting the wire colours - check that yours has them going to the same pins on the connector!

If you don't want to hack at the original cable you could try and find a connector to fit, or solder to the connector's solder pads on the back of the PCB (if you're confident with your soldering).
Soarer
User avatar

Unread post30 Oct 2012, 14:14

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
OK, the teensy turned up yesterday. I've stripped the wires ready for doing the soldering at the weekend. When I load the code is all that I need to load is the hexfiles? I then use scas to assemble the config file and then load it using scwr? Do I need to load a config file for it to work or can I just use the hexfile and get a basic working converter?
fossala
User avatar
Elite +1

Unread post08 Nov 2012, 08:04

User avatar
X
fossala
Elite +1
 
Posts: 2730
Joined: 05 Aug 2011, 15:25
Location: UK
Main keyboard: HHKB Type-S
Main mouse: Rollermouse Free2
Favorite switch: Topre
Club member: -
 
It should work fine without a config loaded. Only when you got some ancient keyboard like a model F PC / terminal keyboard will it be needed to get some keys like Print Screen or Break to work.

The config file is mostly used for macros, function layers or to remap e.g. caps lock to control.
JBert

Unread post08 Nov 2012, 09:21

X
JBert
 
Posts: 1089
Joined: 10 Mar 2011, 23:02
Location: Belgium, land of Liberty Wafles and Freedom Fries
Main keyboard: G80-3K with Clears
Favorite switch: Capacitative BS
Club member: 0049
 
Indeed; config files are just tweaks to the default mappings (one for each scan code set) that are built into the hex files.
Soarer
User avatar

Unread post08 Nov 2012, 12:50

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
Hello, just a noob in C (in Python too but work in progress for both…) so I might missunderstand the code.

I was just wondering if with this code the Teensy still sends keycodes or characters?
With appropriate drivers, a keyboard can have any layout like Neo, bépo… but not directly in hard except for the US qwerty dvorak colemak and workman which are ASCII, am I right ? (It sounds obvious to me and it's just to be sure)

I saw only the 4 modifiers but is it possible to add a key and make a "Fn" layout in hard with a Teensy ? If yes, by passing through the serial I suppose, or may be sacrificing the CJK modifier keys as Henkan, Muhekan ?

thx for replies :)
Vierax
User avatar

Unread post10 Nov 2012, 09:14

User avatar
X
Vierax
 
Posts: 725
Joined: 30 Sep 2012, 04:34
Location: France (Lille)
Main keyboard: Tipro MID KM128 Bépo layout
Main mouse: Kensington Orbit Trackball
Favorite switch: MX Clear / MX Grey (under thumbs)
Club member: -
 
 
Human is binary : 1+1=10 just look at your hands or your feet :·)
All up and running, typing this with it now. Thanks for your hard work. Sure there will be more questions once I try and play with layouts.
fossala
User avatar
Elite +1

Unread post10 Nov 2012, 10:33

User avatar
X
fossala
Elite +1
 
Posts: 2730
Joined: 05 Aug 2011, 15:25
Location: UK
Main keyboard: HHKB Type-S
Main mouse: Rollermouse Free2
Favorite switch: Topre
Club member: -
 
It still sends keycodes, so yes, the sensible layouts to do in hardware are those which are mainly key-swapping (colemak etc). Macros can do a lot more than key-swapping of course, but it would require so many of them for something like bépo that a driver on the host makes a lot more sense.

You can define up to 8 keys as Fn keys, giving a theoretical total of 255 extra layers! You'd run out of memory long before that though (both your own and the converter's :lol: ). There's three parts to defining a layer, this example is in the configs directory:

Code: Select all
# basic layer example - cursors on r.h. home position when caps lock is held

# define that FN1 accesses layer 1
layerblock
   FN1 1
   FN2 1      # in case FN2 is used as well, define it as an alternative
   FN1 FN2 1   # both together still gets layer 1
endblock

# the layer itself is just some remaps tagged with the layer number
remapblock
layer 1
   I UP
   J LEFT
   K DOWN
   L RIGHT
endblock

# need to map the FN key into the base layer (0)
remapblock
layer 0
   CAPS_LOCK FN1
endblock

That's actually a bit inconsistent, because I've defined what happens with FN2 as well as FN1, but I haven't defined a FN2. The last remapblock could be replaced by this one to use the Windows keys as FN keys:

Code: Select all
# need to map FN keys into the base layer (0)
remapblock
layer 0
   LGUI FN1
   RGUI FN2
endblock
Soarer
User avatar

Unread post10 Nov 2012, 11:34

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
Oh yeah macros, that's clever ! You just need a referential layout who can handle the whole signs as « ¨+u=ü » (seems not so easy to find this pearl) or to display the unicode shortcut but it sounds difficult as different OS have different Unicode shortcuts and this kb is useless during POST and terminal sessions :/

255 Fn layers ! Oo Well, it's better to think larger to provide any request but it's a way too much here :D

Thx for the code, that's pretty clear. Now this part of the program doesn't seems difficult :)
Vierax
User avatar

Unread post11 Nov 2012, 05:46

User avatar
X
Vierax
 
Posts: 725
Joined: 30 Sep 2012, 04:34
Location: France (Lille)
Main keyboard: Tipro MID KM128 Bépo layout
Main mouse: Kensington Orbit Trackball
Favorite switch: MX Clear / MX Grey (under thumbs)
Club member: -
 
 
Human is binary : 1+1=10 just look at your hands or your feet :·)
Hmm, true, and being OS specific would make it a bit pointless really, unless you weren't allowed to install a keyboard layout on the OS.

255 layers just follows from the method of implementation... I wanted to allow using 4 layers, and having left and right Fn keys for each. So that's 8 Fn keys, which could be 255 layers, but is far more likely to be 4 :lol:
Soarer
User avatar

Unread post11 Nov 2012, 11:28

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
Yes the simplest way seems to have hard dvorak and colemak and combining the hard qwerty with a layout driver. With a soft like PKL, you don't have to be admin to use an exotic layout on Windows, and on Linux you can add one in your home repository. For MacOS or BSD I have no idea but may be it's the same than Linux as they're part of Unix family.

For the 255 hypothetic layers, I followed you in the calculation ;) I think that 4 layers layout is ever well enough, after more than 6 (Neo) it seems to be hard to remember (as you said)

I should go back to my C learning lessons now :)
Vierax
User avatar

Unread post12 Nov 2012, 04:26

User avatar
X
Vierax
 
Posts: 725
Joined: 30 Sep 2012, 04:34
Location: France (Lille)
Main keyboard: Tipro MID KM128 Bépo layout
Main mouse: Kensington Orbit Trackball
Favorite switch: MX Clear / MX Grey (under thumbs)
Club member: -
 
 
Human is binary : 1+1=10 just look at your hands or your feet :·)
PreviousNext

Who is online

Users browsing this forum: No registered users and 57 guests