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

0 Members and 1 Guest are viewing this topic.

Offline haydoselefantes

  • Posts: 51
  • Location: Los Angeles
Re: USB to USB keyboard converter
« Reply #600 on: Fri, 06 November 2020, 13:44:26 »
haydoselefantes,
What OS are you guys on? Mac OS?
This issue happens on Linux or Windows too?
Other keys than CapsLock still have same problem?

I only see this issue on Mac OS.  Works as expected in Windows.  Sorry, I hadn't tested Windows, even though this FC980C is on a USB switch between Windows and Mac machines :)

I guess TAP keys send signal of press and release too in succession.
Some time ago MacOS changed how to recognize caps lock and it ignores too fast transition of the key.
You may change this setting in Preference panel or somewhere but not sure.

You're right.  I should have known your stuff was working perfectly!  Is there an easy way to increase duration of the keypress generated by TAP_KEY?  100 ms might work

Off topic, but: CapsLockNoDelay fixes this issue for me on Mac OS Catalina.
 
Neither of the SO workarounds change the behavior on Catalina (Mac OS 10.15.7).  This is not surprising, I vividly remember High Sierra changing/breaking a ton of keyboard functionality.  I'm not going to try karabiner, one of the best things about the alt controllers is not having to deal with karabiner!
« Last Edit: Fri, 06 November 2020, 17:37:15 by haydoselefantes »

Offline hasu

  • Thread Starter
  • Posts: 3149
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #601 on: Sat, 07 November 2020, 03:28:27 »

I guess TAP keys send signal of press and release too in succession.
Some time ago MacOS changed how to recognize caps lock and it ignores too fast transition of the key.
You may change this setting in Preference panel or somewhere but not sure.

You're right.  I should have known your stuff was working perfectly!  Is there an easy way to increase duration of the keypress generated by TAP_KEY?  100 ms might work

Yes, it is a workaround. I updated fimware again, download from Keymap Editor and try the TAP_KEY(Capslock). I think it should work now unless I mistook something.


Quote
Off topic, but: CapsLockNoDelay fixes this issue for me on Mac OS Catalina.
 
Neither of the SO workarounds change the behavior on Catalina (Mac OS 10.15.7).  This is not surprising, I vividly remember High Sierra changing/breaking a ton of keyboard functionality.  I'm not going to try karabiner, one of the best things about the alt controllers is not having to deal with karabiner!

Good to know the infos. Thanks.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline nevin

  • Posts: 977
  • Location: US
Re: USB to USB keyboard converter
« Reply #602 on: Sat, 07 November 2020, 04:10:30 »
thanks Hasu
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline haydoselefantes

  • Posts: 51
  • Location: Los Angeles
Re: USB to USB keyboard converter
« Reply #603 on: Sat, 07 November 2020, 13:08:41 »
Yes, it is a workaround. I updated fimware again, download from Keymap Editor and try the TAP_KEY(Capslock). I think it should work now unless I mistook something.

Thanks!

I tried to use the new firmware a couple of times and don't see any change.  I may be doing something wrong.  I went to the keymap editor, loaded a file with my existing firmware, changed Caps Lock to be plain Caps Lock, then changed Caps Lock back to ACTION_LAYER_TAP_KEY, downloaded and flashed.

Can you please try it out also nevin?

Offline daniel123

  • Posts: 3
Re: USB to USB keyboard converter
« Reply #604 on: Sun, 22 November 2020, 06:28:30 »
Hi Hasu,

I got your USB to USB converter and it works very well with a random keyboard. Thanks for that :)

When browsing the internet for a fix to the replug issue, I found a fix that you presented in this forum. It works just fine with my keyboard, I just have one question.

I would like to be able to change the keymap.c file but if I compile the keymap.c (see below) I always get issues with missing unimap.h or, if I copy those from other locations into my keyboard location, other errors with brackets and stuff.

I'm very new to this and basically have not much programming background. I want to understand it and I would be happy if you can point me to what is causing this issue, i.e. why is your compiled version running without any issues, and why can I not compile it myself?

Thanks a lot  :thumb:


zucca,
Code below is modified 'unimap.c' for your purpose, copy it to usb_usb directory. You can build with `make -f Maefile.unimap` in comand line. Or just use attached HEX file.

Code: [Select]
#include "unimap_trans.h"
#include "action_layer.h"


#define AC_FN0 ACTION_LAYER_MOMENTARY(1)

#ifdef KEYMAP_SECTION_ENABLE
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
#else
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
#endif
    UNIMAP(
              F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,
    ESC,      F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PAUS,         VOLD,VOLU,MUTE,
    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, JYEN,BSPC,     INS, HOME,PGUP,    NLCK,PSLS,PAST,PMNS,
    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,     BSLS,     DEL, END, PGDN,    P7,  P8,  P9,  PPLS,
    CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     NUHS,ENT,                         P4,  P5,  P6,  PCMM,
    LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     RO,  RSFT,          UP,           P1,  P2,  P3,  PENT,
    LCTL,LGUI,LALT,MHEN,          SPC,           HENK,KANA,RALT,RGUI,FN0, RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PEQL
    ),
    UNIMAP(
              TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
    GRV,      TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,          TRNS,TRNS,TRNS,         TRNS,TRNS,TRNS,
    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, INS, DEL,      TRNS,TRNS,TRNS,    TRNS,TRNS,TRNS,TRNS,
    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP,  INS,      TRNS,     TRNS,TRNS,TRNS,    TRNS,TRNS,TRNS,TRNS,
    TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,TRNS,TRNS,HOME,PGUP,LEFT,RGHT,     TRNS,TRNS,                        TRNS,TRNS,TRNS,TRNS,
    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,END, PGDN,DOWN,     TRNS,TRNS,          PGUP,         TRNS,TRNS,TRNS,TRNS,
    TRNS,TRNS,TRNS,TRNS,          TRNS,          TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     HOME,PGDN,END,     TRNS,     TRNS,TRNS
    ),
};


bool hook_process_action(keyrecord_t *record) {
    static uint8_t f24_tracker;
    action_t action = layer_switch_get_action(record->event);

    switch (action.code) {
    case KC_A ... KC_F23: //notice how it skips over F24
    case KC_EXECUTE ... KC_EXSEL: //exsel is the last one before the modifier keys
        if (record->event.pressed) {
            register_code(KC_F24); //this means to send F24 down
            f24_tracker++;
            register_code(action.code);
        } else {
            unregister_code(action.code);
            f24_tracker--;
            if (!f24_tracker) {
                unregister_code(KC_F24); //this means to send F24 up
            }
            //real key is released HERE
        }
        return true;
        break;
    }
    return false;
}


Hi Hasu,

Did you have a chance to read my message? Would be nice if you could help out on this, now that I have the second controller I'm running into issues apparently...

Thanks man :)
Daniel

Offline hasu

  • Thread Starter
  • Posts: 3149
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #605 on: Sun, 22 November 2020, 06:46:07 »
Hi Daniel,

Quote
When browsing the internet for a fix to the replug issue, I found a fix that you presented in this forum. It works just fine with my keyboard, I just have one question.
What is your keyboard model with replug issue?
what is 'a fix' is actually, can you give its reference or URL? I can't remember it now :(

I like to fix the issue on default firmware if possible.


Quote
I would like to be able to change the keymap.c file but if I compile the keymap.c (see below) I always get issues with missing unimap.h or, if I copy those from other locations into my keyboard location, other errors with brackets and stuff.

I'm very new to this and basically have not much programming background. I want to understand it and I would be happy if you can point me to what is causing this issue, i.e. why is your compiled version running without any issues, and why can I not compile it myself?

Note that it is not keymap.c, you can copy the code into unimap.c and compile with 'make -f Makefile.unimap'.
Post error outputs if this doesn't work for you.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline daniel123

  • Posts: 3
Re: USB to USB keyboard converter
« Reply #606 on: Mon, 23 November 2020, 14:32:20 »
Hi Hasu,

Both keyboards work fine with your USB-to-USB converters (one keyboard is a Cherry KC 6000 slim and the other is an R-GO compact) and with the help of Zucca I was able to keep them both running :)

I will try your tip to compile and get back to you here, thanks for your support :)

Take care
Daniel


PS. In case anyone else who wants to use two keyboards at a time wonders why it doesn't work.... You have to use a DIFFERENT hex-files for each keyboard, e.g. the F24 hex file for the first keyboard and the F23 hex file for the second keyboard. Knowing this now makes me feeling silly to point that out, but some stupid people like me did not get that :D

Offline nevin

  • Posts: 977
  • Location: US
Re: USB to USB keyboard converter
« Reply #607 on: Mon, 23 November 2020, 14:38:26 »
don't feel bad. i've been playing with qmk & hasu's tmk for years. and it wasn't until recently, i started prepping a couple boards for VIA that i saw/realized the USB Device descriptor's in the firmware. (just a file you don't look into when you're just changing keymaps, or starting off.)
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline phedd

  • Posts: 16
Re: USB to USB keyboard converter
« Reply #608 on: Mon, 30 November 2020, 15:36:39 »
This just happened when disconnecting it from my computer. :(

Any way to fix? I can't solder or anything like that :(


Offline suicidal_orange

  • * Global Moderator
  • Posts: 3948
  • Location: England
Re: USB to USB keyboard converter
« Reply #609 on: Mon, 30 November 2020, 16:10:22 »
This just happened when disconnecting it from my computer. :(

Any way to fix? I can't solder or anything like that :(

That's impressive - how did you manage to rip off the casing without breaking the PCB :eek:

You need four pins for USB, one has disappeared so you'll need a new socket and if you can't solder it you'll have to find someone who can.  If you're in the UK I could do it?
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline nevin

  • Posts: 977
  • Location: US
Re: USB to USB keyboard converter
« Reply #610 on: Mon, 30 November 2020, 16:22:47 »
i'll offer the same if in the states.
ask around to friends, colleagues, etc... won't be a hard job and we can talk you through it.
looks like something like this for replacement. could probably find the same connector at mouser or digikey as well. (this was just one of the first couple results)
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline phedd

  • Posts: 16
Re: USB to USB keyboard converter
« Reply #611 on: Mon, 30 November 2020, 17:09:30 »
This just happened when disconnecting it from my computer. :(

Any way to fix? I can't solder or anything like that :(

That's impressive - how did you manage to rip off the casing without breaking the PCB :eek:

You need four pins for USB, one has disappeared so you'll need a new socket and if you can't solder it you'll have to find someone who can.  If you're in the UK I could do it?

I have no idea really. It felt a bit stuck so I had to use a little bit more force than usual (but not that much) and then it sounded like an instrument (the pins being freed) and the casing was stuck in my computer. The one pin fell off as I tried to push them back into the casing :(

Sweden unfortunately :( But thanks, I'll see if I can find someone. Or maybe I'll just learn to solder. But I'm so poor right now. Sucks being without tmk lol, feels so weird even typing this without all my usual mods and stuff.

i'll offer the same if in the states.
ask around to friends, colleagues, etc... won't be a hard job and we can talk you through it.
looks like something like this for replacement. could probably find the same connector at mouser or digikey as well. (this was just one of the first couple results)

Thanks alot! I'll try and ask some people

Offline hasu

  • Thread Starter
  • Posts: 3149
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #612 on: Mon, 30 November 2020, 19:02:21 »
phedd,
Can you remove the wrapping cover and take pics of both side of the pcb to check pads is still safe and fixable?
Also I like to have pic of the connector from the side to see how its chassis tabs broke off.

I can send you new USB plug or offer repair service if you can send it back to me.
Or you can get refund or replacement for your purchase if this is apparently fault of production.

Anyway, I'd like to see more photos of the details.


This is dimesions of the USB plug if you can fix it yourself.
https://akizukidenshi.com/download/ds/useconn/USB-4AM103.pdf
You can find some compatible components in the market. For example This is usable probably and is available from digikey.
https://www.digikey.com/en/products/detail/cui-devices/UP2-AH-4-TH/6188077

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline nevin

  • Posts: 977
  • Location: US
Re: USB to USB keyboard converter
« Reply #613 on: Mon, 30 November 2020, 19:22:59 »
Now that's customer service.
Thanks hasu.
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline phedd

  • Posts: 16
Re: USB to USB keyboard converter
« Reply #614 on: Mon, 30 November 2020, 20:59:20 »
phedd,
Can you remove the wrapping cover and take pics of both side of the pcb to check pads is still safe and fixable?
Also I like to have pic of the connector from the side to see how its chassis tabs broke off.

I can send you new USB plug or offer repair service if you can send it back to me.
Or you can get refund or replacement for your purchase if this is apparently fault of production.

Anyway, I'd like to see more photos of the details.


This is dimesions of the USB plug if you can fix it yourself.
https://akizukidenshi.com/download/ds/useconn/USB-4AM103.pdf
You can find some compatible components in the market. For example This is usable probably and is available from digikey.
https://www.digikey.com/en/products/detail/cui-devices/UP2-AH-4-TH/6188077

Absolutely, will dm you, thanks and very much appreciated

Offline haydoselefantes

  • Posts: 51
  • Location: Los Angeles
Re: USB to USB keyboard converter
« Reply #615 on: Tue, 01 December 2020, 17:34:13 »
OK, I figured this out.  I was doing something stupid.  ACTION_LAYER_TAP_KEY with caps lock om MacOS does work for me after hasu's change!

I was too lazy to set up my keymap again, so I was just using the keymap editor to load my existing firmware as the base and then changing the caps lock key and re-downloading it.  This apparently just changed the keymap on the previously compiled firmware, and didn't compile a new firmware with hasu's fix.

So this time, I went to the keymap editor, selected USB-USB converter as the base firmware, loaded that, and then just manually re-entered my keymap and downloaded it.  Works great! 

I'm a developer by trade and I would have been comfortable compiling the firmware from source, but my laziness bit me again here.  I couldn't figure out a way to convert my existing keymap to a unimap.c file.  But I'm realizing there's probably no shortcut for that, and I should just go ahead and manually type up my existing map.  All that laziness and I'm only using two layers and changing like a dozen keys from the base! :)

Thanks hasu!

I tried to use the new firmware a couple of times and don't see any change.  I may be doing something wrong.  I went to the keymap editor, loaded a file with my existing firmware, changed Caps Lock to be plain Caps Lock, then changed Caps Lock back to ACTION_LAYER_TAP_KEY, downloaded and flashed.

Can you please try it out also nevin?

Offline hasu

  • Thread Starter
  • Posts: 3149
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #616 on: Tue, 01 December 2020, 17:59:31 »
Hasu, In the TMK USB to USB converter config if I were to use something like a Unicomp PC122 which comes natively as USB the config is missing the left hand function keys as well as the key that would go below the down arrow. Also, if I wanted to split the numpad 0 into 2 seperate keys how could this be accomplished on the software end?

Interesting topic, It is worth to share this here.

If those keys have usual scan code the converter supports(not media/system codes), the converter can support them. I think USB 122-key layout has no standard scan code assignment, you will have to check the keyboard with keytester software or the converter.
Keymap Editor has 128 key and you can configure all keys theoretically. Default layout of Editor is different from the keyboard and not completely useful but can be still used if you know scan code of the keys.

Current firmware is not tested with keyboard like that yet and may need to be updated for the keys. I'll be happy to do that if you can help.


As for  "seperate keys" it is possible to remap the hidden key has scan code the converter supports again.

You will have to know scan code of the keys, first.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 3149
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #617 on: Tue, 01 December 2020, 18:41:43 »
OK, I figured this out.  I was doing something stupid.  ACTION_LAYER_TAP_KEY with caps lock om MacOS does work for me after hasu's change!

I was too lazy to set up my keymap again, so I was just using the keymap editor to load my existing firmware as the base and then changing the caps lock key and re-downloading it.  This apparently just changed the keymap on the previously compiled firmware, and didn't compile a new firmware with hasu's fix.

So this time, I went to the keymap editor, selected USB-USB converter as the base firmware, loaded that, and then just manually re-entered my keymap and downloaded it.  Works great! 

It is harsh and not user friendly interface unfortunately.
I like to update and improve Editor interface later if I have time but I'm not good at interface design and web programming :D

To update to the latest firmware with existent old firmware file these steps would have worked probably.
1. Chosse your old firmware HEX file in 'File Chooser'.
2. Click 'Load Keymap from firmware' button to load your keymap from old firmware.(This loads only keymap part on Keymap Editor.)
3. Edit keymap. This is optionaly.
4. Check 'Select' radio button to use the latest firmware when downloading from Editor.(The radio buttons state decides which firmware is used when downloading.)
5. Click 'Download' button.

Or you can bookmark 'Raw URL'(or 'URL shortener' may be useful) to backup your keymap instead of storing old firmware file somewhere.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 3149
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #618 on: Wed, 02 December 2020, 00:08:03 »
I found these doc on Unicomp site. Green marked keys are not fully remappable unfortunately.
https://support.pckeyboard.com/knowledgebase.php?article=52
https://support.pckeyboard.com/knowledgebase.php?article=58


Hasu, In the TMK USB to USB converter config if I were to use something like a Unicomp PC122 which comes natively as USB the config is missing the left hand function keys as well as the key that would go below the down arrow. Also, if I wanted to split the numpad 0 into 2 seperate keys how could this be accomplished on the software end?

Interesting topic, It is worth to share this here.

If those keys have usual scan code the converter supports(not media/system codes), the converter can support them. I think USB 122-key layout has no standard scan code assignment, you will have to check the keyboard with keytester software or the converter.
Keymap Editor has 128 key and you can configure all keys theoretically. Default layout of Editor is different from the keyboard and not completely useful but can be still used if you know scan code of the keys.

Current firmware is not tested with keyboard like that yet and may need to be updated for the keys. I'll be happy to do that if you can help.


As for  "seperate keys" it is possible to remap the hidden key has scan code the converter supports again.

You will have to know scan code of the keys, first.

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt