Author Topic: USB to USB keyboard converter  (Read 145529 times)

mblsha and 3 Guests are viewing this topic.

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #350 on: Fri, 13 July 2018, 21:54:04 »
Assuming you are on Windows I think you can use tool like AquakeyTest to see exactly what you get form keyboard without the software misbehave. If you know exactly what the bug is you will get solution for this in the end.

To be honest, I disappointed at Cherry's attitude to this issue and users suffering from it, and hesitated to look into to circumvent their bug. But I'll try this now...

Giorgio, can you try this patch?
I'm almost sure that this solvles the bug or mitigates it at least, but it would be nice if you can test this too before merging it into github repo.

Code: [Select]
diff --git a/tmk_core/protocol/usb_hid/parser.cpp b/tmk_core/protocol/usb_hid/parser.cpp
index 94e747c..730a20d 100644
--- a/tmk_core/protocol/usb_hid/parser.cpp
+++ b/tmk_core/protocol/usb_hid/parser.cpp
@@ -6,12 +6,19 @@
 
 void KBDReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
 {
-    ::memcpy(&report, buf, sizeof(report_keyboard_t));
-    time_stamp = millis();
-
-    dprintf("input %d:  %02X %02X", hid->GetAddress(), report.mods, report.reserved);
-    for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
-        dprintf(" %02X", report.keys[i]);
+    dprintf("input %d:", hid->GetAddress());
+    for (uint8_t i = 0; i < len; i++) {
+        dprintf(" %02X", buf[i]);
     }
     dprint("\r\n");
+
+    // ignore Cherry 0101010101010101 bug report
+    // https://geekhack.org/index.php?topic=69169.msg2638223#msg2638223
+    if (buf[1] == 0x01) {
+       dprint("Cherry bug: ignored\r\n");
+       return;
+    }
+
+    ::memcpy(&report, buf, sizeof(report_keyboard_t));
+    time_stamp = millis();
 }




As you said the keyboard is not usable unless you are on Windows, I totally agree that. I added note of this issue for potential users in first post finally.

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline T42

  • Posts: 11
  • Location: Germany
Re: USB to USB keyboard converter
« Reply #351 on: Sat, 14 July 2018, 12:14:17 »
So, I am hoping this will behave as follows. Is that correct?
hold        tap   result
f4          f5    ralt + spc
f5          f4    rctl + bspc
f4 f5       [     ralt + rctl + rsft + minus
f4 f5 [     b     ralt + rctl + f10
f4 f5 [ i   b     ralt + rctl + lsft + f10



They should work. Notice that 'dual role modifier/key' is not a real modifier and you will have to develop key fingering timing for that.
Thanks for the warning. That made me think again. The modifier / tap distinction is one thing that seems to feel ok in my attempts with Autohotkey. So I will give that script another chance and see if I can fix the things which are not yet satisfactory.

In Autohotkey, I implemented something like this, without the need for timing config trade-offs:
  • on dual-role key (mod / tap or layer / tap) down, set its mod state to "down";
  • on normal key down, change all mods and layers currently in "down" state to "downT";
  • on dual-role up, treat as mod (or layer) if its state is "downT"; as tap if "down".
(Still missing: To support fast typing, treat any X down, Y down, X up, Y up sequence as X tap, Y tap rather than X modifying Y. The latter should only be recognized when the order is X down, Y down, Y up, X up.)

In the unlikely case that this sounds like a new and useful idea to you, feel free to use it :-)
If you already thought of and dismissed a similar approach, I'd love to hear the reason. That might save me a lot of time better spent re-considering TMK ;-)

Also, thank you for the other answers.

Offline Giorgio

  • Posts: 1841
  • Location: Italy
Re: USB to USB keyboard converter
« Reply #352 on: Sun, 15 July 2018, 03:30:18 »
Assuming you are on Windows I think you can use tool like AquakeyTest to see exactly what you get form keyboard without the software misbehave. If you know exactly what the bug is you will get solution for this in the end.

To be honest, I disappointed at Cherry's attitude to this issue and users suffering from it, and hesitated to look into to circumvent their bug. But I'll try this now...

Giorgio, can you try this patch?
I'm almost sure that this solvles the bug or mitigates it at least, but it would be nice if you can test this too before merging it into github repo.

Code: [Select]
diff --git a/tmk_core/protocol/usb_hid/parser.cpp b/tmk_core/protocol/usb_hid/parser.cpp
index 94e747c..730a20d 100644
--- a/tmk_core/protocol/usb_hid/parser.cpp
+++ b/tmk_core/protocol/usb_hid/parser.cpp
@@ -6,12 +6,19 @@
 
 void KBDReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
 {
-    ::memcpy(&report, buf, sizeof(report_keyboard_t));
-    time_stamp = millis();
-
-    dprintf("input %d:  %02X %02X", hid->GetAddress(), report.mods, report.reserved);
-    for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
-        dprintf(" %02X", report.keys[i]);
+    dprintf("input %d:", hid->GetAddress());
+    for (uint8_t i = 0; i < len; i++) {
+        dprintf(" %02X", buf[i]);
     }
     dprint("\r\n");
+
+    // ignore Cherry 0101010101010101 bug report
+    // https://geekhack.org/index.php?topic=69169.msg2638223#msg2638223
+    if (buf[1] == 0x01) {
+       dprint("Cherry bug: ignored\r\n");
+       return;
+    }
+
+    ::memcpy(&report, buf, sizeof(report_keyboard_t));
+    time_stamp = millis();
 }




As you said the keyboard is not usable unless you are on Windows, I totally agree that. I added note of this issue for potential users in first post finally.

sure, thanks. I use the keyboard on windows, but I compile the firmware in a vmware ubuntu virtual machine

Do I just need to run
git apply <filename>
on the tmk folder?

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #353 on: Sun, 15 July 2018, 05:55:03 »
I think you can use 'patch' or 'git apply' in tmk_keyboard root directory, like this:

Code: [Select]
$ cat patchfile | git apply -v
Checking patch tmk_core/protocol/usb_hid/parser.cpp...
Applied patch tmk_core/protocol/usb_hid/parser.cpp cleanly.

Code: [Select]
$ cat patchfile | patch -p1 --verbose
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/tmk_core/protocol/usb_hid/parser.cpp b/tmk_core/protocol/usb_hid/parser.cpp
|index 94e747c..730a20d 100644
|--- a/tmk_core/protocol/usb_hid/parser.cpp
|+++ b/tmk_core/protocol/usb_hid/parser.cpp
--------------------------
patching file tmk_core/protocol/usb_hid/parser.cpp
Using Plan A...
Hunk #1 succeeded at 6.
done

Note that 'git am' says nothing even when it fails to patch file. Make sure the file is really changed after running the command.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #354 on: Tue, 17 July 2018, 18:40:38 »
T42,

Quote
Also, the online editor's 8 layer limitation is making me a little nervous ;-) Can you please confirm that 32 layers are supported otherwise?
(I need a lot of layers: 1 base layer which uses all keys similar to Neo 2 layout, and 18 layers which use only ~ 15 of the most comfortable right hand keys, holding modifiers with the left hand.)

Thanks!
[/font]

All of 32 layers is available when you use keymap file and compile firmware yourself.

I forgot to say this which is important.
This is true theoretically, as long as there is flash memory enough to have the keymap layers. The USB to USB converter firmware size is relatively large(around 25KB) and controller's flash memory size(28KB) is not enough roomy for your need unfortunately. Its keymap requires 256 bytes par layer, 32 layers need 8KB.

I would estimate you have 11-12 layers max with current default firmware build configuration.

If you disable mouse keys,  media control keys and debug function in Makefile you will get extra around 5KB for more layers. In this case it seems that you can define 27 layers max.
« Last Edit: Tue, 17 July 2018, 18:42:51 by hasu »
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #355 on: Tue, 17 July 2018, 19:45:27 »
So, I am hoping this will behave as follows. Is that correct?
hold        tap   result
f4          f5    ralt + spc
f5          f4    rctl + bspc
f4 f5       [     ralt + rctl + rsft + minus
f4 f5 [     b     ralt + rctl + f10
f4 f5 [ i   b     ralt + rctl + lsft + f10



They should work. Notice that 'dual role modifier/key' is not a real modifier and you will have to develop key fingering timing for that.
Thanks for the warning. That made me think again. The modifier / tap distinction is one thing that seems to feel ok in my attempts with Autohotkey. So I will give that script another chance and see if I can fix the things which are not yet satisfactory.

In Autohotkey, I implemented something like this, without the need for timing config trade-offs:
  • on dual-role key (mod / tap or layer / tap) down, set its mod state to "down";
  • on normal key down, change all mods and layers currently in "down" state to "downT";
  • on dual-role up, treat as mod (or layer) if its state is "downT"; as tap if "down".
(Still missing: To support fast typing, treat any X down, Y down, X up, Y up sequence as X tap, Y tap rather than X modifying Y. The latter should only be recognized when the order is X down, Y down, Y up, X up.)

In the unlikely case that this sounds like a new and useful idea to you, feel free to use it :-)
If you already thought of and dismissed a similar approach, I'd love to hear the reason. That might save me a lot of time better spent re-considering TMK ;-)

Also, thank you for the other answers.

Yeah, when more than one dual role key interleave one another the situation becomes really complex. TMK also have kind of implemented "downT" state as "interrupted" flag which is used to discriminate with other criteria.

With the timer and key event buffer TMK can handle "X down, Y down, X up, Y up" sequence as "X tap, Y tap" decently, so you won't have no issue when you intended to use them to get key(tap) in typing. And in fast typing users can type even "X down, Y down, Y up, X up" to get "X tap, Y tap", TMK solves this with timer.

I got almost no negative report about the 'tap recognition' from users. In contrast some people have complained its 'modifier recognition'. Users must hold a key for some time(configurable) to get the modifier action.

As you can see 'dual role key' in TMK puts large priority on 'tap' for flawless typing as possible, at the sacrifice of its 'modifier' action.

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline T42

  • Posts: 11
  • Location: Germany
Re: USB to USB keyboard converter
« Reply #356 on: Thu, 19 July 2018, 10:31:04 »
T42,

Quote
Also, the online editor's 8 layer limitation is making me a little nervous ;-) Can you please confirm that 32 layers are supported otherwise?
(I need a lot of layers: 1 base layer which uses all keys similar to Neo 2 layout, and 18 layers which use only ~ 15 of the most comfortable right hand keys, holding modifiers with the left hand.)

Thanks!


All of 32 layers is available when you use keymap file and compile firmware yourself.

I forgot to say this which is important.
This is true theoretically, as long as there is flash memory enough to have the keymap layers. The USB to USB converter firmware size is relatively large(around 25KB) and controller's flash memory size(28KB) is not enough roomy for your need unfortunately. Its keymap requires 256 bytes par layer, 32 layers need 8KB.

I would estimate you have 11-12 layers max with current default firmware build configuration.

If you disable mouse keys,  media control keys and debug function in Makefile you will get extra around 5KB for more layers. In this case it seems that you can define 27 layers max.
Actually, 19 was miscounted, there are only 17. And some are only nice to have but rarely used characters (arrows, box drawing, math, etc.). So 11-12 layers should be enough.

So, I am hoping this will behave as follows. Is that correct?
hold        tap   result
f4          f5    ralt + spc
f5          f4    rctl + bspc
f4 f5       [     ralt + rctl + rsft + minus
f4 f5 [     b     ralt + rctl + f10
f4 f5 [ i   b     ralt + rctl + lsft + f10



They should work. Notice that 'dual role modifier/key' is not a real modifier and you will have to develop key fingering timing for that.
Thanks for the warning. That made me think again. The modifier / tap distinction is one thing that seems to feel ok in my attempts with Autohotkey. So I will give that script another chance and see if I can fix the things which are not yet satisfactory.

In Autohotkey, I implemented something like this, without the need for timing config trade-offs:
  • on dual-role key (mod / tap or layer / tap) down, set its mod state to "down";
  • on normal key down, change all mods and layers currently in "down" state to "downT";
  • on dual-role up, treat as mod (or layer) if its state is "downT"; as tap if "down".
(Still missing: To support fast typing, treat any X down, Y down, X up, Y up sequence as X tap, Y tap rather than X modifying Y. The latter should only be recognized when the order is X down, Y down, Y up, X up.)

In the unlikely case that this sounds like a new and useful idea to you, feel free to use it :-)
If you already thought of and dismissed a similar approach, I'd love to hear the reason. That might save me a lot of time better spent re-considering TMK ;-)

Also, thank you for the other answers.

Yeah, when more than one dual role key interleave one another the situation becomes really complex. TMK also have kind of implemented "downT" state as "interrupted" flag which is used to discriminate with other criteria.

With the timer and key event buffer TMK can handle "X down, Y down, X up, Y up" sequence as "X tap, Y tap" decently, so you won't have no issue when you intended to use them to get key(tap) in typing. And in fast typing users can type even "X down, Y down, Y up, X up" to get "X tap, Y tap", TMK solves this with timer.

I got almost no negative report about the 'tap recognition' from users. In contrast some people have complained its 'modifier recognition'. Users must hold a key for some time(configurable) to get the modifier action.

As you can see 'dual role key' in TMK puts large priority on 'tap' for flawless typing as possible, at the sacrifice of its 'modifier' action.


Thanks for your answers.
Preferably, I think I'd like to use E and N (home row index fingers in Neo layout) as dual-role shift. So modifier and tap would be equally important. But maybe I'll end up with dedicated shift keys. And for the other modifiers and layers, the hold time is probably okay.

So, my plan A is still to fix my Autohotkey and see how that feels. Plan B: make do with less dual-role keys and / or buy your converters.

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #357 on: Thu, 19 July 2018, 16:35:08 »
I'm sure that people including me are interested in your Autohotkey script. We have discussed about 'dual role key' usage and implementation in this thread, share your script there or make your own thread to do so!
https://geekhack.org/index.php?topic=41685.0
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline T42

  • Posts: 11
  • Location: Germany
Re: USB to USB keyboard converter
« Reply #358 on: Fri, 20 July 2018, 17:04:19 »
I'm sure that people including me are interested in your Autohotkey script. We have discussed about 'dual role key' usage and implementation in this thread, share your script there or make your own thread to do so!
https://geekhack.org/index.php?topic=41685.0
OK, I will, but it may take weeks. It needed a refactoring, and now not much is working.

Offline gdsports

  • Posts: 1
Re: USB to USB keyboard converter
« Reply #359 on: Sat, 21 July 2018, 19:47:40 »
I have been experimenting with Teensy 3.6 USB pass through. It works with some modifications to the official Teensyduino release.

https://forum.pjrc.com/threads/51869-USB-keyboard-hardware-proxy

The Teensy 3.6 has a USB host port as well as the usual USB device port so it can act as a USB pass through or proxy device.

My forked usbhost_t36

https://github.com/gdsports/USBHost_t36

which includes this pull request applied plus my changes

The pull request below (not mine) allows a sketch to receive the USB keyboard HID report when it arrives from the USB host port.

https://github.com/PaulStoffregen/USBHost_t36/pull/18

Hardware
  Teensy 3.6 board https://www.pjrc.com/store/teensy36.html
  Teensy 3.6 USB host cable https://www.pjrc.com/store/cable_usb_host_t36.html

So far I have made a simple CapsLock <-> LeftCtrl swap.

Offline Giorgio

  • Posts: 1841
  • Location: Italy
Re: USB to USB keyboard converter
« Reply #360 on: Tue, 31 July 2018, 14:43:22 »
Assuming you are on Windows I think you can use tool like AquakeyTest to see exactly what you get form keyboard without the software misbehave. If you know exactly what the bug is you will get solution for this in the end.

To be honest, I disappointed at Cherry's attitude to this issue and users suffering from it, and hesitated to look into to circumvent their bug. But I'll try this now...

Giorgio, can you try this patch?
I'm almost sure that this solvles the bug or mitigates it at least, but it would be nice if you can test this too before merging it into github repo.

Code: [Select]
diff --git a/tmk_core/protocol/usb_hid/parser.cpp b/tmk_core/protocol/usb_hid/parser.cpp
index 94e747c..730a20d 100644
--- a/tmk_core/protocol/usb_hid/parser.cpp
+++ b/tmk_core/protocol/usb_hid/parser.cpp
@@ -6,12 +6,19 @@
 
 void KBDReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
 {
-    ::memcpy(&report, buf, sizeof(report_keyboard_t));
-    time_stamp = millis();
-
-    dprintf("input %d:  %02X %02X", hid->GetAddress(), report.mods, report.reserved);
-    for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
-        dprintf(" %02X", report.keys[i]);
+    dprintf("input %d:", hid->GetAddress());
+    for (uint8_t i = 0; i < len; i++) {
+        dprintf(" %02X", buf[i]);
     }
     dprint("\r\n");
+
+    // ignore Cherry 0101010101010101 bug report
+    // https://geekhack.org/index.php?topic=69169.msg2638223#msg2638223
+    if (buf[1] == 0x01) {
+       dprint("Cherry bug: ignored\r\n");
+       return;
+    }
+
+    ::memcpy(&report, buf, sizeof(report_keyboard_t));
+    time_stamp = millis();
 }




As you said the keyboard is not usable unless you are on Windows, I totally agree that. I added note of this issue for potential users in first post finally.

Sorry for the late answer. The g80-3000 in Windows 10 seems to work perfectly after applying the patch.
Compiled under Ubuntu.
I'll use the keyboard continuously and update you if there are any problems.

Thanks :-)

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #361 on: Tue, 31 July 2018, 18:47:23 »
Assuming you are on Windows I think you can use tool like AquakeyTest to see exactly what you get form keyboard without the software misbehave. If you know exactly what the bug is you will get solution for this in the end.

To be honest, I disappointed at Cherry's attitude to this issue and users suffering from it, and hesitated to look into to circumvent their bug. But I'll try this now...

Giorgio, can you try this patch?
I'm almost sure that this solvles the bug or mitigates it at least, but it would be nice if you can test this too before merging it into github repo.

Code: [Select]
diff --git a/tmk_core/protocol/usb_hid/parser.cpp b/tmk_core/protocol/usb_hid/parser.cpp
index 94e747c..730a20d 100644
--- a/tmk_core/protocol/usb_hid/parser.cpp
+++ b/tmk_core/protocol/usb_hid/parser.cpp
@@ -6,12 +6,19 @@
 
 void KBDReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
 {
-    ::memcpy(&report, buf, sizeof(report_keyboard_t));
-    time_stamp = millis();
-
-    dprintf("input %d:  %02X %02X", hid->GetAddress(), report.mods, report.reserved);
-    for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
-        dprintf(" %02X", report.keys[i]);
+    dprintf("input %d:", hid->GetAddress());
+    for (uint8_t i = 0; i < len; i++) {
+        dprintf(" %02X", buf[i]);
     }
     dprint("\r\n");
+
+    // ignore Cherry 0101010101010101 bug report
+    // https://geekhack.org/index.php?topic=69169.msg2638223#msg2638223
+    if (buf[1] == 0x01) {
+       dprint("Cherry bug: ignored\r\n");
+       return;
+    }
+
+    ::memcpy(&report, buf, sizeof(report_keyboard_t));
+    time_stamp = millis();
 }




As you said the keyboard is not usable unless you are on Windows, I totally agree that. I added note of this issue for potential users in first post finally.

Sorry for the late answer. The g80-3000 in Windows 10 seems to work perfectly after applying the patch.
Compiled under Ubuntu.
I'll use the keyboard continuously and update you if there are any problems.

Thanks :-)

Great. Thanks for the feedback. I'll merge the patch into master source repository.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Harima

  • Posts: 28
Re: USB to USB keyboard converter
« Reply #362 on: Thu, 23 August 2018, 20:53:49 »
Code: [Select]
input 1:  01 00 00 04 00 00 00 00
state:  01 00 04 00 00 00 00 00
keyboard_report: 04 00 00 00 00 00 00 00
input 1:  01 00 00 00 00 00 00 00
state:  01 00 00 00 00 00 00 00
keyboard_report: 00 00 00 00 00 00 00 00

Hey hasu. So I'm trying out this new pedal and as you can see it's giving me constant left ctrl in input 1 and state. Is this a problem I need to fix through the pedal or can I do something on the converter side?

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #363 on: Thu, 23 August 2018, 21:03:25 »
Code: [Select]
input 1:  01 00 00 04 00 00 00 00
state:  01 00 04 00 00 00 00 00
keyboard_report: 04 00 00 00 00 00 00 00
input 1:  01 00 00 00 00 00 00 00
state:  01 00 00 00 00 00 00 00
keyboard_report: 00 00 00 00 00 00 00 00

Hey hasu. So I'm trying out this new pedal and as you can see it's giving me constant left ctrl in input 1 and state. Is this a problem I need to fix through the pedal or can I do something on the converter side?

How does the pedal work directly on OS?
I guess it is not an usual HID keyboard and uses special form for its report. Do you happen to have its report descriptor?

EDIT: I mean the converter doesn't support it probably, I think you can still modify firmwware to support the pedal though.
« Last Edit: Thu, 23 August 2018, 21:05:07 by hasu »
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Harima

  • Posts: 28
Re: USB to USB keyboard converter
« Reply #364 on: Thu, 23 August 2018, 22:06:25 »
Code: [Select]
Interface 0 HID Report Descriptor Keyboard
Item Tag (Value) Raw Data
Usage Page (Generic Desktop) 05 01 
Usage (Keyboard) 09 06 
Collection (Application) A1 01 
    Report ID (1) 85 01 
    Usage Page (Keyboard/Keypad) 05 07 
    Usage Minimum (Keyboard Left Control) 19 E0 
    Usage Maximum (Keyboard Right GUI) 29 E7 
    Logical Minimum (0) 15 00 
    Logical Maximum (1) 25 01 
    Report Size (1) 75 01 
    Report Count (8) 95 08 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
    Report Count (1) 95 01 
    Report Size (8) 75 08 
    Input (Cnst,Ary,Abs) 81 01 
    Report Count (3) 95 03 
    Report Size (1) 75 01 
    Usage Page (LEDs) 05 08 
    Usage Minimum (Num Lock) 19 01 
    Usage Maximum (Scroll Lock) 29 03 
    Output (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 02 
    Report Count (5) 95 05 
    Report Size (1) 75 01 
    Output (Cnst,Ary,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 01 
    Report Count (6) 95 06 
    Report Size (8) 75 08 
    Logical Minimum (0) 15 00 
    Logical Maximum (-1) 25 FF 
    Usage Page (Keyboard/Keypad) 05 07 
    Usage Minimum (Undefined) 19 00 
    Usage Maximum 29 FF 
    Input (Data,Ary,Abs) 81 00 
End Collection C0 
Usage Page (Generic Desktop) 05 01 
Usage (Mouse) 09 02 
Collection (Application) A1 01 
    Report ID (2) 85 02 
    Usage (Pointer) 09 01 
    Collection (Physical) A1 00 
        Usage Page (Button) 05 09 
        Usage Minimum (Button 1) 19 01 
        Usage Maximum (Button 3) 29 03 
        Logical Minimum (0) 15 00 
        Logical Maximum (1) 25 01 
        Report Count (3) 95 03 
        Report Size (1) 75 01 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
        Report Count (1) 95 01 
        Report Size (5) 75 05 
        Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 03 
        Usage Page (Generic Desktop) 05 01 
        Usage (X) 09 30 
        Usage (Y) 09 31 
        Usage (Wheel) 09 38 
        Logical Minimum (-127) 15 81 
        Logical Maximum (127) 25 7F 
        Report Size (8) 75 08 
        Report Count (3) 95 03 
        Input (Data,Var,Rel,NWrp,Lin,Pref,NNul,Bit) 81 06 
    End Collection C0 
End Collection C0 
Usage Page (Generic Desktop) 05 01 
Usage (Game Pad) 09 05 
Collection (Application) A1 01 
    Report ID (4) 85 04 
    Usage (Pointer) 09 01 
    Collection (Physical) A1 00 
        Usage (X) 09 30 
        Usage (Y) 09 31 
        Logical Minimum (-1) 15 FF 
        Logical Maximum (1) 25 01 
        Report Count (2) 95 02 
        Report Size (2) 75 02 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
    End Collection C0 
    Report Count (4) 95 04 
    Report Size (1) 75 01 
    Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 03 
    Usage Page (Button) 05 09 
    Usage Minimum (Button 1) 19 01 
    Usage Maximum (Button 8) 29 08 
    Logical Minimum (0) 15 00 
    Logical Maximum (1) 25 01 
    Report Count (8) 95 08 
    Report Size (1) 75 01 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
End Collection C0 
Usage Page (Consumer Devices) 05 0C 
Usage (Consumer Control) 09 01 
Collection (Application) A1 01 
    Report ID (3) 85 03 
    Usage (Volume Decrement) 09 EA 
    Usage (Volume Increment) 09 E9 
    Usage (Mute) 09 E2 
    Usage (Play/Pause) 09 CD 
    Usage (Scan Previous Track) 09 B6 
    Usage (Scan Next Track) 09 B5 
    Usage (Stop) 09 B7 
    Usage (AC Home) 0A 23 02 
    Logical Minimum (0) 15 00 
    Logical Maximum (1) 25 01 
    Report Count (8) 95 08 
    Report Size (1) 75 01 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
    Usage (AL Local Machine Browser) 0A 94 01 
    Usage (AL Email Reader) 0A 8A 01 
    Usage (AL Calculator) 0A 92 01 
    Usage (AC Search) 0A 21 02 
    Usage (AL Consumer Control Configuration) 0A 83 01 
    Report Count (5) 95 05 
    Report Size (1) 75 01 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
    Usage Page (Generic Desktop) 05 01 
    Usage (System Sleep) 09 82 
    Usage (System Power Down) 09 81 
    Report Size (1) 75 01 
    Report Count (2) 95 02 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
    Report Count (1) 95 01 
    Report Size (1) 75 01 
    Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 03 
    Usage Page (Consumer Devices) 05 0C 
    Report Count (1) 95 01 
    Report Size (16) 75 10 
    Usage Minimum (Undefined) 19 00 
    Usage Maximum (AC Zoom Out) 2A 2E 02 
    Logical Maximum (558) 26 2E 02 
    Input (Data,Ary,Abs) 81 00 
End Collection C0 


EDIT: I got it to work properly on the machine I wanted it to work on, it was a problem with KVM, but I still want to know if there's anything I can do to change the left ctrl thing
« Last Edit: Thu, 23 August 2018, 22:21:05 by Harima »

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #365 on: Thu, 23 August 2018, 23:52:31 »
As I guessed it is not usual simple keyboard using specific report this converter doesn't support.

You have to parse the specific report yourself,  according to its report descriptor it is identical to usual boot keyboard(6KRO) except for preceding Report ID(01). It seems to support also mouse and media keys.

So this report should be read as Report ID(01), no modifiers(00), reserved byte(00), A key(04),....
Code: [Select]
input 1:  01 00 00 04 00 00 00 00

This would be helpful if you want to learn HID report descriptor.
http://www.usb.org/developers/hidpage/HID1_11.pdf
http://www.usb.org/developers/hidpage/Hut1_12v2.pdf
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline tofgerl

  • Posts: 887
  • Location: Norway
Re: USB to USB keyboard converter
« Reply #366 on: Wed, 29 August 2018, 01:46:49 »
@Hasu: This did fix my Realforce RGB power problem, as you suggested. Took me ages to remember to bring it home for reprogramming, though I definitely remembered every time I had to reinsert it after sleep... ;)

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #367 on: Wed, 29 August 2018, 08:12:00 »
@Hasu: This did fix my Realforce RGB power problem, as you suggested. Took me ages to remember to bring it home for reprogramming, though I definitely remembered every time I had to reinsert it after sleep... ;)

Great. Thanks for the feedback.

My initial guess was that Realforce RGB's power draw caused, but I was wrong.
https://geekhack.org/index.php?topic=69169.msg2414747#msg2414747

In fact it is initialization timing, the keyboard startup process seems to be slow somewhat in comparison with others. LED setting report from converter prevented the keyboard from starting up in the end. This is related commit, for reference.
https://github.com/tmk/tmk_keyboard/commit/c2ce617a363f3b9d43aa81f98e70d58f928931f4
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline AdrianMan

  • Posts: 51
Re: USB to USB keyboard converter
« Reply #368 on: Wed, 12 September 2018, 03:07:56 »
Hello Hasu & everyone :)

I got the USB to USB converter and want to add some info to the compatible/incompatible keyboards list:

Compatible: Leopold FC750R PD - All keys work well, except the FN key from the FC750R that can not be mapped as anything else.

Uncompatible: Xiaomi Yuemi MK02s - it's not working at all.

I'm also looking for ways to program some macros (some strings) on a few keys, but I don't have the skills to do that ... is anyone willing to help me ?

Thanks !

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #369 on: Wed, 12 September 2018, 08:52:57 »
Thanks for the report. I just updated first post.

If you have time could you post 'USB descriptor' of MK02S? It may give some useful info to fix firmware.
https://github.com/tmk/tmk_keyboard/wiki/USB-Descriptor
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline AdrianMan

  • Posts: 51
Re: USB to USB keyboard converter
« Reply #370 on: Wed, 12 September 2018, 13:11:13 »
Thanks for the report. I just updated first post.

If you have time could you post 'USB descriptor' of MK02S? It may give some useful info to fix firmware.
https://github.com/tmk/tmk_keyboard/wiki/USB-Descriptor

Sure !

It will take a bit though, as I'm using the board as a main driver at work and all downloads & admin rights are blocked there :))

But will look into it when I'll bring the board home for rotation.

Will return with info, as I would like a lot to be able to use the converter with that board also :)

Cheers !

Offline online

  • Posts: 140
Re: USB to USB keyboard converter
« Reply #371 on: Sat, 15 September 2018, 15:37:16 »
Is there a possibility to put 2 USB ports onto the pcb?
atm I use a usb hub to connect two logitech keyboards, which works fine but it's very baulky.

I could integrate the usb hub into u2u pcb, but are there a better solution than that?

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #372 on: Sat, 15 September 2018, 16:33:43 »
Find the smallest usb hub in the market and hotglue it on the pcb?
Or you have to design new pcb integrated with usb hub chip and ports.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline online

  • Posts: 140
Re: USB to USB keyboard converter
« Reply #373 on: Sat, 20 October 2018, 18:05:05 »
Find the smallest usb hub in the market and hotglue it on the pcb?
Or you have to design new pcb integrated with usb hub chip and ports.

I took up your suggestion, trying to integrate USB hub chip to the PCB, but first I want to get the original U2U PCB and USB hub working before to doing so.
Downloaded kicad project from git hub (thanks for sharing!). Plotted Gerber file from kicad without modification, and the PCB arrived yesterday.

Soldered all the parts that listed in BOM.txt. Plugged into my PC (Win10) and it works! It recognized by Flip and successfully flashed a hex file generated from TMK keymap editor. It works perfectly for around 10mins.

Then it disconnected from PC and shown 'USB device is not recognized'. I then unplug and plug in again, still not recognized.
When I left it to unplug for ~10mins then plugin, it will work for ~5mins, then it disconnects and not recognized by PC again.

I thought I burnt the IC when soldering but I've soldered 3 PCBs, all have the exact same problem.

There's one confusion, I used 18p capacitors for both crystals as per the BOM, but the PCB silk print shows as 10p. Would it be the problem?


TL;DR - USB2USB works for 10mins then it became unrecognized by PC(Win10).

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #374 on: Sat, 20 October 2018, 19:37:16 »
don't trust the BOM.txt too much, I might not maintain the file. You will have to chceck datasheet of your component to know proper value for the capacitor.  I use 10pF for crystal's currently, btw.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline online

  • Posts: 140
Re: USB to USB keyboard converter
« Reply #375 on: Sun, 21 October 2018, 06:52:08 »
don't trust the BOM.txt too much, I might not maintain the file. You will have to chceck datasheet of your component to know proper value for the capacitor.  I use 10pF for crystal's currently, btw.
Ok. will get it again. thanks for reply.

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #376 on: Fri, 26 October 2018, 21:04:02 »
STL file of enclosure designed for this converter is available on repo now. Thank you, Gouty@github!
https://github.com/tmk/USB2USB_Converter/tree/master/3D%20Printed%20Case

Try 3D print of the file.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline PierceSutton

  • Posts: 17
Re: USB to USB keyboard converter
« Reply #377 on: Sun, 28 October 2018, 11:43:10 »
So I made a converter and it is working just as it should, although I've been wondering if I can adjust things with mouse movement or if I can ask the key to be held down for a certain amount of time after just tapping it? Is it also possible for one key to have multiple functions assigned to it?
Original Apple Extended, Orange Alps

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #378 on: Sun, 28 October 2018, 19:50:48 »
So I made a converter and it is working just as it should, although I've been wondering if I can adjust things with mouse movement or if I can ask the key to be held down for a certain amount of time after just tapping it? Is it also possible for one key to have multiple functions assigned to it?

Great, post pic of your converter here! I'm curious about how you made it.


You can configure mousekey with these parameters, define your setting in your config.h.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/mousekey.c#L35-L53

And you may want to check Tap key.
https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#213-modifier-with-tap-keydual-role

If you still have further quesiton post in this thread which is for general discussion of TMK firmware.
https://geekhack.org/index.php?topic=41989.0
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline netbike

  • Posts: 8
  • Location: Hong Kong
Re: USB to USB keyboard converter
« Reply #379 on: Sun, 11 November 2018, 03:48:06 »
Hi Hasu,  thank you very much for your work on all those wonder devices and I really appreciate your sharing.  One question about the usb to usb device.  I am using a diy module i.e. usb host shield 2.0 with pro micro 3.3v 16mhz combo and it works,  I would like to put this little thing into my filco 87 however after short period of using the module, I find that the start up sequence does not allow me to put the module into a keyboard case as the module does not work if I plug it first to the keyboard.  I have to plug it to the computer usb port and then the keyboard.  Is there any work around to solve this or is this a bug of my module?
Many thanks.

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #380 on: Sun, 11 November 2018, 06:26:04 »
Hi Hasu,  thank you very much for your work on all those wonder devices and I really appreciate your sharing.  One question about the usb to usb device.  I am using a diy module i.e. usb host shield 2.0 with pro micro 3.3v 16mhz combo and it works,  I would like to put this little thing into my filco 87 however after short period of using the module, I find that the start up sequence does not allow me to put the module into a keyboard case as the module does not work if I plug it first to the keyboard.  I have to plug it to the computer usb port and then the keyboard.  Is there any work around to solve this or is this a bug of my module?
Many thanks.


If you are using firmware downloaded from Keymap Editor, try to compile from the latest repo.
And post hid_listen output here.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline netbike

  • Posts: 8
  • Location: Hong Kong
Re: USB to USB keyboard converter
« Reply #381 on: Sun, 11 November 2018, 06:37:31 »
Hi Hasu,

Thanks for reply,  I complied firmware using tmk-firmware via ubunto makefile.  Attached is the hex file that I am using. 

Cheers,


Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #382 on: Sun, 11 November 2018, 06:43:14 »
then, hid_listen output would be helpuful.

And  try adding huge capacitor(around 100uF?) between vbus and gnd to mitigate inrush current, it may do something good for you.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #383 on: Sun, 11 November 2018, 06:55:40 »
Hi Hasu,

Thanks for reply,  I complied firmware using tmk-firmware via ubunto makefile.  Attached is the hex file that I am using. 

Cheers,



hmm, that firmware you attached doesn't seem to me be the latest. Are you sure you're using the latest git repo?

The latest firmware should output to hid_listen like below:
Quote

Device disconnected.
Waiting for new device:........
Listening:
Keyboard init.
[C]usb_state: 12

Keyboard start.

while your firware does like this:
Quote

Device disconnected.
Waiting for new device:...
Listening:
init: done
usb_state: 12
« Last Edit: Sun, 11 November 2018, 06:59:49 by hasu »
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline netbike

  • Posts: 8
  • Location: Hong Kong
Re: USB to USB keyboard converter
« Reply #384 on: Sun, 11 November 2018, 07:10:18 »
Thanks Master,  let me download the latest and try again.

Offline netbike

  • Posts: 8
  • Location: Hong Kong
Re: USB to USB keyboard converter
« Reply #385 on: Sun, 11 November 2018, 08:41:58 »
Thank you Hasu, looks like it works now. 


Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #386 on: Sun, 11 November 2018, 18:32:46 »
Great! Added to compatibility list in the first post.
Your keyobard is actually Filco Majestouch 2 Tenkeyless(87-key), right?
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline netbike

  • Posts: 8
  • Location: Hong Kong
Re: USB to USB keyboard converter
« Reply #387 on: Sun, 11 November 2018, 18:56:06 »
Hi Hasu, yes it is and thanks.  I tried usb2usb on my ikbc kd87 and it works too.

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #388 on: Sun, 11 November 2018, 19:21:23 »
netbike, thank you for the input!
Updated the compatibility list again.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline netbike

  • Posts: 8
  • Location: Hong Kong
Re: USB to USB keyboard converter
« Reply #389 on: Mon, 12 November 2018, 01:41:29 »
Hi Hasu, just walk through the web version of the tmk keyboard configurator.  Wonder if it is necessary to add a "RESET" button.  As I am preparing to put the usb2usb module inside the keyboard.  Thanks again and looking forward for your insight.

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #390 on: Mon, 12 November 2018, 08:27:34 »
Yes, you need the button to flash firmware.

EDIT: You would be able to add key combo to turn your converter into program mode with some firmware tweaks, but it is not supported by default at this time at least.
« Last Edit: Mon, 12 November 2018, 08:32:19 by hasu »
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline netbike

  • Posts: 8
  • Location: Hong Kong
Re: USB to USB keyboard converter
« Reply #391 on: Mon, 12 November 2018, 09:11:22 »
Tks again Hasu, and looking forward to.

Offline Hanks

  • Posts: 16
Re: USB to USB keyboard converter
« Reply #392 on: Fri, 23 November 2018, 14:02:35 »
Hi hasu. The USB to USB converter helped me a lot with my unifying keyboard(Logitech k230), but I encounter a problem with HHKB pro2(PD-KB400W), it seems the U2U not working with HHKB. the HHKB is working properly without  USB to USB converter,  USB to USB converter also work well with other keyboards. Should HHKB pro2 use some other firmware instead?
« Last Edit: Fri, 23 November 2018, 14:04:48 by Hanks »

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #393 on: Sat, 24 November 2018, 14:21:15 »
Hanks,
Thank you for the input.  Good to know Unifying receiver works!

I just confirmed HHKB Pro2 has weird startup problem in my setup;
1) hook up converter to USB port first, then replug HHKB into the converter
1-a) without 2m USB cable and hook up to port directly it works almost everytime.
1-b) with 2m USB cable it fails at about 50% rate.

2) plug HHKB into the converter first, then hook up them to USB port,
it works almost everytime regardless with/without USB cable.

At startup communication between converter and USB hub integrated in the keyboard is likely to fail(DATA0/1 toogle error), it seems to depend on its timing and power line voltage drop, perhaps. That said, firmware should handle the error properly but it can't at this time.

How do you connect HHKB and converter in your setup?
Try attached firmware which is ad-hoc-fixed for the error handling.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline cajhin

  • Posts: 1
Re: USB to USB keyboard converter
« Reply #394 on: Sat, 24 November 2018, 18:13:46 »
Hi hackers, I'm new around here. Bought Hasu's usb_usb in 2016 because it's so cool, but never dared to jump into it.
Now I've spent 20h, figured out most of what I need, but I could use some help.

I want to recreate a complex Autohotkey/Karabiner script that I've used a lot (A LOT) on every machine I touch.
usb_usb really needs to be 99% the same or I'll get confused.

Basically:
- CapsLock is hyper key (no problem)
- caps + alphakeys = cursor control (no problem)
- tap caps + 1 alphakey = special characters like (problem)

I send the special chars with Alt-codes, that works, but I cannot configure (CapsPressed->layer5) & (CapsTapped->layer6).

Bonus question (haven't seen this anywhere):
is there a way to remap keys on the fly (without rebooting the stick and using boot magic)?
I use many machines, and some need y<>z switched, some need LWin<>LAlt.

Thanks for reading this, thanks a lot for helping out :-)

Offline Hanks

  • Posts: 16
Re: USB to USB keyboard converter
« Reply #395 on: Sat, 24 November 2018, 22:22:51 »
Hasu,
    Thanks for the prompt reply. I flashed the firmware you attached and try the following ways:
1.  Plug HHKB into the converter first, then hook up them to USB port, HHKB no responding.
2.  Hook up converter to USB port first, then replug HHKB into the converter(using cable attached with pro2), HHKB no responding.
3.  Hook up converter to USB port first, plug in unifying receiver, unifying keyboard working. Unplug unifying receiver, plug in HHKB, no responding. Unplug HHKB, plug in unifying receiver, unifying keyboard working.

I also repeat these steps on the privous firmware, also no responding

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #396 on: Mon, 26 November 2018, 01:36:47 »
Hasu,
    Thanks for the prompt reply. I flashed the firmware you attached and try the following ways:
1.  Plug HHKB into the converter first, then hook up them to USB port, HHKB no responding.
2.  Hook up converter to USB port first, then replug HHKB into the converter(using cable attached with pro2), HHKB no responding.
3.  Hook up converter to USB port first, plug in unifying receiver, unifying keyboard working. Unplug unifying receiver, plug in HHKB, no responding. Unplug HHKB, plug in unifying receiver, unifying keyboard working.

I also repeat these steps on the privous firmware, also no responding

Thanks for the test.
If you are using USB cable try short one as possible or plugin directly to USB port. Also powered hub would be helpful, at least in my setup, if you have try it.

Could you get debug output  with 'hid_listen' tool?
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Hanks

  • Posts: 16
Re: USB to USB keyboard converter
« Reply #397 on: Mon, 26 November 2018, 11:22:08 »
Hasu,
    Thanks for the prompt reply. I flashed the firmware you attached and try the following ways:
1.  Plug HHKB into the converter first, then hook up them to USB port, HHKB no responding.
2.  Hook up converter to USB port first, then replug HHKB into the converter(using cable attached with pro2), HHKB no responding.
3.  Hook up converter to USB port first, plug in unifying receiver, unifying keyboard working. Unplug unifying receiver, plug in HHKB, no responding. Unplug HHKB, plug in unifying receiver, unifying keyboard working.

I also repeat these steps on the privous firmware, also no responding

Thanks for the test.
If you are using USB cable try short one as possible or plugin directly to USB port. Also powered hub would be helpful, at least in my setup, if you have try it.

Could you get debug output  with 'hid_listen' tool?

I am using a powered hub with 5V2A psu, try another 1m cable, get the same result.

here is the hid_listen result after I plug HHKB into the converter first, then hook up them to USB port:
Device disconnected.
Waiting for new device:.........
Listening:
usb_state: 40
usb_state: 50
usb_state: 51
host.Task: 308
usb_state: 90
speed: full
h1s1h2s1s2s3h1s1h1s1h2s1s2s3

after spped: full, seems something interesting happened



Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #398 on: Mon, 26 November 2018, 19:36:54 »
hmm, it is not what I expected, it may be another issue with your setup.

can you try new firmware to see debug log more? Repluging keyboard a few times would be helpful when getting log. This is log in my setup, just for reference.


Quote
Waiting for new device:......
Listening:
ccpPh2s1cs2cs3ch9host.Task: 2552
__usb_state: 12
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
CcI0cccccchost.Task: 311
usb_state: 90
speed: full
xXh1s1cpPh2s1cs2cs3ch9h1s1cph1s1ccI0ccccccccpPh2s1cs2cs3ch9input 9: 00 00 00 00 00 00 00 00
host.Task: 2552
state:  00 00 00 00 00 00 00 00
__usb_state: 12
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
CcI0cccccchost.Task: 309
usb_state: 90
speed: full
xXTeh1s1cpPh2s1cs2cs3ch9h1s1cph1s1ccI0ccccccccpPh2s1cs2cs3ch9input 9: 00 00 00 00 00 00 00 00
host.Task: 2553
state:  00 00 00 00 00 00 00 00
__usb_state: 12
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
CcI0cccccchost.Task: 309
usb_state: 90
speed: full
xXh1s1cpPh2s1cs2cs3ch9h1s1cph1s1ccI0ccccccccpPh2s1cs2cs3ch9input 9: 00 00 00 00 00 00 00 00
host.Task: 2552
state:  00 00 00 00 00 00 00 00
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 2909
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #399 on: Mon, 26 November 2018, 19:43:26 »
- tap caps + 1 alphakey = special characters like (problem)

I send the special chars with Alt-codes, that works, but I cannot configure (CapsPressed->layer5) & (CapsTapped->layer6).
For short answer you can't. You need action like 'one-shot layer' but current firmware doesn't support it. As for alt-code you can send it with 'Macro' action but it is not well organized/documented at this time and should be refactored in future.


Quote
Bonus question (haven't seen this anywhere):
is there a way to remap keys on the fly (without rebooting the stick and using boot magic)?
I use many machines, and some need y<>z switched, some need LWin<>LAlt.

Thanks for reading this, thanks a lot for helping out :-)


I think you can 'layer toggle 'action for this purpose. Define a layer with swaping y and z and you can switch on/off the layer with the 'layer toggle'. But that layer setting is not retained across replug.

https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#223-toggle-switch

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt