geekhack

geekhack Projects => Making Stuff Together! => Topic started by: ac2ev on Sat, 05 November 2016, 14:02:59

Title: Getting Started with TMK and OAK FTM keyboard
Post by: ac2ev on Sat, 05 November 2016, 14:02:59
I saved this keyboard from a defunct piece of equipment. It's similar to the keyboard used in the Osborne-1. It's and OAK Full Travel Membrane (FTM). I've gone through and mapped the rows and columns on it, manually using my meter.

Beyond the normal keys it has a mechanically latching Shift Lock and RPT key. It also has a non-latching Shift key.

On the software side I'm reading through the TMK WIKI and going the Virtualbox route.
As I understand it the TMK firmware will translate the inputs (Rows,Columns) to standard USB keyboard output.
It appears that TMK can do this but I'm trying to wrap my head around what needs to be configured and how since I doubt someone has built the firmware for this keyboard.

What is a good guide that shows how to use TMK with a DIY keyboard as I figure I'll be delving deep into this one?

I'll be using a Teensy++
Title: Re: Getting Started with TMK and OAK FTM keyboard
Post by: suicidal_orange on Mon, 14 November 2016, 03:56:32
If you're not fixed on tmk there's an alternative I can help with - EasyAVR (https://geekhack.org/index.php?topic=51252.0).

To do those strange key pairings you would need to set your 'shift' key to an FN, then on the layer you can tick 'with mods - shift' on selected keys to get the characters you need, or if they're all shifted characters just in the wrong pairs you can tick it on the FN to apply it to the whole layer.

Have a look if you want, the documentation is a bit sparse but I'll be around to answer any questions :)
Title: Re: Getting Started with TMK and OAK FTM keyboard
Post by: ac2ev on Mon, 14 November 2016, 06:47:02
I'll take a look at it. I'm always up to trying different firmware. I'll probably try Soarer's also to see which one works best for me.
Title: Re: Getting Started with TMK and OAK FTM keyboard
Post by: wolfv on Wed, 16 November 2016, 20:37:50
Shameless self promotion here.  Take a look at the keybrd library:
        https://github.com/wolfv6/keybrd
        https://github.com/wolfv6/keybrd/tree/master/tutorials
The keybrd library makes strange key pairings easy.  And is demonstrated in the tutorial at https://github.com/wolfv6/keybrd/tree/master/tutorials/keybrd_3f_autoShift (https://github.com/wolfv6/keybrd/tree/master/tutorials/keybrd_3f_autoShift)

The library was tested on Teensy 2.0 and Teensy LC, and should work on Teensy++.
Teensy LC costs less and has 26 pins.
Title: Re: Getting Started with TMK and OAK FTM keyboard
Post by: dorkvader on Wed, 16 November 2016, 20:47:50
I'll take a look at it. I'm always up to trying different firmware. I'll probably try Soarer's also to see which one works best for me.

Soarer's was what I used for most of mine, mainly because it was easy to learn and you can reprogram on the fly. Unfortunately Soarer disappeared before he decided it was done and opened the source so it's no longer being developed.

wolfv, I'll have a look at your work. I need a new system to migrate to.
Title: Re: Getting Started with TMK and OAK FTM keyboard
Post by: wolfv on Thu, 17 November 2016, 00:35:23
ac2ev,

I wrote a keybrd firmware demonstrating the key pairings '8(' and '=1'.
Here is the source code: https://github.com/wolfv6/keybrd/blob/master/tutorials/keybrd_3g_shift_pairings/keybrd_3g_shift_pairings.ino
It was tested on a Teensy LC keyboard.
The source code for the entire keyboard is only 100 lines long because the keybrd library takes care of the details.  It's that easy!  :D
Title: Re: Getting Started with TMK and OAK FTM keyboard
Post by: ac2ev on Sun, 20 November 2016, 15:03:04
If you're not fixed on tmk there's an alternative I can help with - EasyAVR (https://geekhack.org/index.php?topic=51252.0).

To do those strange key pairings you would need to set your 'shift' key to an FN, then on the layer you can tick 'with mods - shift' on selected keys to get the characters you need, or if they're all shifted characters just in the wrong pairs you can tick it on the FN to apply it to the whole layer.

Have a look if you want, the documentation is a bit sparse but I'll be around to answer any questions :)

Looking at your software it appears to have layouts set for the more popular DIY keyboards. How would I create my own custom layout? 

I've got
17 columns
10 rows
2 mechanical latching keys
and as previously noted some non-standard key pairs as well as some keys that I'll have create. I believe I've got 3 underscore keys. May reassign one (under Backspace)  to something different like a GUI.

Of course the column to row is not simply 1 for 1.
Zero based counting:
Q = C7 R2

This non-standard layout has proved troublesome on TMK
Title: Re: Getting Started with TMK and OAK FTM keyboard
Post by: wolfv on Tue, 22 November 2016, 03:21:38
Of course the column to row is not simply 1 for 1.
Zero based counting:
Q = C7 R2
Excuse may ignorance, but what do "1 for 1", "Zero based counting", and "Q = C7 R2" mean?

Title: Re: Getting Started with TMK and OAK FTM keyboard
Post by: ac2ev on Tue, 22 November 2016, 05:36:48
1 for 1 my keys are not wired straight across as one might normally wire a keybiard. For instance if you look at the previously attached drawing, you will see Q key was wired to R (row 1) C (column 7) rather than row 1 column 1. I used zero based counting so my rows and columns start at 0 not 1. While debugging the matrix wiring on this keyboard I used the resistor color code for my wiring and counting. Black =0 brown=1, etc. I had a 50% chance of wiring it correctly the first time and I got it completely backwards.

I hope that explains it. Sorry for the confusion.
Title: Re: Getting Started with TMK and OAK FTM keyboard
Post by: ac2ev on Fri, 25 November 2016, 15:26:26
ac2ev,

I wrote a keybrd firmware demonstrating the key pairings '8(' and '=1'.
Here is the source code: https://github.com/wolfv6/keybrd/blob/master/tutorials/keybrd_3g_shift_pairings/keybrd_3g_shift_pairings.ino
It was tested on a Teensy LC keyboard.
The source code for the entire keyboard is only 100 lines long because the keybrd library takes care of the details.  It's that easy!  :D

I downloaded a copy of the latest files and this .ino and something is mising. I'm not able to compile the code as written. There appears to be a reference missing.

I end up with the error 'MODIFIER_LEFT_SHIFT' was not declared in scope
Code: [Select]

// =================== CODES ===================
// ---------------- LAYER CODE -----------------
enum layerIds { NORMAL, SHIFT };
LayerState layerState;
Code_Shift s_shift(MODIFIERKEY_LEFT_SHIFT);
Code_LayerHoldShift l_shift(SHIFT, layerState, s_shift);


Likewise with the simple breadboard example:
Code: [Select]
Arduino: 1.6.8 (Windows 7), Board: "Arduino/Genuino Uno"

keybrd_1_breadboard:25: error: 'KEY_A' was not declared in this scope

 Code_Sc s_a(KEY_A);

             ^

keybrd_1_breadboard:26: error: 'KEY_B' was not declared in this scope

 Code_Sc s_b(KEY_B);

             ^

keybrd_1_breadboard:28: error: 'KEY_1' was not declared in this scope

 Code_Sc s_1(KEY_1);

             ^

keybrd_1_breadboard:29: error: 'KEY_2' was not declared in this scope

 Code_Sc s_2(KEY_2);

             ^

exit status 1
'KEY_A' was not declared in this scope
Title: Re: Getting Started with TMK and OAK FTM keyboard
Post by: ac2ev on Thu, 12 January 2017, 07:40:40
After wiring everything up to the Teensy++ and trying my hand at building the TMK firmware I stumbled across these two sites which helped immensely.

http://www.keyboard-layout-editor.com/ -create custom keyboard layouts

http://kb.sized.io/ -build firmware off the layout

I was able to create a layout and visualize the wiring. That worked and then came the task of wiring it all up in the TMK firmware generator.

In the end I had to modify the code by hand as the author doesn't support the Teensy+ pins. Also, the pinout was a bit different then most as this keyboard has 17 columns and 10 rows.

Some of the keys are still waiting to be assigned. It seems that this may be a kind of Chinese/English layout so the 'odd' key pairs have to be dealt with like @ '

All in all it was a fun learning experience and now I have keyboard from 1985 on USB  :D.

Now if I could find a custom case for it.
Title: Re: Getting Started with TMK and OAK FTM keyboard
Post by: ac2ev on Mon, 01 May 2017, 18:23:12
In case anyone was wondering. I was able to get the keyboard fully functional using QMK and custom macros. Also added a couple function layers to it. I used a H2O2 solution and oxyclean to clean the keycaps. They went from brown to a gray marbled appearance.

I went through and lubed the sliders. That took quite a while since you have to lower the outer spring and do one side at a time. Got it all done and started thinking about having a colleague make a tray for it. But first, I thought I'd try typing on it.

It's horrible! Even after lubing the sliders twice the switches are terrible. They drag quite a bit and the the double spring makes it difficult to type on. I saw a post on another forum that you can take the switch apart but this requires cutting the plastic 'weld' on the back of the plate. I'd rather keep it intact. So, on to the shelf it goes as eye candy.

I might try to lube it again but I think without disassembly it's not going to do any good.

Too bad the keycaps aren't cherry mx compatible.
Title: Re: Getting Started with TMK and OAK FTM keyboard
Post by: donut_sauce on Mon, 15 May 2017, 22:33:21
Did you end up using the QMK Firmware Builder?
Title: Re: Getting Started with TMK and OAK FTM keyboard
Post by: ac2ev on Tue, 16 May 2017, 06:13:56
Yes I did. It worked out rather well. I ended up creating 3 layers and custom assignments for the non-standard keys. One thing to note, if you have multiple keys that are attached to the same wire only assign one of them in QMK. It doesn't like to keys wired to the same point.

Unfortunately, the switches on this keyboard are terrible. They drag quite a bit and not enjoyable to type on. Even after lubricating them. I'll try lubricating them again to see if it helps as there's quite a bit of wear on the sliders.

I still like the layout and may use it to create a custom board some time in the future.
Title: Re: Getting Started with TMK and OAK FTM keyboard
Post by: jackielii on Sun, 26 February 2023, 14:49:43
This is what I've been looking for, I have 2 HHKBs, the Pro 2 & Hybrid Type-s. I love it but I always feel like I need more keys near the space bar.

Currently I mapped "Cmd" key (to the left of space) to FN, but I actually want it to be "CMD" and have another under left thumb to use as FN.