Author Topic: [TMK] Keyboard Protocol Converter  (Read 90345 times)

0 Members and 2 Guests are viewing this topic.

Offline hasu

  •  Moderator
  • Thread Starter
  • Posts: 2769
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [TMK] Keyboard Protocol Converter
« Reply #100 on: Fri, 27 April 2018, 03:25:44 »
[IBM4704]

Added IBM4704 50-key(6019273) support on keymap editor.

http://www.tmk-kbd.com/tmk_keyboard/editor/
https://goo.gl/95HRna
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Online TheMilkmen

  • Posts: 6
  • Location: MD, USA
Re: [TMK] Keyboard Protocol Converter
« Reply #101 on: Mon, 28 May 2018, 08:34:00 »
Quick dumb question but can this converter be used on one of the ibm pingmasters? I'm just curious since I couldn't see anything other than a soarers converter for it. Thanks!

Offline Monarchial

  • Posts: 1
Re: [TMK] Keyboard Protocol Converter
« Reply #102 on: Mon, 28 May 2018, 12:44:35 »
Hi @Hasu

Is there any chance you're going to release an fc660m controller?

I'm working on one right now but running into some issues and was wondering if you had plans to do it.

Offline Somun

  • Posts: 2
Re: [TMK] Keyboard Protocol Converter
« Reply #103 on: Thu, 28 June 2018, 05:11:16 »
Just discovered this while looking to fix my Kinesis advantage, which does not work on a Windows 7 PC I have.

Hasu, can the firmware be configured to also include a PS/2 mouse interface? I am planning on adding some trackpad/touchpoint and get a composite usb device since the usb hub will be gone. Wondering if this is somehow achievable with maybe a custom TMK build? I don't need to change the keymap, btw.

Thanks.

Offline hasu

  •  Moderator
  • Thread Starter
  • Posts: 2769
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [TMK] Keyboard Protocol Converter
« Reply #104 on: Thu, 28 June 2018, 22:03:10 »
Just discovered this while looking to fix my Kinesis advantage, which does not work on a Windows 7 PC I have.

Hasu, can the firmware be configured to also include a PS/2 mouse interface? I am planning on adding some trackpad/touchpoint and get a composite usb device since the usb hub will be gone. Wondering if this is somehow achievable with maybe a custom TMK build? I don't need to change the keymap, btw.

Thanks.

I think it is kind of possible but it won't be simple job like editting Makefile or config.h. You will have to write some code with looking into existent codes.


TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Somun

  • Posts: 2
Re: [TMK] Keyboard Protocol Converter
« Reply #105 on: Fri, 29 June 2018, 10:16:16 »
Just discovered this while looking to fix my Kinesis advantage, which does not work on a Windows 7 PC I have.

Hasu, can the firmware be configured to also include a PS/2 mouse interface? I am planning on adding some trackpad/touchpoint and get a composite usb device since the usb hub will be gone. Wondering if this is somehow achievable with maybe a custom TMK build? I don't need to change the keymap, btw.

Thanks.

I think it is kind of possible but it won't be simple job like editting Makefile or config.h. You will have to write some code with looking into existent codes.

Thanks for the reply. Would not mind writing code. From a brief look, my impression is that the converter works by imitating a keyboard matrix that feeds off of the data coming from the ps2 keyboard. I know that the TMK has support for a ps2 mouse but not sure if the converter is repurposing the same code for the ps2 or how hard it would be add handling for a second one. I also need to change the USB descriptors I guess? I would appreciate any pointers / suggestions.

Thanks again.

Offline Laser

  • Posts: 100
  • Location: euROpe
Re: [TMK] Keyboard Protocol Converter
« Reply #106 on: Sun, 01 July 2018, 10:32:38 »

Sorry if this was asked already, could you describe the steps needed to add two extra buttons to the ps2_usb tmk converter? Or is there some support already?

I mean, buttons connected directly to some pins of the atmega32u4.

Thanks!

Offline hasu

  •  Moderator
  • Thread Starter
  • Posts: 2769
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [TMK] Keyboard Protocol Converter
« Reply #107 on: Sun, 01 July 2018, 15:55:34 »

Sorry if this was asked already, could you describe the steps needed to add two extra buttons to the ps2_usb tmk converter? Or is there some support already?

I mean, buttons connected directly to some pins of the atmega32u4.

Thanks!


You can add your code in `matrix_scan()` function to scan the buttons.
https://github.com/tmk/tmk_keyboard/blob/master/converter/ps2_usb/matrix.c#L144

The function is called repeatedly every so often in main loop and would be good place to add your code in this case. TMK converters translate scancode got from keyboard into key stataus as a bit in array `matrix[]`.

I think you can add state of those buttons into the array `matrix[]` using scancodes unused in your keyboard, for example F13(0x08) and F14(0x10). Use 'matrix_make()` and `matrix_break()` to change status of the button, like `matrix_make(0x08)` when it is pressed.
https://github.com/tmk/tmk_keyboard/blob/master/converter/ps2_usb/matrix.c#L407-L423

EDIT:
This thread is basically intended to offer support for users of TMK made converters. Technical topic about converter modification like this would be more suitable to this PS/2 converter thread. Post in the thread if you need any further quetion, so that we can share info with community.
https://geekhack.org/index.php?topic=14618.0
« Last Edit: Sun, 01 July 2018, 16:13:35 by hasu »
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Laser

  • Posts: 100
  • Location: euROpe
Re: [TMK] Keyboard Protocol Converter
« Reply #108 on: Sun, 01 July 2018, 16:17:42 »
Thanks for the quick reply! I think I understand. One more question, could I also use mousekey key codes instead of F13 or F14, such as KC_BTN1 or KC_BTN2 instead (assuming I do enable mousekey functionality) ?

EDIT: sorry, I saw your edit only after posting. Next posts will be made in the other thread.

Offline hasu

  •  Moderator
  • Thread Starter
  • Posts: 2769
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [TMK] Keyboard Protocol Converter
« Reply #109 on: Sun, 01 July 2018, 16:22:30 »
Thanks for the quick reply! I think I understand. One more question, could I also use mousekey key codes instead of F13 or F14, such as KC_BTN1 or KC_BTN2 instead (assuming I do enable mousekey functionality) ?

EDIT: sorry, I saw your edit only after posting. Next posts will be made in the other thread.

Yes, you can remap the F13 and F14 to the mouse button in keymap definition.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Laser

  • Posts: 100
  • Location: euROpe
Re: [TMK] Keyboard Protocol Converter
« Reply #110 on: Sun, 01 July 2018, 16:30:57 »

Thanks again, Hasu! :)

Offline hasu

  •  Moderator
  • Thread Starter
  • Posts: 2769
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [TMK] Keyboard Protocol Converter
« Reply #111 on: Thu, 05 July 2018, 19:31:32 »
[USB-USB]
Updated firmware of USB-USB converter to fix startup issue. See this post for detail.

https://geekhack.org/index.php?topic=69169.msg2634041#msg2634041

Thanks
« Last Edit: Sat, 07 July 2018, 19:43:26 by hasu »
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline scotland

  • Posts: 1
Re: [TMK] Keyboard Protocol Converter
« Reply #112 on: Sat, 07 July 2018, 18:09:35 »
My USB to USB converter arrived quickly to the UK. My whole idea was to map a UK layout Apple aluminium keyboard to work in Windows. The reason being my work PC is completely locked down so a hardware based method of remapping the keys was preferable. Using hasu's converter I managed to swap:

Left alt to left Windows
Left CMD to left alt
F13 to print screen
F14 to volume down
F15 to volume up

Thanks again hasu. Great service and great piece of kit.
« Last Edit: Sat, 07 July 2018, 18:11:26 by scotland »

Offline hasu

  •  Moderator
  • Thread Starter
  • Posts: 2769
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [TMK] Keyboard Protocol Converter
« Reply #113 on: Sat, 07 July 2018, 19:51:32 »
Thanks for the feedback. Glad to hear that!
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline tonsoffun49

  • Posts: 2
  • Location: Ohio
Re: [TMK] Keyboard Protocol Converter
« Reply #114 on: Fri, 27 July 2018, 16:15:55 »
Having a bit of a slow moment so I just want to clarify if someone wouldn't mind helping me. I have 2 Pingmasters, a 6113442 and a 5954339. From what I have seen on Reddit and GeekHack, there are two ways to make it work on a modern Windows machine.

1. (Internal) Replacing the internal CPU with a Teensy 2.0
2. (External) Buying the IBM 4704 converter or building one using a DE-9 wired to a Teensy 2.0.

Not that I wouldn't mind supporting Hasu and buying the converter from him, I just prefer to make my own as I want to learn how to do this and enjoy tinkering. I don't like the idea of opening the case and messing with the internal CPU so I would rather convert it externally. Is a Teensy necessary or will a ProMicro work? Any tips or help would be appreciated. This is my first vintage board and I can't wait to start using it.

Offline Blaise170

  • * Esteemed Elder
  • Posts: 1303
  • Location: Boston, MA
  • ALPS キーボード
    • XYZ
Re: [TMK] Keyboard Protocol Converter
« Reply #115 on: Sat, 28 July 2018, 19:01:36 »
ProMicro will work if it's the same processor (ATMEGA32U4).
I proxy anything including keyboards (キーボード / 鍵盤), from both Japan (日本) and China (中國). For more information, you may visit my dedicated webpage here: https://www.keyboards.es/proxying.html

View my current and past keyboards here: https://deskthority.net/wiki/User:Blaise170

Offline tonsoffun49

  • Posts: 2
  • Location: Ohio
Re: [TMK] Keyboard Protocol Converter
« Reply #116 on: Sun, 29 July 2018, 02:48:11 »
Thanks. Is there a benefit to using a Teensy over Pro Micro?

Offline Kekeke

  • Posts: 5
Re: [TMK] Keyboard Protocol Converter
« Reply #117 on: Sat, 18 August 2018, 10:40:47 »
I'm soory for asking this, but it seems I have a problem with pc98converter.
I built converter from leonardo, changed makefile by the way in config.h pd5 changed to pd1 but in readme its still pd5 and hid_listener just give me pc98:send9c:9c
Is it problem with my keyboard?

Sorry for my english and so noobish question

Offline hasu

  •  Moderator
  • Thread Starter
  • Posts: 2769
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [TMK] Keyboard Protocol Converter
« Reply #118 on: Sat, 18 August 2018, 18:13:45 »
I'm soory for asking this, but it seems I have a problem with pc98converter.
I built converter from leonardo, changed makefile by the way in config.h pd5 changed to pd1 but in readme its still pd5 and hid_listener just give me pc98:send9c:9c
Is it problem with my keyboard?

Sorry for my english and so noobish question

Ah, yes RTY should be PD1 in README, I'll update github repo later.

what model is exactly your keyboard?
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Kekeke

  • Posts: 5
Re: [TMK] Keyboard Protocol Converter
« Reply #119 on: Sun, 19 August 2018, 08:34:46 »

Ah, yes RTY should be PD1 in README, I'll update github repo later.

what model is exactly your keyboard?


I think its pc-9801RA keyboard, I dunno where I can see exactly model name) I have same model as this guy - http://island.geocities.jp/cklouch/column/pc98bas/ptpc98kbdra.htm


Offline hasu

  •  Moderator
  • Thread Starter
  • Posts: 2769
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [TMK] Keyboard Protocol Converter
« Reply #120 on: Sun, 19 August 2018, 20:32:51 »

Ah, yes RTY should be PD1 in README, I'll update github repo later.

what model is exactly your keyboard?


I think its pc-9801RA keyboard, I dunno where I can see exactly model name) I have same model as this guy - http://island.geocities.jp/cklouch/column/pc98bas/ptpc98kbdra.htm



hmm, I don't have that type keyboard to test and I guess it doesn't accept intialize commands. Can you try patch below to avoid the commands?
The PC98 converter was confirmed just with PC-9801V keyboard and DIGITAL WAVE D-BOARD so far, btw.

Code: [Select]
diff --git a/converter/pc98_usb/matrix.c b/converter/pc98_usb/matrix.c
index 54bb304..0ccf700 100644
--- a/converter/pc98_usb/matrix.c
+++ b/converter/pc98_usb/matrix.c
@@ -71,6 +71,7 @@ static void pc98_inhibit_repeat(void)
 
     // clear recv buffer
     while (serial_recv()) ;
+/*
 RETRY:
     _delay_ms(100);
     pc98_send(0x9C);
@@ -83,6 +84,7 @@ RETRY:
     code = pc98_wait_response();
     if (code != -1) xprintf("PC98: send 70: %02X\n", code);
     if (code != 0xFA) goto RETRY;
+*/
 }
 
 void matrix_init(void)
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Kekeke

  • Posts: 5
Re: [TMK] Keyboard Protocol Converter
« Reply #121 on: Mon, 20 August 2018, 08:47:05 »
Thanks for helping but It still doesn't work. Hid_listen said "keyboard start" but its doesn't work. I will dig further or just rebuild whole keyboard like diy-keyboard )


Offline ramencup

  • Posts: 21
  • aa
Re: [TMK] Keyboard Protocol Converter
« Reply #122 on: Sun, 26 August 2018, 21:57:00 »
Heya, thinking about the IBM 4704 converter. Since this is presumably shipping from Japan, how much will this cost to ship and when should I expect it?
Also, does the converter preserve NKRO?

Offline hasu

  •  Moderator
  • Thread Starter
  • Posts: 2769
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [TMK] Keyboard Protocol Converter
« Reply #123 on: Mon, 27 August 2018, 20:01:45 »
The converters can be shipped usually in a few working days. It usually takes 5-10 days depending on your place. Shipping costs 6usd regardless of your location.

Default firmware supports only 6NKRO you have to configure in Makefile to enable NKRO.

Sent from my WAS-LX2J using Tapatalk

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Kekeke

  • Posts: 5
Re: [TMK] Keyboard Protocol Converter
« Reply #124 on: Tue, 04 September 2018, 08:12:49 »
Quote
The PC98 converter was confirmed just with PC-9801V

it's work with my keyboard I think its pc-9801RA. i change unimap. And i am kind of stupid, i messed up with receptable and acceptable connectors side. but now it works except **** and ctrl))

big thanks for this firmware and helping, i'm so happy now.

Offline hasu

  •  Moderator
  • Thread Starter
  • Posts: 2769
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [TMK] Keyboard Protocol Converter
« Reply #125 on: Fri, 07 September 2018, 19:13:21 »
it's work with my keyboard I think its pc-9801RA. i change unimap. And i am kind of stupid, i messed up with receptable and acceptable connectors side. but now it works except **** and ctrl

Great.
What is happened on **** and ctrl?  Do you think it is firmware related problem?
And  what is **** means actually?
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Kekeke

  • Posts: 5
Re: [TMK] Keyboard Protocol Converter
« Reply #126 on: Sun, 09 September 2018, 07:04:04 »
shift is shifт why it is in spam list?)

Now it works, something in unimaptrans was not correct for this kind of keyboard

Offline hasu

  •  Moderator
  • Thread Starter
  • Posts: 2769
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: [TMK] Keyboard Protocol Converter
« Reply #127 on: Sun, 09 September 2018, 18:10:16 »
Hello there, I recently obtained a Zenith Z 150 XT and am reporting that your most recent hex file seems to work just fine. I am not experiencing issues with wake up from sleep like fer.real mentioned. FWIW I am on a Mac, and am using teensy with the reset pin wired in. I will test out the converter and report back if I notice anything. Just an fyi :)

Thanks for another awesome project hasu!

Hi Again,

I've been using using the newest hex file you posted for a couple of days and I'm running into an issue.

The new firmware works great when I first plug the converter into the computer.  As long as the computer stays awake, I no longer have any of the random keypresses or repeating keys.

Problems start when my laptop wakes from sleep or hibernation.  As soon as it wakes up, the converter starts sending repeating keystrokes.  If I unplug and reattach the USB cable, the converter works fine again.

Attached is the output of hid_listen after the computer woke from sleep.
(Attachment Link)

Thanks again!

shift is shifт why it is in spam list?)

Now it works, something in unimaptrans was not correct for this kind of keyboard

Great. Post and share your patch for original code!

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt