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

0 Members and 1 Guest are viewing this topic.

Offline Hanks

  • Posts: 14
Re: USB to USB keyboard converter
« Reply #400 on: Mon, 26 November 2018, 20:33:11 »
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

now I got something like this:
Device disconnected.
Waiting for new device:..
Listening:
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
CcI0cccccchost.Task: 309
usb_state: 90
speed: full
xXh1s1cph1s1cpPh2s1cs2cs3ch9

Offline hasu

  • Thread Starter
  • Posts: 2841
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #401 on: Tue, 27 November 2018, 00:34:42 »
Didn't 'repluging only keyboard' show more output?
And what is your os, btw?
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Hanks

  • Posts: 14
Re: USB to USB keyboard converter
« Reply #402 on: Tue, 27 November 2018, 18:09:52 »
Didn't 'repluging only keyboard' show more output?
And what is your os, btw?
My os system is windows 10
I do more test, here is the result:
Waiting for device:      // usb port in my desktop
Listening:         //Hook up converter to USB port first, then replug HHKB into the converter 
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
CcI0cccccchost.Task: 309
usb_state: 90
speed: full
xXh1s1cph1s1cpPh2s1cs2cs3ch9 
Device disconnected.
Waiting for new device:....
Listening:         //Plug HHKB into the converter first, then hook up them to USB port, HHKB no responding.

Device disconnected.
Waiting for new device:....
Listening:         // Unplug HHKB, plug in unifying receiver, unifying keyboard working.
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
CcI0cccccchost.Task: 308
usb_state: 90
speed: full
xXh1s1cph1s1cpPh2s1cs2cs3ch9__usb_state: 12
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
CcI0cI0ccccccchost.Task: 2709
usb_state: 90
speed: full
xXinput 1: 00 00 5D 00 00 00 00 00
state:  00 00 5D 00 00 00 00 00
keyboard: 00 00 5D 00 00 00 00 00
input 1: 00 00 5D 5E 00 00 00 00
state:  00 00 5D 5E 00 00 00 00
keyboard: 00 00 5D 5E 00 00 00 00
input 1: 00 00 5E 00 00 00 00 00
state:  00 00 5E 00 00 00 00 00
keyboard: 00 00 00 5E 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
state:  00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00
_________________________________________________________
using usb hub with power supply:
Device disconnected.
Waiting for new device:..........//Hook up converter to USB port first, then replug HHKB into the converter
Listening:
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
CcI0cccccchost.Task: 310
usb_state: 90
speed: full
xXh1s1cpPh2s1cs2cs3ch9h1s1cph1s1cpPh2s1cs2cs3ch9__usb_state: 12

Device disconnected.
Waiting for new device:......//Plug HHKB into the converter first, then hook up them to USB port, HHKB no responding.
Listening:
pPh2s1cs2cs3ch9
Device disconnected.
Waiting for new device:.....//Plug HHKB into the converter first, then hook up them to USB port, HHKB no responding.
Listening:
__usb_state: 12// Unplug HHKB, plug in unifying receiver, unifying keyboard working.
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
CcI0cI0ccccccchost.Task: 2709
usb_state: 90
speed: full
xXinput 1: 00 00 5A 00 00 00 00 00
state:  00 00 5A 00 00 00 00 00
keyboard: 00 00 5A 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
state:  00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00

Offline hasu

  • Thread Starter
  • Posts: 2841
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #403 on: Wed, 28 November 2018, 01:07:26 »
Hanks,
Thanks for the log. I don't see any clear clue so far, though, I'm still suspecting voltage as one of causes. Your log doesn't show error I found in my setup, your problem may be different, perhaps.

I'll work on the Hub intialization issue I found anyway, I'll let you know if I find something there.

What's your desktop mother board? I like to know USB host controller(chipset) in particular.
And, is your converter TMK preassembled one or DIY?

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Hanks

  • Posts: 14
Re: USB to USB keyboard converter
« Reply #404 on: Wed, 28 November 2018, 09:44:50 »
Hanks,
Thanks for the log. I don't see any clear clue so far, though, I'm still suspecting voltage as one of causes. Your log doesn't show error I found in my setup, your problem may be different, perhaps.

I'll work on the Hub intialization issue I found anyway, I'll let you know if I find something there.

What's your desktop mother board? I like to know USB host controller(chipset) in particular.
And, is your converter TMK preassembled one or DIY?
Hasu, thanks very much for your help :). My motherboard is asus b350i(chipset AMD b350), My converter is a DIY one. It's my exam week recently, I will test it on another computer later to see if I can get some different log.

Offline 1ceman

  • Posts: 4
  • Location: The Netherlands
Re: USB to USB keyboard converter
« Reply #405 on: Wed, 02 January 2019, 15:02:19 »
I've just received the USB-USB converter and I'm trying to make it work with my Novatouch. The main thing for me was to remap Caps Lock key to Ctrl when holding and Esc when tapped. This part worked flawlessly. Then I wanted to map the now missing Caps Lock to Fn + Tab. This is where I'm stuck now. I'm trying to use the online layout editor and it seems that Fn key (which is mapped to L1) is not doing anything. Am I doing something wrong? Should I try to build the firmware and drop the online editor? Here is the layout I'm flashing: https://bit.ly/2BSo8O2

P.S. When I first connected the converter, there was a glowing LED on it. After flashing it, LED is not glowing. Is this by design?

Offline hasu

  • Thread Starter
  • Posts: 2841
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #406 on: Wed, 02 January 2019, 17:18:40 »
In that L1 key position is Application (or Menu) key on usual  keyboards while it is FN in Novatouch. As Limitations section in first post says the converter cannot remap the FN key. You have to move L1 to o other key like right control or right windows(RGUI). If Novatouch can change the FN key to any normal key somehow, you can remap the key with the converter.

Yes I changed how LED works at some point.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline 1ceman

  • Posts: 4
  • Location: The Netherlands
Re: USB to USB keyboard converter
« Reply #407 on: Wed, 02 January 2019, 17:40:03 »
That was a very fast reply, thank you!

Offline PierceSutton

  • Posts: 15
Re: USB to USB keyboard converter
« Reply #408 on: Sun, 13 January 2019, 22:19:58 »
I'm not entirely sure this is how it works, I know very little about C, but here is my attempt on making another key modifier for rapid tapping when you are holding a certain key.
Code: [Select]
#ifndef RAPID_TAPPING
    dprint(" layer_state: "); layer_debug();
    dprint(" default_layer_state: "); default_layer_debug();
#endif
    dprintln();
    int x = 1;
    switch (action.kind.id) {
        case ACT_LMODS:
        case ACT_RMODS:
            {
                uint8_t mods = (action.kind.id == ACT_LMODS) ?  action.key.mods :
                                                                action.key.mods<<4;
                if (event.pressed && x = 1) {
                    if (mods) {
                        add_weak_mods(mods);
                        send_keyboard_report();
                        x = 0;
                    }
                    register_code(action.key.code);
                } else {
                    x = 1;
                    unregister_code(action.key.code);
                    if (mods) {
                        del_weak_mods(mods);
                        send_keyboard_report();
                    }
                }
            }
            break;
So I copied what I believed to be the default key press and made it so that every time it registers a press it changes an int so that the next time it will skip, and every time it skips or the key is not being press, it changes the int value so that it wont skip the next time. My only worry is that the int will keep being changed every time the method is called so that  it doesn't skip.
Original Apple Extended, Orange Alps

Offline hasu

  • Thread Starter
  • Posts: 2841
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #409 on: Mon, 14 January 2019, 07:05:42 »
I think you want to use 'static variable' for the int x. Just try adding 'static' to it.
https://en.wikipedia.org/wiki/Static_variable
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline ustczzh

  • Posts: 1
Re: USB to USB keyboard converter
« Reply #410 on: Mon, 14 January 2019, 07:23:27 »
Thanks to Hasu, I made my usb to usb converter with Pro Micro and USB Host Shield mini.
210551-0

I found a special kind of bluetooth adapter, "DXT28", which is originally made for bluetooth keyboard support for Hackintosh or BIOS.
I think it acts as a bluetooth master device, stores the last successful connection in its own EEPROM and can start auto-connection once powered.
210553-1

I use it with usb to usb converter, so that HHKB BT can have tmk firmware. Finally, Customizable keymap for HHKB BT! Thank you very much, Hasu!
210555-2

Another picture for DXT28. It only supports up to bluetooth 3.0.
210606-3
« Last Edit: Mon, 14 January 2019, 21:08:38 by ustczzh »

Offline PierceSutton

  • Posts: 15
Re: USB to USB keyboard converter
« Reply #411 on: Mon, 14 January 2019, 17:04:32 »
How would I assign a key to "RAPID_TAPPING", Also how would I set it to a second transparent layer since I only want to add it to space bar when needed.
I have not done any modifications to the files other than action.c , will I need to add the method to action.h ???
Original Apple Extended, Orange Alps

Offline hasu

  • Thread Starter
  • Posts: 2841
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #412 on: Mon, 14 January 2019, 17:23:31 »
ustczzh, thanks for the report. Added it to the first post.

PierceSutton,
1) include that code in action_function() of unimap.c.
2) define action name like AC_RAPPID_TAPPING(or other short useful name) using 'ACTION_FUNCTION_TAP' in unimap.c. you must have  'AC_'  prefix in the name. Like this line,
https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hhkb/unimap_hasu.c#L41

3) use the name without 'AC_' in action mapping(actionmaps[][][]).

You can refer to this code but it may be complicated. No clear document about this, you will have to traverse source code in the repo and speculate how action_function() works at this time unfortunately.
https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hhkb/unimap_hasu.c
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline PierceSutton

  • Posts: 15
Re: USB to USB keyboard converter
« Reply #413 on: Tue, 15 January 2019, 13:42:27 »
Could you specify which unimap.c file, Do you mean the one in converter or the the one in tmk_core.
Original Apple Extended, Orange Alps

Offline hasu

  • Thread Starter
  • Posts: 2841
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #414 on: Wed, 16 January 2019, 17:31:01 »
Could you specify which unimap.c file, Do you mean the one in converter or the the one in tmk_core.

I meant one in converter directory.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline fr08

  • Posts: 2
Re: USB to USB keyboard converter
« Reply #415 on: Mon, 21 January 2019, 11:35:28 »
I can report that the converter works just fine with the Varmilo VA88M :)  :thumb:

Also works with my Max Falcon 8, but I'm guessing that's a bit more obscure

Offline Hypersphere

  • Posts: 1840
  • Location: USA
Re: USB to USB keyboard converter
« Reply #416 on: Fri, 25 January 2019, 13:44:18 »
Has anyone else here done 3D printing of the Hasu USB-USB enclosure (case)?

I had the STL file printed for me. The USB-USB converter with the shrink wrap does not fit into the enclosure. I have not yet tried it without the shrink wrap. I suppose the dimensions of the enclosure were based on the bare USB-USB converter without the shrink wrap. It looks as though it will be a tight fit even without the shrink wrap.


Offline Gouty

  • Posts: 36
Re: USB to USB keyboard converter
« Reply #417 on: Mon, 28 January 2019, 17:52:07 »
Hi! Yeah, the case was designed without heat shrink on the PCB in mind.  Maybe if I get around to a proper version 2 I'll give it a little more space.

Also, something tells me that Hasu is going to be busy in the near future:


Offline fine_italian_leather

  • Posts: 120
  • Location: Sweden
Re: USB to USB keyboard converter
« Reply #418 on: Mon, 28 January 2019, 17:58:56 »
Congrats on getting featured on LTT!

Offline PatrickR

  • Posts: 6
Re: USB to USB keyboard converter
« Reply #419 on: Sun, 17 February 2019, 09:52:00 »
Thanks to Hasu, I made my usb to usb converter with Pro Micro and USB Host Shield
Hello ustczzh,

I tried it also with an Pro Micro and USB Host Shield mini.
But I guess I took the wrong files. It doesn‘t work.
Then I had to priorize other tasks.
Maybe you can share your files which you used ?
That would be great.
It would be a very good point for me to start again.

Many thanks in advance.

Best wishes,
Patrick
« Last Edit: Sun, 17 February 2019, 09:53:40 by PatrickR »

Offline Hypersphere

  • Posts: 1840
  • Location: USA
Re: USB to USB keyboard converter
« Reply #420 on: Wed, 20 February 2019, 13:10:19 »
@Hasu: I am using your USB-USB converter with my new RF R2 TKL PFU Edition keyboard. It works fine, except when I reboot the computer, I need to unplug and replug the converter into the computer in order to get the keboard to work. Is this normal?