geekhack

geekhack Projects => Making Stuff Together! => Topic started by: hasu on Mon, 23 February 2015, 21:20:44

Title: USB to USB keyboard converter
Post by: hasu on Mon, 23 February 2015, 21:20:44
This is not an keyboard protocol converter in fact, but with this you can change keymap and use functions TMK firmware offers on your USB keyboard. https://github.com/tmk/tmk_keyboard#features (https://github.com/tmk/tmk_keyboard#features)

This depneds largely on Circuit@Home USB Host Shield 2.0 and its Arduino library.
https://github.com/felis/USB_Host_Shield_2.0 (https://github.com/felis/USB_Host_Shield_2.0)


How to ask help
You have trouble or question? OK. Ask in this thread.

You should provide informations like below as possible. Don't save your time to do this. The more useful clues you can give, the sooner you will get good answer.

- Try the latest firmware downloaded from Keymap Editor (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb) before reporting issue.
- Your keyboard model name. URL of the product page is also useful to check its specifications and manuals.
- Your OS. Windows/MacOS/Linux/...
- Your keymap if you are using your own keymap instead of default one. Post URL of Keymap Editor or keymap source code.
- Debug outputs from 'hid_listen' command. https://github.com/tmk/tmk_keyboard/wiki#debug-console (https://github.com/tmk/tmk_keyboard/wiki#debug-console)


Hardware
You need USB host controller chip MAX3421e and AVR chip ATMega32U4.

The easiest way is buying my TMK USB to USB converter (https://geekhack.org/index.php?topic=72052.0) :D



1. TMK USB to USB converter
This small board includes all functions of Host Shield and Leonardo. No soldering job is needed.

You can buy an assmebled converter here to support my project.
https://geekhack.org/index.php?topic=72052.0 (https://geekhack.org/index.php?topic=72052.0)

(http://i.imgur.com/9CyfrY3.jpg)
More
(http://i.imgur.com/2y06AIal.jpg) (http://i.imgur.com/jIb3Ingl.jpg)

PCB design files are available.
https://github.com/tmk/USB2USB_Converter (https://github.com/tmk/USB2USB_Converter)

Case design file is available here. Thank you, Gouty@github! 2018-10/27 New!
https://github.com/tmk/USB2USB_Converter/tree/master/3D%20Printed%20Case (https://github.com/tmk/USB2USB_Converter/tree/master/3D%20Printed%20Case)



2. USB Host Shield 2.0 + Arduino Leonardo
This firmware work with Circuit@Home USB Host Shield + Arduino Leonardo as well, they are not small for keyboard converter but work well.

a. USB Host Shield:
Get official one to support USB Host Shield project! From these links you can get genuine shield.
https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-2-0-for-arduino-assembled/ (https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-2-0-for-arduino-assembled/)
http://shop.tkjelectronics.dk/product_info.php?products_id=43 (http://shop.tkjelectronics.dk/product_info.php?products_id=43)

Clones may have compatiblity issues with the library and TMK. Not recommended.
https://github.com/felis/USB_Host_Shield_2.0/issues/76#issuecomment-159269359 (https://github.com/felis/USB_Host_Shield_2.0/issues/76#issuecomment-159269359)
And you cannot use SparkFun USB Host Shield which is not compatible to Leonardo.

b. Arduino Leonardo:
http://arduino.cc/en/Main/arduinoBoardLeonardo (http://arduino.cc/en/Main/arduinoBoardLeonardo)



3. Mini USB Host Shield 2.0 + Pro Micro
Also Pro Micro 3.3V or Teensy with mini host shield will work with some fixes on signal/power routing.

https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-for-arduino-pro-mini (https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-for-arduino-pro-mini)
http://shop.tkjelectronics.dk/product_info.php?products_id=45 (http://shop.tkjelectronics.dk/product_info.php?products_id=45)
https://www.sparkfun.com/products/12587 (https://www.sparkfun.com/products/12587)
https://www.pjrc.com/teensy/td_libs_USBHostShield.html (https://www.pjrc.com/teensy/td_libs_USBHostShield.html)

TBD



Firmware
This converter is part of TMK keyboard firmware project. Source code for the converter firmware is available here.

https://github.com/tmk/tmk_keyboard/tree/master/converter/usb_usb (https://github.com/tmk/tmk_keyboard/tree/master/converter/usb_usb)

Build
You can compile firmware from source code. See TMK documentation for the detail.
More
Code: [Select]
$ git clone git://github.com/tmk/tmk_keyboard.git
$ cd tmk_keyboard
$ git submodule init
$ git submodule update
$ cd converter/usb_usb
$ make clean
$ make

To reduce firmware size you can disable functions you don't use by commenting out following lines. Note that 'make clean' is needed after Makefile is editted.

NKRO is meaningless practically on this converter and it should be disabled always.
Code: [Select]
# Build Options
#   comment out to disable the options.
#
MOUSEKEY_ENABLE ?= yes   # Mouse keys
EXTRAKEY_ENABLE ?= yes   # Media control and System control
CONSOLE_ENABLE ?= yes   # Console for debug
#COMMAND_ENABLE ?= yes    # Commands for debug and configuration
#NKRO_ENABLE ?= yes   # USB Nkey Rollover
https://github.com/tmk/tmk_keyboard/blob/master/converter/usb_usb/Makefile#L93-L97 (https://github.com/tmk/tmk_keyboard/blob/master/converter/usb_usb/Makefile#L93-L97)

No idea? No problem, you can use easy TMK keymap editor instead, see below.


Program
For TMK converter
First, press tiny button on TMK converter to turn it into program mode.
To program converter with your own firmware you can use 'dfu-programmer' tool.
More
Code: [Select]
dfu-programmer atmega32u4 erase --force
dfu-programmer atmega32u4 flash <your_firmware.hex>
dfu-programmer atmega32u4 reset

If you have installed build tools you can just 'make' like this.
Code: [Select]
make dfu

Or you can use 'Atmel FLIP' as well. Refer to this wiki page for other program tools.
https://github.com/tmk/tmk_keyboard/wiki#flash-firmware (https://github.com/tmk/tmk_keyboard/wiki#flash-firmware)


For USB Host Shield 2.0 + Arduino Leonardo
More
Push reset button on Leonardo before run this command. Serial port name(COM17) depends your system. On Linux I got /dev/ttyACM0.
Code: [Select]
$ DEV=COM17 make program
or
$ avrdude -patmega32u4 -cavr109 -b57600 -Uflash:w:usb_usb.hex -PCOM17



TMK Keymap Editor
USB to USB converter supports TMK keymap editor now!

You can edit keymapping and get your custom firmware easily with this.

(http://i.imgur.com/hqcN3v8h.png)

Try it here.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb)
SpaceFn on editor: http://goo.gl/5kvPrl (http://goo.gl/5kvPrl)


(Old editor: http://www.tmk-kbd.com/tmk_keyboard/editor/usb_usb/ (http://www.tmk-kbd.com/tmk_keyboard/editor/usb_usb/)   SpaceFn: http://bit.ly/1OqgvMn (http://bit.ly/1OqgvMn) )





Limitation


Incompatible Keyboards
The converter doesn't work with:
Converter firmware has been fixed and evolved gradually these years, some of them may work with the latest firmware. Please try and report whether keyboard work with the latest firmware or not if you have it. It would be helpful for firmware development. Thanks.


Compatible Keyboards
If your keyobard works well with BIOS/EFI you can expect the converter handle it reasonably. But it is still not 100% assured, the covnerter can fail to handle the keyobard with some reasons unfortunately while the converter firmiware has been gradually updated to improve compatiblility.


Report from users is really important to improve this converter. Please post your result in this thread.
'USB descriptor' would be helpful for debug if your keyboard doesn't work.
Refer this for how to get 'USB descriptor'. https://github.com/tmk/tmk_keyboard/wiki/USB-Descriptor (https://github.com/tmk/tmk_keyboard/wiki/USB-Descriptor)



TODO

DONE:


Update
2019/05  Fix startup stuck problem (https://geekhack.org/index.php?topic=69169.msg2760790#msg2760790)
2019/05  Fix Rollover error handling (https://geekhack.org/index.php?topic=69169.msg2764186#msg2764186)
2018/11  Update firmware(Use fixed LUFA stack and update USB_Host_Shield_2.0)
2018/11  Add Filco Majestouch2 87 and ikbc KD87 to compatility list
2018/07  Update  firmware to fix startup issue (https://geekhack.org/index.php?topic=69169.msg2634041#msg2634041). see this commit (https://github.com/tmk/tmk_keyboard/commit/c2ce617a363f3b9d43aa81f98e70d58f928931f4).
2018/10  Add design file for enclosure
2018/02  Update "Reported keyboards" section
2017/05  Fix startup code for FC660C
2016/09  New keymap editor(unimap) is available
2016/01  Add Keymap editor
2015/12  Add Firmware size to limitations, and recommendation for genuine host shield
2015/11  Add keymap for JIS and ISO
2015/07  Bug fix for keyboard sending ErrorRollOver report
2015/07  Add Locking key indicator support
2015/06  Updated Limitation and TODO
2015/02  TMK USB to USB converter Rev.A
2014/12  Added Hub support(confirmed with HHKB pro2)
Title: Re: USB to USB keyboard converter
Post by: TheSoulhunter on Wed, 25 February 2015, 07:55:17
Nice! Interested in getting one...
Title: Re: USB to USB keyboard converter
Post by: SpAmRaY on Wed, 25 February 2015, 08:20:07
Hasu, any chance you would build some of these to sell?
Title: Re: USB to USB keyboard converter
Post by: metalliqaz on Wed, 25 February 2015, 08:22:29
This is really great. I wanted to build one of these a while ago but I just couldn't find the time to follow through.  Looks fantastic!
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 26 February 2015, 21:25:10
I have spare PCBs and have a plan to get some of them assembled once I confirm it works well in the field after some daily usage.

Today, I found a bug :D
Title: Re: USB to USB keyboard converter
Post by: nubbinator on Thu, 26 February 2015, 21:28:04
That's really cool.  How do you change the keymapping with it?
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 26 February 2015, 22:06:14
I can't live without mousekey and layer switching with space bar :D

https://github.com/tmk/tmk_keyboard/blob/master/converter/usb_usb/keymap_hasu.c
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 10 March 2015, 20:32:16
I'm having power or/and initializing related problem during plugin and bootup time :(
This problem occurs on both my converter and leonardo and Host shield(old Sparnkfun one),  at this point not sure it is firmware problem or hardware one.

Once the problem is sorted out I'd run small distribution(GB) from my spare PCBs.
Title: Re: USB to USB keyboard converter
Post by: spiceBar on Tue, 14 April 2015, 23:26:17
I'm having power or/and initializing related problem during plugin and bootup time :(
This problem occurs on both my converter and leonardo and Host shield(old Sparnkfun one),  at this point not sure it is firmware problem or hardware one.

Once the problem is sorted out I'd run small distribution(GB) from my spare PCBs.

Wow! I had missed this thread!

I have purchased the Arduino and USB Host shield some time ago, compiled and uploaded TMK, and it worked. Then the plan was to implement SpaceFN and GuiFN on it, but I have not done it yet due to lack of time.

How is this project going?

I'm very interested in purchasing a few assembled controllers from you, if you have enough of them available.
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 15 April 2015, 02:37:58
Not sort the problem yet :) I've worked on other projects like alps64 and HHKB Alt Controller.

Probably it is not hardware but initialization in firmware problem. I'll look into soon.

Unfortunately this converter requires two chips and it costs much and assembly process takes long. But it works it is important!

Kudus to Circuit@Home!
Title: Re: USB to USB keyboard converter
Post by: njbair on Wed, 15 April 2015, 02:53:01
This is really cool. Would this pass enough current to power a model m or similar along with a PS/2 adapter? I would love TMK features in a model m.
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 15 April 2015, 03:54:22
Unicomp USB keyboard?
How you can draw current is depends on your USB host capability. I think you can use Unicomp USB Model M as far as your PC or Hub can supply power enough.

BTW, What do you need TMK features actually?
Title: Re: USB to USB keyboard converter
Post by: spiceBar on Wed, 15 April 2015, 08:37:20
Not sort the problem yet :) I've worked on other projects like alps64 and HHKB Alt Controller.

Probably it is not hardware but initialization in firmware problem. I'll look into soon.

Unfortunately this converter requires two chips and it costs much and assembly process takes long. But it works it is important!

Kudus to Circuit@Home!

I'm not sure how much it costs, but for me price is not an issue. After spending so much on mechanical keyboards, fine-tuning them thanks to your wonderful adapters is a really great addition.

Will we be able to purchase completely assembled converters from you?

I think it would be interesting to be able to purchase some without the USB plugs. I think the converters are thin enough to install them inside most keyboards, provided we solder the "in" and "out" wires directly to the small PCB. If it's not possible, I hope it's not too difficult to desolder the USB plugs.
Title: Re: USB to USB keyboard converter
Post by: njbair on Wed, 15 April 2015, 20:31:18
Unicomp USB keyboard?
How you can draw current is depends on your USB host capability. I think you can use Unicomp USB Model M as far as your PC or Hub can supply power enough.

BTW, What do you need TMK features actually?
I've got a PS/2 Model M and I use an adapter like this. But I think PS/2 boards draw a lot of current. Just wondering if your device would supply enough current for PS/2.
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 13 May 2015, 20:26:49
Finally sorted out the bootup problem, yay!
It was a intilization problem of firmware, not hardware. It is lucky that I can still use existent PCB and components.

I'll start making a few boards soon and create GB or artisan service thread for this converter.



I'm having power or/and initializing related problem during plugin and bootup time :(
This problem occurs on both my converter and leonardo and Host shield(old Sparnkfun one),  at this point not sure it is firmware problem or hardware one.

Once the problem is sorted out I'd run small distribution(GB) from my spare PCBs.

Title: Re: USB to USB keyboard converter
Post by: gosinger on Thu, 14 May 2015, 13:24:28
Wow...great project, this thread made me register here...

looking forward to future development, keep up the great work! I'll get myself an Leonardo and will give this a go :)
Title: Re: USB to USB keyboard converter
Post by: Leimi on Mon, 18 May 2015, 19:08:59
Finally sorted out the bootup problem, yay!
It was a intilization problem of firmware, not hardware. It is lucky that I can still use existent PCB and components.

I'll start making a few boards soon and create GB or artisan service thread for this converter.



I'm having power or/and initializing related problem during plugin and bootup time :(
This problem occurs on both my converter and leonardo and Host shield(old Sparnkfun one),  at this point not sure it is firmware problem or hardware one.

Once the problem is sorted out I'd run small distribution(GB) from my spare PCBs.
Great job, looking forward to it :)
Title: Re: USB to USB keyboard converter
Post by: Thumper_ on Sat, 23 May 2015, 08:21:47
Will you be able to change the keypad so it transmit properly keypad numcodes?
Title: Re: USB to USB keyboard converter
Post by: njbair on Sat, 23 May 2015, 08:37:27
Will you be able to change the keypad so it transmit properly keypad numcodes?
If the keypad is currently sending out exactly the same scancodes as the number row, this adapter will have no way to tell them apart.
Title: Re: USB to USB keyboard converter
Post by: Thumper_ on Sat, 23 May 2015, 08:38:15

Will you be able to change the keypad so it transmit properly keypad numcodes?
If the keypad is currently sending out exactly the same scancodes as the number row, this adapter will have no way to tell them apart.
And on a standalone keypad?
Title: Re: USB to USB keyboard converter
Post by: njbair on Sat, 23 May 2015, 14:38:17

Will you be able to change the keypad so it transmit properly keypad numcodes?
If the keypad is currently sending out exactly the same scancodes as the number row, this adapter will have no way to tell them apart.
And on a standalone keypad?
I have not used this but I believe in that case it would work.
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 27 May 2015, 04:14:57
I started an artisan service thread for my TMK keyboard converters. And I'll assmeble some USB to USB converters soon and taking order tentatively now, check this post if someone is interested in taking my converter.
https://geekhack.org/index.php?topic=72052.msg1759680#msg1759680

Quote
I have to decide the price later due to final cost calc, but you can cancel it if you don't like the final price.
The price will be around 40-50USD, probably.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 20 June 2015, 19:54:16
Updated Limitation and TODO in first post.

In short:
NKRO keyboards doesn't work with the converter at this time but they will be supported in 6KRO mode with future update. Also Lock indicators support will be added by firmware upgrade.

NKRO mode and System and Media Control keys are not supported. And 'Fn' or 'Pn' key on keyboard like Poker cannot be handled by the converter.



BTW, some assembled TMK USB to USB converters are available now here.
https://geekhack.org/index.php?topic=72052.0
Title: Re: USB to USB keyboard converter
Post by: berserkfan on Sat, 20 June 2015, 22:04:00
Updated Limitation and TODO in first post.

In short:
NKRO keyboards doesn't work with the converter at this time but they will be supported in 6KRO mode with future update. Also Lock indicators support will be added by firmware upgrade.

NKRO mode and System and Media Control keys are not supported. And 'Fn' or 'Pn' key on keyboard like Poker cannot be handled by the converter.



BTW, some assembled TMK USB to USB converters are available now here.
https://geekhack.org/index.php?topic=72052.0

As a custom layouts guy I am eagerly watching and waiting for the day when your USB to USB converter will have LED support.
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 15 July 2015, 02:15:45
Small update: Added locking key indicator(LED) support and fixed for Rollover error of 2KRO keyboard.

Quote
2015/07  Bug fix for keyboard sending ErrorRollOver report
2015/07  Add Locking key indicator support

https://github.com/tmk/tmk_keyboard/commit/6f5e8ce17e89005130cd0f9ecc6e346a77bb624b
https://github.com/tmk/tmk_keyboard/commit/1efdd867c8f88ad779ad82e1b22df62bf6be8fe9
Title: Re: USB to USB keyboard converter
Post by: argcargv on Fri, 24 July 2015, 12:22:15
Testing with Kinesis Advantage, spacefn is working!!!
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 24 July 2015, 16:26:58
Great!

BTW, I did this just for fun and it worked with daisy chain of two, at least :D
(http://i.imgur.com/zZPX4Zch.jpg)
Title: Re: USB to USB keyboard converter
Post by: njbair on Fri, 24 July 2015, 20:45:16
Great!

BTW, I did this just for fun and it worked with daisy chain of two, at least :D
Show Image
(http://i.imgur.com/zZPX4Zch.jpg)


Seeing this pic just made me realize how awesome this project is. Imagine being able to throw this thing into your backpack, and everywhere you go you've got your preferred keyboard layout and function layers, no matter what keyboard you're forced to use. Amazing.
Title: Re: USB to USB keyboard converter
Post by: ctm on Fri, 07 August 2015, 15:14:01
Wow! This is so amazing! So is this like a keycode translator? Does it also work on keys than don't send keycode (like fn)?
Title: Re: USB to USB keyboard converter
Post by: njbair on Fri, 07 August 2015, 15:25:27
Wow! This is so amazing! So is this like a keycode translator? Does it also work on keys than don't send keycode (like fn)?

From the OP:

Quote
'Fn' key on keyboard is not recognized also. In most case keyboards don't spit out keycode for the key. Note that you can still define 'Fn' key with TMK firmware.

So unfortunately no. But if your board can be programmed so that the Fn key sends a keycode, just do that.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 08 August 2015, 02:16:38
Wow! This is so amazing! So is this like a keycode translator? Does it also work on keys than don't send keycode (like fn)?

From the OP:

Quote
'Fn' key on keyboard is not recognized also. In most case keyboards don't spit out keycode for the key. Note that you can still define 'Fn' key with TMK firmware.

So unfortunately no. But if your board can be programmed so that the Fn key sends a keycode, just do that.

Right. 'Fn' key itself cannot be remmaped while combination of 'Fn' and some keys(for example, Fn+x, Fn+w,...) are probably remappable.
Title: Re: USB to USB keyboard converter
Post by: kirkvomit on Sun, 09 August 2015, 05:41:43
Hi, does anyone has tested usb to usb converter for a long time?
Mine is made from Leonardo board.
And I have a problem that converter stops registering any inputs after few days.
Restart of the board doesn't help. Plug unplug some times helps for a 5 minutes and then controller stops registering inputs again.
Tried on different PCs, result is the same, it works flawlesly for few days and then starts glitching.

Have somebody faced this problem too?
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 09 August 2015, 23:02:58
And I have a problem that converter stops registering any inputs after few days.
Restart of the board doesn't help. Plug unplug some times helps for a 5 minutes and then controller stops registering inputs again.

Interesting.
I've not experienced that situation so far, but I pluged converter a day at most. hmm, I can't come up any clue from that description. More informations would be useful to speculate the problem.

What is your converter hardware actually? Circuit@Home shield or other? Leonardo is genuine one or clone?

What is your host? Desktop, notebook? OS?

what is your keyboards?

Can you post logs when it happened?

Your firmware is the latest? And post files if you changed something.

And you can use hid_listen to see how converter stops.
Title: Re: USB to USB keyboard converter
Post by: kirkvomit on Mon, 10 August 2015, 14:29:01
Leonardo is clone from ebay.
Shield is like this one http://www.ebay.com/itm/USB-Host-Shield-Support-Android-ADK-UNO-MEGA-Duemilanove-2560-For-Arduino-/201354197970?hash=item2ee1a53bd2 (http://www.ebay.com/itm/USB-Host-Shield-Support-Android-ADK-UNO-MEGA-Duemilanove-2560-For-Arduino-/201354197970?hash=item2ee1a53bd2)

Tried on 2 PCs and one notebook, all have Ubuntu 14.04 installed.
Keyboards are poker 2 and razer blackwidow tournament.

What logs did you mean?
Firmware is not latest, I flashed it may be in aprill 2015.
Can you explain about hid_listen?

I will try to flash it with latest firmware without any changes and will let you know if it fixed the problem or not.
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 10 August 2015, 19:19:30
Logs are located under /var/log/, you can find something related to USB in kern.log, IIRC.

As for hid_listen, see these. And google with word 'hid_listen' to find download link.
https://github.com/tmk/tmk_keyboard#debugging
https://github.com/tmk/tmk_keyboard/wiki/FAQ#debug-console

Yeah, try the latest firmware and report back.
Title: Re: USB to USB keyboard converter
Post by: njbair on Fri, 21 August 2015, 08:48:32
Do magic and bootmagic work with this converter?
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 21 August 2015, 10:58:47
No. This and other TMK converters probably can't check key state while their startup time.

Bootmagic is supported only with TMK keyboard controllers while Magic command works on both converters and keyboard controllers.


https://github.com/tmk/tmk_keyboard/issues/175
Title: Re: USB to USB keyboard converter
Post by: njbair on Fri, 21 August 2015, 13:16:32
No. This and other TMK converters probably can't check key state while their startup time.

Bootmagic is supported only with TMK keyboard controllers while Magic command works on both converters and keyboard controllers.


https://github.com/tmk/tmk_keyboard/issues/175

I can't seem to get Magic to work. Do I need to enable it at compile time first? I couldn't find any make flags for that.

For bootmagic, your issue suggests a startup delay as a workaround. If this were a configurable option, like a make flag, that would be a really good solution because only those who explicitly enable the delay will have to wait for it.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 23 August 2015, 03:25:32
No. This and other TMK converters probably can't check key state while their startup time.

Bootmagic is supported only with TMK keyboard controllers while Magic command works on both converters and keyboard controllers.


https://github.com/tmk/tmk_keyboard/issues/175

I can't seem to get Magic to work. Do I need to enable it at compile time first? I couldn't find any make flags for that.

For bootmagic, your issue suggests a startup delay as a workaround. If this were a configurable option, like a make flag, that would be a really good solution because only those who explicitly enable the delay will have to wait for it.

To enable Magic commands this line is required in Makefile.
Code: [Select]
COMMAND_ENABLE = yes    # Commands for debug and configuration
Title: Re: USB to USB keyboard converter
Post by: sandric on Sun, 23 August 2015, 11:56:57
How do you program this converter? I mean if you want to remap some key you unplug keyboard from female usb port and plug it strickly to usb port of computer, or it is doable with keyboard connected to it? And what is language you program - arduino C? Uploading with arduino ide? Isn't library Arduino USB Host?
Title: Re: USB to USB keyboard converter
Post by: njbair on Sun, 23 August 2015, 18:09:52
I wrote a nice long review of this converter (https://geekhack.org/index.php?topic=74708.msg1843136#msg1843136) because I'm so in love with it right now.

Thanks for your work, hasu!
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 23 August 2015, 18:56:06
Nice writeup! Thanks.
I subscribed the thread.
Title: Re: USB to USB keyboard converter
Post by: njbair on Wed, 26 August 2015, 15:44:18
I bought an off-brand Leonardo & shield (both made by SainSmart). I was able to flash the .hex file with avrdude without any errors, but it's not working as a converter at all.

What steps can I take to debug this thing?
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 26 August 2015, 18:41:44
They seem to be compatible to original boards but the shop doesn't offer technical details like schematic enough to make certain of. Let's say they are compatible.

http://www.sainsmart.com/sainsmart-usb-host-android-adk-shield-2-0-for-arduino-uno-mega-r3-mega2560-duemilanove-nano-robot.html
http://www.sainsmart.com/sainsmart-leonardo-r3-atmega32u4-development-board-for-arduino.html#customer-reviews

Can you see debug message with hid_listen?
Keyboard is given enough voltage?


BTW, I haven't confirm my firmware with original Circuit@Home board. I'm using Sparkfun shield(with modification) and genuine Leonardo besides my own TMK converter.
https://www.sparkfun.com/products/9947
Title: Re: USB to USB keyboard converter
Post by: njbair on Thu, 27 August 2015, 08:33:06
They seem to be compatible to original boards but the shop doesn't offer technical details like schematic enough to make certain of. Let's say they are compatible.

http://www.sainsmart.com/sainsmart-usb-host-android-adk-shield-2-0-for-arduino-uno-mega-r3-mega2560-duemilanove-nano-robot.html
http://www.sainsmart.com/sainsmart-leonardo-r3-atmega32u4-development-board-for-arduino.html#customer-reviews

Can you see debug message with hid_listen?
Keyboard is given enough voltage?


BTW, I haven't confirm my firmware with original Circuit@Home board. I'm using Sparkfun shield(with modification) and genuine Leonardo besides my own TMK converter.
https://www.sparkfun.com/products/9947

hid_listen recognizes the SainSmart Leonardo. When I plug it in, it says

Code: [Select]
Listening:
init: done
keyboard_set_led: 05

That last line is accompanied by all three lock LEDs on my keyboard quickly flashing. After this, nothing happens. Typing on the keyboard does nothing. If I unplug the keyboard from the USB host shield and plug it back in, the lock LEDs flash again. But no message about LEDs this time in hid_listen.

hid_listen always stays connected to the first device it finds until it's unplugged or deactivated, even when you plug another device in. I have a working hasu converter as well. I wanted to test whether the Leonardo was crashing or freezing:

run hid_listen
plug in Leonardo: hid_listen initializes the Leonardo properly
plug in hasu's converter: nothing changes
leave hasu's converter plugged in and unplug Leonardo: hid_listen initializes hasu's converter properly
plug in Leonardo: nothing changes
unplug hasu's converter: hid_listen initializes Leonardo properly

This tells me the Leonardo stays connected as HID, so it's not freezing or crashing.

This must be an issue with the USB host shield. It may be a pin incompatibility with the original, or it may be that the shield itself is DOA.

Maybe I can upload a simple Arduino sketch to test that the USB host shield is working. If so, it may be that the shield is not compatible with the Sparkfun shield you used for testing, hasu.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 29 August 2015, 05:35:10
It seems like communication between Leonardo and PC works well.

Does the keyboard work with TMK converter?
And did you check voltage USB host shield supplies?


Yes, 'hid_listen' is connected just to first device found. To connect it to another device you need to disconnect the first device. This is cofusing a bit when you are using some devices with custome firmware like TMK and Soarere's.

Title: Re: USB to USB keyboard converter
Post by: njbair on Sat, 29 August 2015, 08:56:07
It seems like communication between Leonardo and PC works well.

Does the keyboard work with TMK converter?
And did you check voltage USB host shield supplies?


Yes, 'hid_listen' is connected just to first device found. To connect it to another device you need to disconnect the first device. This is cofusing a bit when you are using some devices with custome firmware like TMK and Soarere's.

I have not checked the host shield voltage yet. I'll have to wait until next week to try that though, as the converter is at the office.
Title: Re: USB to USB keyboard converter
Post by: njbair on Tue, 01 September 2015, 16:52:37
Well, I checked the host shield voltage yesterday, only to determine after spinning my wheels for about an hour, that my multimeter is in terrible need of recalibration.

Fortunately, I was eventually able to solve the problem with the Leonardo & USB host shield. The host shield uses a few pins on the ICSP header, but my USB host shield did not include female headers on those pins (even though the product image shows it with headers). I had some spares lying around so I was able to solder on my own headers and now it works like a charm. Now I just need a nice enclosure and some time to play around with LEDs.

So I can confirm, that if you can afford the time to solder and have some spare headers, this is a slightly cheaper way to build your own converter. Just know that hasu's pre-made converter is much smaller and you're supporting his wonderful work!

SainSmart Arduino Leonardo clone: http://smile.amazon.com/dp/B00CO07PNY
SainSmart USB Host Shield: http://smile.amazon.com/dp/B006J4G000
Female 0.1" headers (if you need them): http://smile.amazon.com/dp/B007Q84C4O
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 01 September 2015, 18:55:51
Great.

But really terrible story with SainSmart, and you are not alone :(
http://www.amazon.com/gp/customer-reviews/R13EEDLP8OWUA4/ref=cm_cr_pr_viewpnt?ie=UTF8&ASIN=B006J4G000#R13EEDLP8OWUA4

Quote
The host shield uses a few pins on the ICSP header, but my USB host shield did not include female headers on those pins (even though the product image shows it with headers).  I had some spares lying around so I was able to solder on my own headers and now it works like a charm.
Title: Re: USB to USB keyboard converter
Post by: njbair on Tue, 01 September 2015, 20:25:50
Great.

But really terrible story with SainSmart, and you are not alone :(
http://www.amazon.com/gp/customer-reviews/R13EEDLP8OWUA4/ref=cm_cr_pr_viewpnt?ie=UTF8&ASIN=B006J4G000#R13EEDLP8OWUA4

Quote
The host shield uses a few pins on the ICSP header, but my USB host shield did not include female headers on those pins (even though the product image shows it with headers).  I had some spares lying around so I was able to solder on my own headers and now it works like a charm.

I saw that. That review, along with a forum post on the Arduino website, led me to discover the problem.

The worst part is, once I knew the problem I tried searching really hard to find any kind of documentation from SainSmart that I might have missed, but there's nothing. It seems like their only documentation is the product descriptions on their store and Amazon.com. What a pity.

See, kids, this is why you should buy your converters direct from hasu!
Title: Re: USB to USB keyboard converter
Post by: jcoffin1981 on Thu, 10 September 2015, 19:39:09
Great!

BTW, I did this just for fun and it worked with daisy chain of two, at least :D
Show Image
(http://i.imgur.com/zZPX4Zch.jpg)


OMG!  These are the exact keycaps I want.  I've never seen them but I knew in my mind what I was looking for.  What the heck are they and where are they from?  I like the symbols that are barely discernible from the keycap color.
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 10 September 2015, 19:47:15
It is just a PFU HHKB with black keycaps. Not Cherry.
Title: Re: USB to USB keyboard converter
Post by: njbair on Thu, 17 September 2015, 15:12:25
I've got a new board that doesn't seem to work with the converter. It's a Varmilo VA87MR from Massdrop. It's backlit, so I'm wondering if it's a current draw issue. I also tried it on my Leonardo-based converter with an AC adapter as a power source, same issue. Here's the output from hid_listen, with bracketed comments for the timing of each event:

Waiting for device:.........
[attach converter]
Listening:
init: done
[backlights turn on to my saved setting (dim)]
[brief pause, then lock indicator lights quickly flash once]
host.Task: 0A34

[I press any key on the keyboard except Fn]
Device disconnected.
Waiting for new device:.
Listening:
init: done
host.Task: 0A34

Device disconnected.
Waiting for new device:..............

Any ideas where to start looking for an issue?
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 17 September 2015, 16:10:43
Does the keyboard use NKRO mode? The converter sends a command to render the keyboard in 6KRO mode but I didn't confirm this works. I guess this is your problem.

But the disocnnecting by pressing a key is unexpected to me. I can't know what happens, perhaps it goes mad by receiving unexpected report.

Plug keyboard to converter first then plugin the converter into USB port, doesn't it help?
Title: Re: USB to USB keyboard converter
Post by: njbair on Thu, 17 September 2015, 16:13:41
Does the keyboard use NKRO mode? The converter sends a command to render the keyboard in 6KRO mode but I didn't confirm this works. I guess this is your problem.

But the disocnnecting by pressing a key is unexpected to me. I can't know what happens, perhaps it goes mad by receiving unexpected report.

Plug keyboard to converter first then plugin the converter into USB port, doesn't it help?

The board does do NKRO mode. I'm looking to see if there's a way to change that, but I can't find any instructions for the Fn commands on this thing (you'd think it would have come with a manual or at least a quick reference guide!).

I'll keep digging and see if I can find a way to switch it to 6KRO mode.
Title: Re: USB to USB keyboard converter
Post by: njbair on Thu, 17 September 2015, 16:20:31
Actually, is there anything I can do to test/debug the "force 6KRO" command?
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 17 September 2015, 18:09:29
HID SET_PROTOCOL request should switch keyboard to boot protocol(6KRO).
This line sends the command. I think it doesn't work for some reason.

https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/hidboot.h#L456
Title: Re: USB to USB keyboard converter
Post by: njbair on Fri, 18 September 2015, 08:07:27
So this is interesting...

When I open Device Manager > Human Interface Devices, I see two items: my mouse and a bluetooth HID device. But then I plug in the Varmilo and all of these show up:

HID-compliant consumer control device
HID-compliant system controller
HID-compliant vendor-defined device
HID-compliant vendor-defined device
USB Input Device
USB Input Device
USB Input Device

Seems like a lot of stuff for one keyboard...I have heard about keyboards that "fake" USB NKRO by emulating multiple keyboards. Is that what's happening here? If so that would explain why the USB host shield doesn't work with it.
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Fri, 18 September 2015, 10:46:10
I didn't dig into the issue, yet the usb-to-usb converter didn't work for me out of the box either

Since the infinity firmware is NKRO, I guess it might also be the reason in my case too
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 18 September 2015, 11:58:11
I'll have to look into set protocol request deeply to support those keyboard.

I'm curious whether those keyboards work well with BIOS, if so they can be used with the converter hopefully.
Title: Re: USB to USB keyboard converter
Post by: njbair on Fri, 18 September 2015, 14:29:24
I'll have to look into set protocol request deeply to support those keyboard.

I'm curious whether those keyboards work well with BIOS, if so they can be used with the converter hopefully.

Everything I've read indicates that this keyboard doesn't work at all on Mac (or rather, only some of the keys work). Some of the USB NKRO boards default to 6KRO and you have to enable NKRO via DIP switch or key combination. But it seems like the Varmilo doesn't support 6KRO at all.

I am curious to see what hardware it uses. Maybe I can rewire it to a Teensy or something.
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Fri, 18 September 2015, 15:05:45
I'll have to look into set protocol request deeply to support those keyboard.

I'm curious whether those keyboards work well with BIOS, if so they can be used with the converter hopefully.

Everything I've read indicates that this keyboard doesn't work at all on Mac (or rather, only some of the keys work). Some of the USB NKRO boards default to 6KRO and you have to enable NKRO via DIP switch or key combination. But it seems like the Varmilo doesn't support 6KRO at all.

I am curious to see what hardware it uses. Maybe I can rewire it to a Teensy or something.

I researched this for you: https://www.reddit.com/r/MechanicalKeyboards/comments/36ejhp/varmilo_va87m_info_please/ but it probably doesn't support ps2 either

I'm currently aiming for keyboards with PS/2 support so it will be more practical to use them with tmk ps2_to_usb adapter, but I haven't got a chance to verify my theory in real life

If only they started deploying every keyboard with tmk pre-installed, that would be great
Title: Re: USB to USB keyboard converter
Post by: njbair on Fri, 18 September 2015, 15:12:08
I'll have to look into set protocol request deeply to support those keyboard.

I'm curious whether those keyboards work well with BIOS, if so they can be used with the converter hopefully.

Everything I've read indicates that this keyboard doesn't work at all on Mac (or rather, only some of the keys work). Some of the USB NKRO boards default to 6KRO and you have to enable NKRO via DIP switch or key combination. But it seems like the Varmilo doesn't support 6KRO at all.

I am curious to see what hardware it uses. Maybe I can rewire it to a Teensy or something.

I researched this for you: https://www.reddit.com/r/MechanicalKeyboards/comments/36ejhp/varmilo_va87m_info_please/ but it probably doesn't support ps2 either

I'm currently aiming for keyboards with PS/2 support so it will be more practical to use them with tmk ps2_to_usb adapter, but I haven't got a chance to verify my theory in real life

If only they started deploying every keyboard with tmk pre-installed, that would be great
Thanks for the link, I think I came across that or a similar post in my search for some documentation for this keyboard, which I never found.

Anyway, after trying every possible Fn+key combination, I've determined that there's no way to switch this board to boot mode.

I'm thinking I won't keep this board. No TMK, even via a converter, is pretty much a deal breaker for me these days. So unless I can figure out how to rewire it, there's no point in keeping it. Shame, too, since I really like the way this board looks and feels.
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Sat, 19 September 2015, 20:45:46
Here is my initial experiences with Sprit PCB, keep in mind that these are pretty initial

USB-to-USB, doesn't work, the PCB is probably in auto-recognition mode, the caps-lock led of the sprit PCB keeps on flashing

PS2-to-USB, doesn't work, the PCB is probably in auto-recognition mode, the caps-lock led of the sprit PCB keeps on flashing - however - in between these flashes, there are brief intervals where keys register, at most 2 keys tho

(Edit: Both converters work flawlessly with a WASD V2, a WASD V2 seems like the optimal test device for many things, I could've saved many hours/dollars if I discovered tmk converters 6-7 months ago, still I'm considering letting go off my custom keyboards/layouts and just embracing and re-building a V2)
Title: Re: USB to USB keyboard converter
Post by: njbair on Sat, 19 September 2015, 21:01:30
Here is my initial experiences with Sprit PCB, keep in mind that these are pretty initial

USB-to-USB, doesn't work, the PCB is probably in auto-recognition mode, the caps-lock led of the sprit PCB keeps on flashing

PS2-to-USB, doesn't work, the PCB is probably in auto-recognition mode, the caps-lock led of the sprit PCB keeps on flashing - however - in between these flashes, there are brief intervals where keys register, at most 2 keys tho

Hasu mentioned that he didn't think the HID_SET_PROTOCOL bit was working properly. If you are sure the Sprit PCB is supposed to support boot mode, it may be a a good candidate to debug that feature.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 19 September 2015, 23:16:20
I confirmed the converter behaves what I expected on HID Set_Protocol. It sends Set_ Protocol(Boot) request every time keyboard is pluged in so that the keyboard can change to Boot protocol mode(6KRO).

In fact my Alps64 keyboard configured with NKRO can work with this USB to USB converter. TMK NKRO code on keyboard side needed to be fixed a little but the converter has no problem with firmware already availble. (I'll updated TMK NKRO code shortly.)


This is good and bad news at same time.
Good: The converter works as what I expected.
Bad: Those keyboards don't work as what I expected. I(or you) have to look into those keyboard's behaviour to know why they don't  work :(
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Sun, 20 September 2015, 22:40:46
As a small update, Sprit PCB can't recognize the PS2-to-USB converter and the USB-to-USB converter, the reason is the auto ps2/usb selection of the PCB

The solution was to manually set the connection type, which is as simple as press and hold "U" before connecting the keyboard, it's a relief :)

Off topic, the ps2avrU firmware probably flashes itself and therefore can retain settings, pretty interesting - but it flunks on many other things, haven't tested the PS2 again yet, testing the PS2 is risky as my unit is hand-soldered, but those who can't find a tmk_keyboard pre-installed PCB could just go ahead and get the Sprit PCB to use with a converter

Edit: No long term guarantee tho, at this point I can only hope the setup to be persistent
Title: Re: USB to USB keyboard converter
Post by: njbair on Mon, 21 September 2015, 21:33:22
As a small update, Sprit PCB can't recognize the PS2-to-USB converter and the USB-to-USB converter, the reason is the auto ps2/usb selection of the PCB

The solution was to manually set the connection type, which is as simple as press and hold "U" before connecting the keyboard, it's a relief :)

Off topic, the ps2avrU firmware probably flashes itself and therefore can retain settings, pretty interesting - but it flunks on many other things, haven't tested the PS2 again yet, testing the PS2 is risky as my unit is hand-soldered, but those who can't find a tmk_keyboard pre-installed PCB could just go ahead and get the Sprit PCB to use with a converter

Edit: No long term guarantee tho, at this point I can only hope the setup to be persistent
Just today I was thinking about your issue with Infinity not working with the USB to USB converter. I read that USB is technically capable of NKRO, but it's not as widely supported across all computers. Infinity firmware uses native USB NKRO, apparently with no 6KRO fallback. This is why the converter won't work with it.

Come to think of it, I wonder if my Infinities, which run TMK, would work with the converter. I'll have to try that tomorrow.
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Tue, 22 September 2015, 10:42:35
I can't describe how satisfied I am right now, It took around an hour to replicate and extend my current layout with the usb_to_usb converter - I initially bought the converter just in case, but I don't think I will build a custom ps2_to_usb converter for NKRO, as I'm mostly at 4KRO myself :)

Used keymap_hasu.c as a base, I'm at 91.52% usage, so it's a bit concerning
Might be great if you re-built this usb_to_usb converter with a larger microcontroller :)

Is it safe to flash the converter with the keyboard connected?
It usually works, but one time the converter got stuck, likely with a mouse_click_hold too (so the mouse didn't work, things kept getting selected), the only way to re-engage was to re-connect the converter, but usually, things just start working after the flashing

(I will likely start spamming the tmk thread and maybe the issue tracker soon)

Checked for a donate link but couldn't find one, might be a good idea to add one to github, if it's going to help the development that is

Edit: The only issue I had was with the leds, they didn't turn off, I'm not sure whether this is an issue with the PCB or the converter, in any case, I ended up turning them off, simpler - I have to say, tmk_keyboard is sooo soothing after dabbling with the infinity firmware for a long time, adding a SHIFT_ESC override took 2-3 minutes, I'm slowly adding overrided modifier behaviours, yet my layout is more like FN5 FN6 FN12's instead of Q W A S D's right now :)
Title: Re: USB to USB keyboard converter
Post by: njbair on Tue, 22 September 2015, 23:50:15
I can't describe how satisfied I am right now, It took around an hour to replicate and extend my current layout with the usb_to_usb converter - I initially bought the converter just in case, but I don't think I will build a custom ps2_to_usb converter for NKRO, as I'm mostly at 4KRO myself :)

Used keymap_hasu.c as a base, I'm at 91.52% usage, so it's a bit concerning
Might be great if you re-built this usb_to_usb converter with a larger microcontroller :)

Is it safe to flash the converter with the keyboard connected?
It usually works, but one time the converter got stuck, likely with a mouse_click_hold too (so the mouse didn't work, things kept getting selected), the only way to re-engage was to re-connect the converter, but usually, things just start working after the flashing

(I will likely start spamming the tmk thread and maybe the issue tracker soon)

Checked for a donate link but couldn't find one, might be a good idea to add one to github, if it's going to help the development that is

Edit: The only issue I had was with the leds, they didn't turn off, I'm not sure whether this is an issue with the PCB or the converter, in any case, I ended up turning them off, simpler - I have to say, tmk_keyboard is sooo soothing after dabbling with the infinity firmware for a long time, adding a SHIFT_ESC override took 2-3 minutes, I'm slowly adding overrided modifier behaviours, yet my layout is more like FN5 FN6 FN12's instead of Q W A S D's right now :)

Glad to hear it's working for you.

Care to share your config? I forked hasu's TMK repo on GitHub and maintain my personal stuff within that fork. As a bonus, anyone can see my layout. Here's my repo (https://github.com/njbair/tmk_keyboard)--links to my custom stuff are at the top of the README file.
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Wed, 23 September 2015, 02:16:37
Glad to hear it's working for you.

Care to share your config? I forked hasu's TMK repo on GitHub and maintain my personal stuff within that fork. As a bonus, anyone can see my layout. Here's my repo (https://github.com/njbair/tmk_keyboard)--links to my custom stuff are at the top of the README file.

Your keymap is certainly very clean compared to mine :)

Here it is, in it's current form: https://gist.github.com/kaansoral/8c663fda0248abb4875d
It seems the 32Fn limitation is going to hit me soon (Probably going to use most of it to extend/improve the ~native "Alt" layer, like Alt+[ to /* Alt+] to */ Alt+< to <!-- etc. -- things that need frequent typing yet very hard to type on an 60%, especially the /* */'s =)

Currently dealing with this issue: https://github.com/tmk/tmk_keyboard/issues/248 - I suspect the speed/timing requirement might be due to the converter

It's a very unimportant issue tho, since I extremely rarely use the right shift

I also noticed that the CapsLock/NumLock report is broken, I wasn't expecting the state to be reported, but it's reported, yet it stops being reported at one point, I'm going to create an issue about it at one point too, again very unimportant for me, since I activate the CapsLock just to see the led

Edit: I don't think the Shift issue could be converter related tho, I don't know much about USB protocol, but is there an acknowledgement logic? - I was also paranoid whether there could be other timing issues, like regular Shift/release timing related, but after some thinking, I think the issue is mainly with layer switch bugs etc.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 26 September 2015, 16:15:18
KHAANNN,
Thanks for your feed back.
That issue is a limitation of current TMK keymap design, I've had an idea of new keymap framework but I didn't set out anything yet.
https://github.com/tmk/tmk_keyboard/issues/248

As for 32 Fn limitation, you can get a workaround by using actionmaps and 16 bit action_codes instead of 8 bit keycodes. But this may inflate flash space usage, this is critical especially for USB-USB converter.
https://github.com/tmk/tmk_keyboard/issues?utf8=%E2%9C%93&q=is%3Aissue++actionmap

Not sure about the 'CapsLock/NumLock report', LED idicators works for me as long as I tested with Cherry G80-3600 and slammed on CapsLock and NumLock keys.

BTW, what is your keyboard? Infinity?
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Sun, 27 September 2015, 02:18:49
Thanks for the info

No it's a FaceW/Sprit 60% PCB

I just re-tested the CapsLock issue, it's easily reproducible for me, when I toggle CapsLock 10-15 times, at one point the light gets stuck

As an info, my CapsLock is also on an FN Layer - yet when the Led gets stuck, it stays there, the only way to turn it off is to remove/re-attach the usb-usb converter
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 27 September 2015, 07:52:54
Ah, OK. Then, I'll have to test Infinity later.

Testing with plain keymap(just one layer) is useful to know where the problem is: Keymap or  LED report between converter and keyboard.

Title: Re: USB to USB keyboard converter
Post by: Leimi on Sun, 27 September 2015, 12:35:49
As a small update, Sprit PCB can't recognize the PS2-to-USB converter and the USB-to-USB converter, the reason is the auto ps2/usb selection of the PCB

The solution was to manually set the connection type, which is as simple as press and hold "U" before connecting the keyboard, it's a relief :)

Hey!

Thanks for the feedback, I currently have a FaceW pcb waiting to be used and I can't figure out how to make it work with a ps2-usb tmk converter. If I understand correctly, you just had to hold "u" while connection the keyboard (with the converter in between the computer and the keyboard) and it worked for you?
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Sun, 27 September 2015, 13:06:51
As a small update, Sprit PCB can't recognize the PS2-to-USB converter and the USB-to-USB converter, the reason is the auto ps2/usb selection of the PCB

The solution was to manually set the connection type, which is as simple as press and hold "U" before connecting the keyboard, it's a relief :)

Hey!

Thanks for the feedback, I currently have a FaceW pcb waiting to be used and I can't figure out how to make it work with a ps2-usb tmk converter. If I understand correctly, you just had to hold "u" while connection the keyboard (with the converter in between the computer and the keyboard) and it worked for you?

Thanks

You should hold "P" for PS2, "U" is for USB

I also have a PS2 converter made and parts for a more elegant one, yet I didn't feel the need for NKRO yet so I haven't tried it (the connections are pretty risky, a touch in the wrong place and it could fry my keyboard), I'm also unsure whether the PS2 converter is superior or inferior (in terms of protocol)

So please let us know how it goes :)
Title: Re: USB to USB keyboard converter
Post by: Leimi on Sun, 27 September 2015, 13:58:17
You should hold "P" for PS2, "U" is for USB

I also have a PS2 converter made and parts for a more elegant one, yet I didn't feel the need for NKRO yet so I haven't tried it (the connections are pretty risky, a touch in the wrong place and it could fry my keyboard), I'm also unsure whether the PS2 converter is superior or inferior (in terms of protocol)

So please let us know how it goes :)

Hey, thanks a lot!
My ps2-usb tmk converter works with facew when holding "p" when connecting it :) Without you I think I'd have given up and bought another PCB working with tmk like GON or something.

Just noticed this was the usb-usb converter topic so, sorry for the off topic heh!
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Sun, 27 September 2015, 15:11:12
You should hold "P" for PS2, "U" is for USB

I also have a PS2 converter made and parts for a more elegant one, yet I didn't feel the need for NKRO yet so I haven't tried it (the connections are pretty risky, a touch in the wrong place and it could fry my keyboard), I'm also unsure whether the PS2 converter is superior or inferior (in terms of protocol)

So please let us know how it goes :)

Hey, thanks a lot!
My ps2-usb tmk converter works with facew when holding "p" when connecting it :) Without you I think I'd have given up and bought another PCB working with tmk like GON or something.

Just noticed this was the usb-usb converter topic so, sorry for the off topic heh!

I hope no one minds the somewhat off topic discussion too :)

Glad I could help, luckily that setting is persistent, so you won't have to re-set things, it will keep on working, which is great

The GON also can't run tmk natively, you need a programmer to add a new bootloader, forgot the name of the device, but it's a cheap one

On the native side of things, I also wish there was a PCB that natively supported tmk out of the box, the AUNK was promising for a while, but it currently died down

I haven't noticed any converter related issues tho, so tmk with a converter is a good alternative, the FaceW PCB also seems pretty solid, there's also the possibility of someone re-igniting V-USB stuff and running TMK on FaceW one day

Please PM me your PS2 experiences after a while, if you can
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 03 October 2015, 23:58:39
Good news, Infinity works with my USB-USB converter as what I expected.

Infinity usually works in NKRO mode when directly connected to PC but switches to 6KRO mode automatically when connected into the converter. You don't have to do anything to switch the modes. Great.

This indicates that my expectation and firmware about NKRO-6KRO switching was correct. Then, I don't know how to support Varmilo VA87MR which doesn't switch between the modes like Infinity.
Title: Re: USB to USB keyboard converter
Post by: njbair on Sun, 04 October 2015, 00:04:37
Good news, Infinity works with my USB-USB converter as what I expected.

Infinity usually works in NKRO mode when directly connected to PC but switches to 6KRO mode automatically when connected into the converter. You don't have to do anything to switch the modes. Great.

This indicates that my expectation and firmware about NKRO-6KRO switching was correct. Then, I don't know how to support Varmilo VA87MR which doesn't switch between the modes like Infinity.

The Varmilo doesn't even work with a PS/2 adapter. It is simply incompatible with anything non-Windows.

I am inclined to take it apart and wire up a Teensy somehow, running TMK of course.

Can I do backlighting with a Teensy running TMK?
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 04 October 2015, 00:44:35
Yes, I think some people forked and added code for backlight in their own repository.

TMK has only very limited support for it and there is backlight API but I don't know it much.
You actually have to write code a lot for your backlight.
Title: Re: USB to USB keyboard converter
Post by: yangdigi on Mon, 12 October 2015, 02:24:01
By following your construction, I've managed to build one USB to USB keyboard converter. Thx, hasu.
https://geekhack.org/index.php?topic=76020.0

[attachimg=1]
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Mon, 12 October 2015, 03:18:15
So many confusing stuff in that photo

the wireless dongle, the keycaps
Title: Re: USB to USB keyboard converter
Post by: yangdigi on Mon, 12 October 2015, 03:42:00
So many confusing stuff in that photo

the wireless dongle, the keycaps
you mean my photo?
wireless dongle is for another 104 wireless keyboard that is not in this photo.
Keycaps are IKBC's with backlight on, half red and half blue. The battery of my 60 keyboard was low when I took this photo. So the right half's backlight is hard to see.
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Mon, 12 October 2015, 03:46:13
So many confusing stuff in that photo

the wireless dongle, the keycaps
you mean my photo?
wireless dongle is for another 104 wireless keyboard that is not in this photo.
Keycaps are IKBC's with backlight on, half red and half blue. The battery of my 60 keyboard was low when I took this photo. So the right half's backlight is hard to see.

Wow, I didn't even notice the half on half off backlights, I was talking about the low profile "G" keycap

Checked your other thread, definitely seems interesting, using the logitech unifying receiver with usb-usb and attaching multiple keyboards to it, very very interesting
Title: Re: USB to USB keyboard converter
Post by: yangdigi on Mon, 12 October 2015, 03:49:24
So many confusing stuff in that photo

the wireless dongle, the keycaps
you mean my photo?
wireless dongle is for another 104 wireless keyboard that is not in this photo.
Keycaps are IKBC's with backlight on, half red and half blue. The battery of my 60 keyboard was low when I took this photo. So the right half's backlight is hard to see.

Wow, I didn't even notice the half on half off backlights, I was talking about the low profile "G" keycap

Checked your other thread, definitely seems interesting, using the logitech unifying receiver with usb-usb and attaching multiple keyboards to it, very very interesting
low profile keycaps are from cherry G80-3800.
now I need to get two logitech keyboards to test if they two can work well with only one receiver in usb-usb. If works, then I can continue my work.
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Fri, 11 December 2015, 18:15:08
Hi everyone, hasu :),

I've been using this converter with: http://www.amazon.com/IOGEAR-Peripheral-Sharing-Switch-GUS402/dp/B00BD8I2OY

It works fine / as expected - yet lately sometimes the converter just doesn't power the keyboard, after switching the keyboard it's unresponsive, I also re-connect the keyboard by removing/re-connecting the mini-usb, yet the leds don't flash (they flash when the keyboard is connected) - which led me to believe this might be a converter issue
(during these, the converter led is always on)

Otherwise I would lean more towards this being an OSX issue, as it might have started after the last update

Does this make any sense?
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 12 December 2015, 08:34:05
USB Host library enumeration doesn't seems to conform to spec completely. It can fail to detect device in some cases, probably.
Title: Re: USB to USB keyboard converter
Post by: kahless on Tue, 29 December 2015, 05:16:12
Hey everyone...

Great project, and I can only imagine the possibilities that will be opened by this one.

However, I have a problem with it. I built the converter using a Leonardo with a host adapter shield. Programmed the firmware, made some modifications on the keymap, flashed again. Everything works fine.

Except for Magic Commands.

I enabled COMMAND_ENABLE in the Makefile, and after flashing the converter stopped working completely. It's not recognized by hid_listen anymore. Commenting out COMMAND_ENABLE fixes it.

I understand that njbair had a similar problem, but that it was caused by missing ICSP connection to the USB host shield. My board looks exactly like the one yangdigi showed in this thread on October 12 (with the Keyes print). It has the female header installed.

Any suggestions? Am I doing something wrong?


Thanks in advance,
Kahless.
Title: Re: USB to USB keyboard converter
Post by: kahless on Tue, 29 December 2015, 05:23:00
Oh, and one more question: media keys I press on my keyboard aren't supported, I read that. Is that because someone has to put some effort into it, or is it because it's not possible to support media keys? Using xev on Linux I see that media keys are sent like any other keypresses...

I know that I could map media keys to other keys and then send them using the converter, but I would like to keep them where they are. And on my CM Storm QuickFire Rapid-i they are sent using a combination with Fn -- which is impossible to see for the converter.


Regards,
Kahless.
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 29 December 2015, 16:12:19
I enabled COMMAND_ENABLE in the Makefile, and after flashing the converter stopped working completely. It's not recognized by hid_listen anymore. Commenting out COMMAND_ENABLE fixes it.

I understand that njbair had a similar problem, but that it was caused by missing ICSP connection to the USB host shield. My board looks exactly like the one yangdigi showed in this thread on October 12 (with the Keyes print). It has the female header installed.

Any suggestions? Am I doing something wrong?

Probaby firmware size, note that Magic commands feature bloats binary much.
Leonardo has 4KB bootloader area and you can use 28KB for application, if your binary size is more than that it won't work.
You can disable other features like Mouse keys or Extra keys(Media keys) to keep size less than 28KB limit.
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 29 December 2015, 16:23:00
Oh, and one more question: media keys I press on my keyboard aren't supported, I read that. Is that because someone has to put some effort into it, or is it because it's not possible to support media keys? Using xev on Linux I see that media keys are sent like any other keypresses...

I know that I could map media keys to other keys and then send them using the converter, but I would like to keep them where they are. And on my CM Storm QuickFire Rapid-i they are sent using a combination with Fn -- which is impossible to see for the converter.


Regards,
Kahless.

To add support for media keys is possible certainly. Every keyboard can implement media keys in different ways, so to support all of them is very difficult in terms of memory size, you will need HID descriptor parser to do that. But You can still add support only for your keyboard with hard coded instead of full functional parser.
Title: Re: USB to USB keyboard converter
Post by: Hypersphere on Tue, 29 December 2015, 17:16:03
1. Is there a step-by-step guide for programming the USB-USB converter?

2. I plug my USB keyboards into a USB hub. Will the USB-USB converter work if plugged into a USB hub?

3. Will the USB-USB converter work with a hex file that I generated for the KC-60 programmable keyboard?
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Tue, 29 December 2015, 17:36:27
1. Is there a step-by-step guide for programming the USB-USB converter?

2. I plug my USB keyboards into a USB hub. Will the USB-USB converter work if plugged into a USB hub?

3. Will the USB-USB converter work with a hex file that I generated for the KC-60 programmable keyboard?

1. I haven't seen one but programming the usb-usb is as hard as compiling the tmk firmware

2. definitely works, both for programming and using, I had always used it with a usb hub, now I'm using it with a usb hub switch, no issues

3. while I don't understand the question, the answer is probably no, in general, compatibility is a hit and miss
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 29 December 2015, 17:42:45
1. Is there a step-by-step guide for programming the USB-USB converter?

2. I plug my USB keyboards into a USB hub. Will the USB-USB converter work if plugged into a USB hub?

3. Will the USB-USB converter work with a hex file that I generated for the KC-60 programmable keyboard?

1. No. You have to check the first post of this thread and poor TMK documentations.
2. Yes. You can plug conveter into USB hub. Converter itself draws around 60mA, your hub have to be able to provide power for it and your keyboard. You can use bus power hub if power is enough, use powered hub if not.
3. Not sure what you mean and I don't know KC-60. Converter needs hex file of USB-USB firmware, it wont' run with KC-60 hex. But converter work with KC-60 if the keyboard supports boot protocol(6KRO).
Title: Re: USB to USB keyboard converter
Post by: colomb on Wed, 30 December 2015, 12:41:49
Has anyone tried to incorporate one of these in a cable similar to what orihalcon has done with the Soarers?

Hasu, I'm interested in buying on of these to use with Novatouch and RF boards. Can you think of any reason why this wouldn't work with those? Thanks
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 31 December 2015, 06:54:49
Has anyone tried to incorporate one of these in a cable similar to what orihalcon has done with the Soarers?

Hasu, I'm interested in buying on of these to use with Novatouch and RF boards. Can you think of any reason why this wouldn't work with those? Thanks


I believe it works with Realforce because RF speaks just in plain 6KRO protocol, but not sure about Novatouch. Coolermaster says it is capable of  'NKRO(Windows only)' in its product page and I don't know how the keyboard work in fact. If the keyboard can accept 'set protocol' command properly and speak in 6KRO the converter will work.
Title: Re: USB to USB keyboard converter
Post by: Hypersphere on Thu, 31 December 2015, 07:47:39
Thanks, Hasu and KHAANNN for your answers to my questions.
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 06 January 2016, 03:22:19
Confimed converter works with Infinity 60% from Massdrop, which is installed official HaaTa's kiibohd firmware. This keyboard sends key activities in NKRO but can speak also in 6KRO mode if host(converter) requests.

Converter is likely to work with NKRO keyboards if they are designed decently.
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 13 January 2016, 00:55:54
USB to USB converter supports TMK keymap editor now!

(http://i.imgur.com/ZLCNttkh.png)

Try it here.
http://www.tmk-kbd.com/tmk_keyboard/editor/usb_usb/

And Space Fn keymap, for example.
http://bit.ly/1OqgvMn
Title: Re: USB to USB keyboard converter
Post by: colomb on Thu, 14 January 2016, 15:54:07
Got the converter yesterday and spent some time programming it today. The TMK keymap editor worked perfectly. Once I had the keymap, I was somewhat confused on how to get it onto the converter. I tried following the directions at the top of this post, but they fail to mention that you need dfu-programmer. Once I figured that out,I didn't realize I had to install the drivers for the atmega. Eventually, with some direction from geniekid, I was able to use Flip to upload the hex file. Is there a thread with more detailed instructions on how to load a hex file to these converters on various operating systems?

Converter is working great with my Novatouch. I may be buying on or two more of these to have around. Thanks!!

colomb
Title: Re: USB to USB keyboard converter
Post by: Hypersphere on Thu, 14 January 2016, 17:04:43
USB to USB converter supports TMK keymap editor now!

Show Image
(http://i.imgur.com/ZLCNttkh.png)


Try it here.
http://www.tmk-kbd.com/tmk_keyboard/editor/usb_usb/

And Space Fn keymap, for example.
http://bit.ly/1OqgvMn
Thanks, Hasu! This is very helpful!
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 14 January 2016, 17:41:56
Got the converter yesterday and spent some time programming it today. The TMK keymap editor worked perfectly. Once I had the keymap, I was somewhat confused on how to get it onto the converter. I tried following the directions at the top of this post, but they fail to mention that you need dfu-programmer. Once I figured that out,I didn't realize I had to install the drivers for the atmega. Eventually, with some direction from geniekid, I was able to use Flip to upload the hex file. Is there a thread with more detailed instructions on how to load a hex file to these converters on various operating systems?

Converter is working great with my Novatouch. I may be buying on or two more of these to have around. Thanks!!

colomb

Glad to hear that it works with Novatouch!

Ah, the first post has too sparse info to program controller. I'll add link to this doc and probably have to improve the instruction.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/build.md#program-controller
Title: Re: USB to USB keyboard converter
Post by: naasfu on Wed, 20 January 2016, 01:40:11
i got around to setting up my usb-usb converters from hasu, and they are really great!  i'm primarily using them for space fn, and also to do some simple key remaps which would previously give me lots of grief when doing this via software remap and using remote desktop.

these converters work great with my WASD v2, RF 87, and also my SSK with USB cable out (not sure what's inside, but i don't think it's a programmable controller?). 

however, i wasn't able to get this to work with my GON NerD TKL board.  has anyone managed to get a GON board to work with these converters?  i suspect i'm having similar issues as KHAANNN and njbair posted previously.  when i first plug things in, no keys register at all.  if i toggle NKRO mode using the key combo, then most keys will register, but a couple of keys like Shift and Caps Lock still won't register.  i tried stuff like connecting things in different orders (eg, connect keyboard to converter, then to PC), and also holding down the NKRO toggle keys when plugging in the board.

anyways, wonderful work, hasu!  thanks so much for this extremely useful tool.  i'm also a happy fan of the BT HHKB controller. :)
Title: Re: USB to USB keyboard converter
Post by: yangdigi on Sat, 06 February 2016, 19:14:03
Will usb to usb keyboard controller be able to support mouse? Then we can use it to programme mouse‘s keys for some convenient features as keyboard.
Title: Re: USB to USB keyboard converter
Post by: hoggy on Fri, 19 February 2016, 03:44:49
Got mine today. Thanks, Hasu!
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 19 February 2016, 11:50:10
Will usb to usb keyboard controller be able to support mouse? Then we can use it to programme mouse‘s keys for some convenient features as keyboard.

My firmware doesn't support mouse but I think it is not so difficult to add mouse support. Problem would be program space is tight.
Title: Re: USB to USB keyboard converter
Post by: yangdigi on Fri, 11 March 2016, 21:01:26
I've built a new USB to USB keyboard converter using Pro Micro 3.3v with mini host shield.
https://geekhack.org/index.php?topic=80421

[attachimg=1]
[attachimg=2]
Title: Re: USB to USB keyboard converter
Post by: tominabox1 on Tue, 15 March 2016, 15:43:46
Didn't fully read the thread - is it possible to hook up a teensy for this?

Maybe usb-ps/2 and the ps2-usb adapter would make more sense
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 15 March 2016, 15:57:51
possible.
Title: Re: USB to USB keyboard converter
Post by: njbair on Tue, 15 March 2016, 20:06:20
Hey hasu, have you given any more thought to the possibility of adding an optional "boot magic" delay on startup? I would love to be able to set my default Dvorak layer and ctrl/caps switching via EEPROM settings, instead of hard-coding the layout files.
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 15 March 2016, 23:11:20
Unfortunately USB to USB converter takes long time to enumerate/initialize a keyboard, simple delay won't work there. Probably you have to check whether keyboard is ready.

This is still on my TODO list but ...
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Thu, 17 March 2016, 01:55:42
Hey hasu, have you given any more thought to the possibility of adding an optional "boot magic" delay on startup? I would love to be able to set my default Dvorak layer and ctrl/caps switching via EEPROM settings, instead of hard-coding the layout files.

Doesn't switching them with a layer make more sense? - You can overlay a layout with a layer, it seems simpler than boot-level switching to me (tho I might not be understanding your use case, I guess you don't want to get your layers too complicated, and it indeed does get very complicated)

I personally have a windows layer, Fn+X toggles the windows mode for me, it switches the Ctrl/Cmd/Caps/Fn keys

My main problem with this mode is that it's hard to asses which mode the keyboard is in, when I return to OSX, I usually copy stuff with CMD+C, and realise I was using Ctrl+C later on, so I wanted to utilise the caps/num-lock leds for this purpose, in windows mode the num-lock led would be always on, yet at the time there was no way to just turn these leds/modes on or off, they could only be toggled, and toggle usually becomes the wrong parity when you quickly switch things etc.

Anyway, again, slightly-off-topic, it would be great if there was a USB-USB converter with a chip that has more space, I have OSX language macros for example, can't replicate them for windows as I'm afraid I will go out of space, If I have more space, there are lots of things I want to do
Title: Re: USB to USB keyboard converter
Post by: njbair on Sat, 19 March 2016, 12:21:46


Hey hasu, have you given any more thought to the possibility of adding an optional "boot magic" delay on startup? I would love to be able to set my default Dvorak layer and ctrl/caps switching via EEPROM settings, instead of hard-coding the layout files.

Doesn't switching them with a layer make more sense? - You can overlay a layout with a layer, it seems simpler than boot-level switching to me (tho I might not be understanding your use case, I guess you don't want to get your layers too complicated, and it indeed does get very complicated)

I personally have a windows layer, Fn+X toggles the windows mode for me, it switches the Ctrl/Cmd/Caps/Fn keys

My main problem with this mode is that it's hard to asses which mode the keyboard is in, when I return to OSX, I usually copy stuff with CMD+C, and realise I was using Ctrl+C later on, so I wanted to utilise the caps/num-lock leds for this purpose, in windows mode the num-lock led would be always on, yet at the time there was no way to just turn these leds/modes on or off, they could only be toggled, and toggle usually becomes the wrong parity when you quickly switch things etc.

Anyway, again, slightly-off-topic, it would be great if there was a USB-USB converter with a chip that has more space, I have OSX language macros for example, can't replicate them for windows as I'm afraid I will go out of space, If I have more space, there are lots of things I want to do

Boot magic is preferable to layers because TMK has no built-in way to enable layers by default. Even setting the default layer to something other than layer 0 requires boot magic.

I'd like to see boot magic extended with options for enabling any layer in addition to just the default layer. For example, set the default layer to 1 for Dvorak layout, then enable layer 4 which defines SpaceFn, and enable layer 5 to override RGUI with layer tap key functionality.

Having each Fn key defined in its own layer is certainly not memory-efficient, but it's the most user-configurable way to do it.

Kahn, if you want more space you can probably build your own converter using an Arduino Mega or something.
Title: Re: USB to USB keyboard converter
Post by: DreymaR on Fri, 06 May 2016, 07:08:08
Wow, this is SO COOL!!! Thanks, Jun!

Using the Keymap Editor is a great way of making your first .hex file, truly! But one thing stopped the show a little: The inability to map to modified keys. So I guess I have to start compiling then...

What I'd like would be radio buttons or suchlike in the editor for at least Shift and Ctrl (and possibly Gui) together with a key, so I could for instance map ZXCV to Ctrl+ZXCV in one layer, and similarly some keys to Shift+123456. Or map something to Win/Gui+T. I guess someone would like to have for instance a Ctrl+Shift+Left mapping (select previous word)?

I also have a wish for more modifier types: I use Caps as my "Extend"/Fn key; I'd like to be able to select up to 4 different Extend layers with Caps, LAlt+Caps, RAlt/AltGr+Caps and finally LAlt+RAlt+Caps. Furthermore, Shift with any of those combos could lock the layer. And holding down either Caps or LAlt alone should maintain the layer state! So you don't have to keep pressing the modifier chord while for instance using the NumPad layer.

For that, the TMK code needs tweaking I guess. Time to get cracking...!
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 02 June 2016, 20:16:21
Hi DreymaR,
been long long time since your last post, welcome back to GH ;D

Wow, this is SO COOL!!! Thanks, Jun!

Using the Keymap Editor is a great way of making your first .hex file, truly! But one thing stopped the show a little: The inability to map to modified keys. So I guess I have to start compiling then...

What I'd like would be radio buttons or suchlike in the editor for at least Shift and Ctrl (and possibly Gui) together with a key, so I could for instance map ZXCV to Ctrl+ZXCV in one layer, and similarly some keys to Shift+123456. Or map something to Win/Gui+T. I guess someone would like to have for instance a Ctrl+Shift+Left mapping (select previous word)?

I have a plan to extend capability of keymap editor to let users make copmplex actions. But it doesn't happen anytime soon and you will still have to write code to use full functionality.

You can use ACTION_MODS_KEY to implement those modified keys, like 'ACTION_MODS_KEY(MOD_LSFT | MOD_LALT, KC_LEFT)'.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/keymap.md#212-modified-key

Quote
I also have a wish for more modifier types: I use Caps as my "Extend"/Fn key; I'd like to be able to select up to 4 different Extend layers with Caps, LAlt+Caps, RAlt/AltGr+Caps and finally LAlt+RAlt+Caps. Furthermore, Shift with any of those combos could lock the layer. And holding down either Caps or LAlt alone should maintain the layer state! So you don't have to keep pressing the modifier chord while for instance using the NumPad layer.

For that, the TMK code needs tweaking I guess. Time to get cracking...!

TMK keymap system clearly doesn't support function like that and I think it is just optimal to use layout setting on OS for the purpose. But you can sitll implement your own keymap system relatively easily, due to its modularity, at least I intended so.(EDIT)

Perhaps, you can make the "Extend' feature with writing your code in Function action but it won't be trivial work.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/keymap.md#24-function-action
Title: Re: USB to USB keyboard converter
Post by: tokyo on Wed, 08 June 2016, 16:45:19
I have a keyboard with trackpad.
With usb converter, the trackpad is not working. (media keys not work either as mentioned by the 1st post)

Any idea how to enable trackpad?   It would be super awesome.

Here is the keyboard:
http://www.amazon.co.jp/dp/B00K70ZQMA
Microsoft All-in-One Media Keyboard N9Z-00023
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 08 June 2016, 21:39:19
I have a keyboard with trackpad.
With usb converter, the trackpad is not working. (media keys not work either as mentioned by the 1st post)

Any idea how to enable trackpad?   It would be super awesome.

You can write code to support the trackpad, refer to example code of USB Host shield library if you are interested.
https://github.com/felis/USB_Host_Shield_2.0
https://github.com/felis/USB_Host_Shield_2.0/tree/master/examples/HID

Title: Re: USB to USB keyboard converter
Post by: tokyo on Thu, 09 June 2016, 07:54:49
I have a keyboard with trackpad.
With usb converter, the trackpad is not working. (media keys not work either as mentioned by the 1st post)

Any idea how to enable trackpad?   It would be super awesome.

You can write code to support the trackpad, refer to example code of USB Host shield library if you are interested.
https://github.com/felis/USB_Host_Shield_2.0
https://github.com/felis/USB_Host_Shield_2.0/tree/master/examples/HID

I guess that is not trivial?    ;D
I am struggling with even C.

Then is there any keyboard with TMK which also includes working keyboard integrated trackpad/trackball/trackpoint?
Sometimes you just need mouse, I wish I didn't.  :(
I am fine with buying a keyboard or kit, switching a chip, soldering is probably over my capability.
Title: Re: USB to USB keyboard converter
Post by: Hypersphere on Sun, 12 June 2016, 14:06:14
The Hasu USB-USB converter is amazing! Hasu has made it easy by producing the hardware, firmware, and online software (configurator) for configuring layouts and creating the hex file.

I have programmed the converter for a HHKB-like layout. Thus far, I have found that it works on the following keyboards:

+ CM QFS TKL

+ KBP V60MTS-C

+ IBM SSK with Orihalcon's SDL to USB converter cable

Moreover, it works with an Iogear DVI 4-port KVM and powered USB Hub.

It also works on Windows 10 and Linux (Linux Mint 17.3 64-bit Xfce).

Finally, it works with Synergy software between Windows and Linux computers.

At present, I am using the converter in my home office. It is so useful, I have ordered a second one for work, and I am considering a third for travel.

Because I switch keyboards frequently, one concern I have is how well the converter will withstand repeated connections and disconnections. It looks fairly durable, but I am considering putting it into an enclosure with strain-relief cables to panel-mount connectors. Alternatively, KHAANNN suggested using some Pexon coiled USB cables and connecting the keyboard to the coiled cable instead of directly to the converter.
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Sun, 12 June 2016, 14:32:07
I also sent a PM to hasu to purchase another :)

I generally regret not making these kind of purchases when the item in question fails, so better safe then sorry

I use mine with this: https://www.amazon.com/IOGEAR-Peripheral-Sharing-Switch-GUS402/dp/B00BD8I2OY?ie=UTF8&*Version*=1&*entries*=0 - I only rarely need to re-connect the usb-usb converter, I would say 1/30 of the time - I switch between a windows/osx combo, the converter is always powered from one of the systems

Off topic, I programmed a windows-mode to the converter, switch to this mode by Fn+X, in windows mode caps lock is caps lock, so I can test which mode the keyboard is in by using the caps-lock, if it lights up, the keyboard is in windows mode - I tried using the leds as indicators, for example the unused num-lock led, yet at the time this was not possible, also sometimes the caps-lock led gets stuck from the converter-side of things (tho my firmware version is almost a year-old now, I'm going to update when the layer/modifier dynamics are improved, there are a lot of tmk/qmk discussions that I couldn't follow, just waiting for them to give fruit)
Title: Re: USB to USB keyboard converter
Post by: tokyo on Mon, 13 June 2016, 17:22:39
Is there any keyboard with TMK which also includes working keyboard integrated trackpad/trackball/trackpoint?
Sometimes you just need mouse, I wish I didn't.  :(
I am fine with buying a keyboard or kit, switching a chip, but soldering is probably over my capability.
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 13 June 2016, 18:33:45
Hypersphere and KHAANNN, Thanks for the info about KVM.
As for strain-relief extended cables can be useful and cheap while USB panel mount connectors are very expensive and very few in the market. And I also had saw caps-lock LED lost sync with status of PC occasionally during development and I can't remember it was fixed at some point, but try newer firmware downloaded from keymap editor.

tokyo, I don't think keyboard like that exists except for mod.
Title: Re: USB to USB keyboard converter
Post by: tokyo on Tue, 14 June 2016, 06:12:32
tokyo, I don't think keyboard like that exists except for mod.
Thanks Hasu! Any idea which keyboards might be good for a mod (easy mod, my capability is limited)?

Title: Re: USB to USB keyboard converter
Post by: tokyo on Wed, 15 June 2016, 07:03:45
ACTION_LAYER_TAP_KEY problem
when I type fast, I might be pressing 2 keys at the same time, one of them might set on layer.
For example: ACTION_LAYER_TAP_KEY(2, KC_J)
If I type "jack" fast, and pressing "a" before releasing "j", the "j" set on layer 2 instead of sending plain "j".
Is there any way to add a timeout before turning on layer 2?  (TAPPING_TERM not seem to work in this case)
Having this would be awesome because I can fully use all 26 alphbets as layer keys.
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 15 June 2016, 07:34:23
ACTION_LAYER_TAP_KEY problem
when I type fast, I might be pressing 2 keys at the same time, one of them might set on layer.
For example: ACTION_LAYER_TAP_KEY(2, KC_J)
If I type "jack" fast, and pressing "a" before releasing "j", the "j" set on layer 2 instead of sending plain "j".
Is there any way to add a timeout before turning on layer 2?  (TAPPING_TERM not seem to work in this case)
Having this would be awesome because I can fully use all 26 alphbets as layer keys.


it seems like
1) you hold the "j" longer than TAPPING_TERM in the result. so try bigger TAPPING_TERM value.
or
2) you release "a" key before releasing "j", in this case layer 2 is activated.

This tap key rules are optimized for my fingering and speed and not configurable much. If these doesn't work for you, you need your own "dual role key"(tap key) implementation.

anyway, this problem is not related to USB-USB converter probably. You can use this thread for this kind of topic. https://geekhack.org/index.php?topic=41989.0

Title: Re: USB to USB keyboard converter
Post by: Hypersphere on Fri, 17 June 2016, 12:28:58
@Hasu: Thus far, I have only used the online configurator to make my hex file. This works okay for some of my keyboards. However, I have run into problems with the CapsLock indicator light on some keyboards -- it behaves in the opposite way to what is expected. That is, the CapsLock LED is on when the CapsLock is off, and conversely, the CapsLock LED is off when the CapsLock is on. What should I do to make the CapsLock indicator LED function correctly with the USB-USB converter? BTW, I have remapped CapsLock to L_Ctrl, and I use Fn+Tab ---> CapsLock.

In addition, on my Realforce 87U, the situation gets very confused with the NumLock and CapsLock LEDs and controls. To avoid major problems, I have had to disable the NumLock using a DIP switch setting. However, I have not explicitly assigned a NumLock key using the online configurator. I might try this, make a new hex file, and reflash the USB-USB converter.
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 17 June 2016, 18:08:46
Hypersphere, the converter has an issue I'm aware on locking indicator state. keyboard loses sync with host locking status at plug-in because with the converter keyboard starts up a little slow like a few seconds and it is not ready when host sends its indicator state. But after the startup, it should be sync'ed to host state if you depress one of locking keys. At least I don't see any problem with my keyboards there. Though some keyboards still can have problem.

Quote
I have remapped CapsLock to L_Ctrl, and I use Fn+Tab ---> CapsLock.
It is no problem and should work. Use "Caps Lock", not "Locking Caps Lock" in editor. "Locking Caps Lock" may goes wrong on some OS's.

Uh, I guess 87U NumLock is not an usual key and it works wierd to support its numpad. Yes, disabling its NumLock is safe with the converter.
Title: Re: USB to USB keyboard converter
Post by: Hypersphere on Fri, 17 June 2016, 18:17:27
@hasu: Thanks for your response. I erased the USB-USB converter, used the online configurator to generate a new hex file, and reflashed the converter. This time, the CapsLock and its indicator LED worked as expected. I also explicitly remapped the Scroll Lock in the nav island to NumLock. Now, the RF87U works as expected with both CapsLock and NumLock. All is well!


Title: Re: USB to USB keyboard converter
Post by: DreymaR on Mon, 25 July 2016, 16:22:17
HOKAY!!! *phew*

I've made a shell script, keymap files (including additions to keymap_common.h) and a massive topic on USB-2-USB devices in general and yours in particular, over at the Colemak Forum:

https://forum.colemak.com/topic/2158-dreymars-big-bag-of-keyboard-tricks-usb2usb-edition/

@Hasu: Hope you find the time to look at that. Any feedback would be valuable. Also, take a look in my keymap files please. They got fancy. ;-) Maybe, maybe, you might consider adding my stuff or at least some of it to your TMK USB_USB code? [Yeah, I know that this isn't the proper GitHub way and I should do a pull request instead. I'm still a bit GitHub impaired... heh.]
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 26 July 2016, 21:20:12
@Hasu: Hope you find the time to look at that. Any feedback would be valuable. Also, take a look in my keymap files please. They got fancy. ;-) Maybe, maybe, you might consider adding my stuff or at least some of it to your TMK USB_USB code? [Yeah, I know that this isn't the proper GitHub way and I should do a pull request instead. I'm still a bit GitHub impaired... heh.]

Nice writeup!
I'll add a link to your article from wiki or README of USB2USB. thanks.

As for your keymap, in layer5 you can't place modifiers like that unfortunately at the current moment at least. The modifiers can be stuck probably, see this issue.
https://github.com/tmk/tmk_keyboard/wiki/FAQ-Keymap#modifierlayer-stuck


Quote

    /* Layer 5: Extend1 (DreymaR)                                                      */
    /* ,----.    ,-------------------. ,-------------------. ,-------------------.
     * |Caps|    |MPly|MPrv|MNxt|MStp| |Mute|VolD|VolU|MSel| |WHom|WSch|MyCm|Calc|
     * `----'    `-------------------' `-------------------' `-------------------'
     * ,-------------------------------------------------------------------------.
     * | ?? | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10| F11| F12|  Pause |
     * |-------------------------------------------------------------------------|
     * |      |Esc |Wh_U|WBak|WFwd|Ms_U|PgUp|Home| Up |End |Del |Esc |Ins |  App |
     * |-------------------------------------------------------------------------|
     * |*Ext1* |Alt |Wh_D|Shft|Ctrl|Ms_D|PgDn|Left|Down|Rght|BSpc|App |WFav|PScr |
     * |-------------------------------------------------------------------------|
     * |     |Wh_L| ^Z | ^X | ^C | ^V |Btn1|Btn2|Btn3|Ms_L|Ms_R|Wh_R|            |
     * |-------------------------------------------------------------------------|
     * |      |     |Ext1 |           Return            |     |     |     |      |
     * `-------------------------------------------------------------------------'     */
    [5] = KEYMAP_AWIDEISO(
              ACL0,ACL1,ACL2,BTN4,BTN5, NO , NO ,WAKE, NO , NO , NO , NO ,
    CAPS,     MPLY,MPRV,MNXT,MSTP,MUTE,VOLD,VOLU,MSEL,WHOM,WSCH,MYCM,CALC,         PSCR,SLCK,PAUS,    VOLD,VOLU,MUTE,PWR ,    HELP,
    FN10, F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 ,JYEN,PAUS,    INS ,HOME,PGUP,    NLCK,PSLS,PAST,PMNS,    STOP,AGIN,
    TAB ,ESC ,WH_U,WBAK,WFWD,MS_U,PGUP,HOME, UP ,END ,DEL ,ESC ,INS ,     APP ,    DEL ,END ,PGDN,     P7 , P8 , P9 ,PPLS,    MENU,UNDO,
    FN1 ,LALT,WH_D,LSFT,LCTL,MS_D,PGDN,LEFT,DOWN,RGHT,BSPC,APP ,WFAV,     PSCR,                        P4 , P5 , P6 ,PCMM,    SLCT,COPY,
    LSFT,WH_L,FN17,FN18,FN19,FN20,BTN1,BTN2,BTN3,MS_L,MS_R,WH_R, RO ,     RSFT,          UP ,          P1 , P2 , P3 ,PEQL,    EXEC,PSTE,
    LCTL,LGUI,FN7 ,MHEN,HANJ,     ENT ,     HAEN,HENK,KANA,FN8 ,RGUI,APP ,RCTL,    LEFT,DOWN,RGHT,     P0 ,     PDOT,PENT,    FIND,CUT
    ),    /* <-- Extend1 */

Title: Re: USB to USB keyboard converter
Post by: DreymaR on Thu, 28 July 2016, 15:54:45
Thanks! ^_^

You mean, the Alt/Shift/Ctrl-on-letter-keys could get stuck? I've experienced some stuck Ctrl states using the program PortableKeyboardLayout on Windows, but not with the USB converter yet. We'll see. Or did you mean the Extend modifiers themselves? [EDIT: Potentially both, I see. Still, this is a very useful function for me so I'll keep it. Consequences be damned for now. ;-) The layer switches are safe as long as I have the same FN# in that position in the other layer, right?]

Your TMK Wiki (https://github.com/tmk/tmk_keyboard/wiki) isn't easy to find, there aren't many links to it that I can see? :-o

Oh, BTW: I found the key codes for MRWD MFFD EJCT in your keycode.h file, but not in your documentation. I'm still missing Brightness Up/Down as well as some weird ones like MediaPause and WWW; are they anywhere to be found? No biggie, though... I don't think I've ever actually needed those two keys.

[EDIT: One suggestion for the modifier state problem could be to make a layer switch key (e.g., ACTION_LAYER_MOMENTARY_CLEANUP) that sends keyup for all of Ctrl/Shift/AltGr(?) on release, so whenever you leave the layer it'll be with a clean modifier state! This'll generally be useful for HHKB/Extend-type mappings.]
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 30 July 2016, 12:10:51
Added those keycodes in the documentation. Thanks.
I don't think Brightness control keys are defined in USB spec and any OS supports them.
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Sat, 30 July 2016, 12:40:13
Thanks! ^_^

You mean, the Alt/Shift/Ctrl-on-letter-keys could get stuck? I've experienced some stuck Ctrl states using the program PortableKeyboardLayout on Windows, but not with the USB converter yet. We'll see. Or did you mean the Extend modifiers themselves? [EDIT: Potentially both, I see. Still, this is a very useful function for me so I'll keep it. Consequences be damned for now. ;-) The layer switches are safe as long as I have the same FN# in that position in the other layer, right?]

Your TMK Wiki (https://github.com/tmk/tmk_keyboard/wiki) isn't easy to find, there aren't many links to it that I can see? :-o

Oh, BTW: I found the key codes for MRWD MFFD EJCT in your keycode.h file, but not in your documentation. I'm still missing Brightness Up/Down as well as some weird ones like MediaPause and WWW; are they anywhere to be found? No biggie, though... I don't think I've ever actually needed those two keys.

[EDIT: One suggestion for the modifier state problem could be to make a layer switch key (e.g., ACTION_LAYER_MOMENTARY_CLEANUP) that sends keyup for all of Ctrl/Shift/AltGr(?) on release, so whenever you leave the layer it'll be with a clean modifier state! This'll generally be useful for HHKB/Extend-type mappings.]

I suffered a bit from the stuck modifiers, now I just press and release modifiers in an orderly fashion :)

If you follow the TMK github project, things are extremely heated there, there are forks with their own solutions and improvements, various discussions and alike - apart from it all, just having a stuck modifier solution would just be great
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 31 July 2016, 21:30:42
I have a plan to fix the limitation in future release, but you have to accept compromise or workaround until then.

Title: Re: USB to USB keyboard converter
Post by: DreymaR on Tue, 09 August 2016, 02:30:31
I fiddled with dfu-programmer yesterday and got it to work. Score +1.  ;D

In the help texts it says to use 'dfu-programmer erase --force' before flashing, but the '--force' directive didn't work. Without it, everything runs smoothly.

As I pointed out in the Download/Install post of my USB-2-USB topic (https://forum.colemak.com/topic/2158-dreymars-big-bag-of-keyboard-tricks-usb2usb-edition/#p18407), if using a Linux VM it may be necessary to re-capture the device to the VM every time you switch to bootloader mode. Doing that, everything worked fine for me.

FLIP on Windows is still more explicit, but flashing directly on Linux sure is handy. I didn't have to worry about mounting or device IDs at all (Ubuntu VM).
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 10 August 2016, 02:11:44
Right, dfu-programmer has different behaviour between 0.6.x and 0.7.x. With newer you will have to add the option while 0.6.x can't accept it. Makefile checks its version and decide if the option is needed.

These days I also worked with Virtualbox and bash on windows.
https://github.com/tmk/tmk_keyboard/wiki/Build-firmware-on-VirtualBox
https://github.com/tmk/tmk_keyboard/wiki/Bash-On-Ubuntu-On-Windows10
Title: Re: USB to USB keyboard converter
Post by: 00zeRO on Thu, 11 August 2016, 15:56:12
Unless I am doing something wrong, it will not work with my Varmilo VA12M. For some dumb reason, when the wrote the firmware for the little switch tester it was written with number row keycodes. I have generated the firmware I want on the Converter, and tested it with my Blackbird. Works fine for Blackbird, but for some reason the converter will not power my VA12M. Much disappoint.
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Thu, 11 August 2016, 16:04:53
Unless I am doing something wrong, it will not work with my Varmilo VA12M. For some dumb reason, when the wrote the firmware for the little switch tester it was written with number row keycodes. I have generated the firmware I want on the Converter, and tested it with my Blackbird. Works fine for Blackbird, but for some reason the converter will not power my VA12M. Much disappoint.

Varmilo specifically had issues with the USB-USB converter, while almost every other keyboard seemed to work, it might be related to that

Edit: Off topic + On topic: Would be nice if MK carried these converters :)
Title: Re: USB to USB keyboard converter
Post by: 00zeRO on Thu, 11 August 2016, 16:22:42
Unless I am doing something wrong, it will not work with my Varmilo VA12M. For some dumb reason, when the wrote the firmware for the little switch tester it was written with number row keycodes. I have generated the firmware I want on the Converter, and tested it with my Blackbird. Works fine for Blackbird, but for some reason the converter will not power my VA12M. Much disappoint.

Varmilo specifically had issues with the USB-USB converter, while almost every other keyboard seemed to work, it might be related to that

Edit: Off topic + On topic: Would be nice if MK carried these converters :)

hmm...well...we shall see
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 02 September 2016, 01:04:47
New keymap editor is available now.

- You can edit almost all actions available here( https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/keymap.md ).
- You can use same key mappping on any other converter/keyboards with TMK firmware.
- You can load keymap from firmware file and edit it.

though, its interface is still very rough as always.

Try it here.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb
SpaceFn on editor: http://goo.gl/5kvPrl
Title: Re: USB to USB keyboard converter
Post by: DreymaR on Fri, 02 September 2016, 10:00:11
Coolio! So now I can get what I wanted, by using an ACTION_MODS_KEY with, e.g., '^Z'. That's awesome! I'll update my guide accordingly.

I couldn't use the Browse... button under Base Firmware File, as it's grayed out. I suppose I'd point to a local .hex file. Or do you mean that you could load from the firmware on an attached device in Bootloader mode?
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 02 September 2016, 16:40:18
Coolio! So now I can get what I wanted, by using an ACTION_MODS_KEY with, e.g., '^Z'. That's awesome! I'll update my guide accordingly.

I couldn't use the Browse... button under Base Firmware File, as it's grayed out. I suppose I'd point to a local .hex file. Or do you mean that you could load from the firmware on an attached device in Bootloader mode?

You have to clear URL text box to use file chooser :D I'll improve user interface later.
Note that old firmware is not compatible to this new editor, you can use firmware downloaded from new editor or firmware built with 'make -f Makefile.unimap' on the latest source repository.
Title: Re: USB to USB keyboard converter
Post by: Harima on Tue, 06 September 2016, 19:45:30
Is programming macros possible with this converter? Will the 28kb limitation be a problem?
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 06 September 2016, 20:15:46
Is programming macros possible with this converter? Will the 28kb limitation be a problem?

You can use 5KB at most to define keymap layers and macros. It consumes 256 bytes per layer and a few tens of bytes for simple short macro. That space seems to me enough in most cases but it depens completely on your usage.
Title: Re: USB to USB keyboard converter
Post by: Harima on Tue, 06 September 2016, 20:26:32
Is programming macros possible with this converter? Will the 28kb limitation be a problem?

You can use 5KB at most to define keymap layers and macros. It consumes 256 bytes per layer and a few tens of bytes for simple short macro. That space seems to me enough in most cases but it depens completely on your usage.

Is there a max character length for macros and are delays possible, such as delay 1ms, 5ms, 10 ms, etc?
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 06 September 2016, 20:56:59
Is programming macros possible with this converter? Will the 28kb limitation be a problem?

You can use 5KB at most to define keymap layers and macros. It consumes 256 bytes per layer and a few tens of bytes for simple short macro. That space seems to me enough in most cases but it depens completely on your usage.

Is there a max character length for macros and are delays possible, such as delay 1ms, 5ms, 10 ms, etc?

No length limt and you can delay any 0-255ms. But in my firmware macro doesn't look anything like fancy application from Logitech. It is C codes actually like this, very rough.
https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hhkb/keymap_hasu.c#L219-L239
Title: Re: USB to USB keyboard converter
Post by: Harima on Tue, 06 September 2016, 21:34:16
Is programming macros possible with this converter? Will the 28kb limitation be a problem?

You can use 5KB at most to define keymap layers and macros. It consumes 256 bytes per layer and a few tens of bytes for simple short macro. That space seems to me enough in most cases but it depens completely on your usage.

Is there a max character length for macros and are delays possible, such as delay 1ms, 5ms, 10 ms, etc?

No length limt and you can delay any 0-255ms. But in my firmware macro doesn't look anything like fancy application from Logitech. It is C codes actually like this, very rough.
https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hhkb/keymap_hasu.c#L219-L239

No problem, I'm a quick learner  :)) Last question, can you press keys simultaneously with macros?
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 06 September 2016, 21:42:56
Is programming macros possible with this converter? Will the 28kb limitation be a problem?

You can use 5KB at most to define keymap layers and macros. It consumes 256 bytes per layer and a few tens of bytes for simple short macro. That space seems to me enough in most cases but it depens completely on your usage.

Is there a max character length for macros and are delays possible, such as delay 1ms, 5ms, 10 ms, etc?

No length limt and you can delay any 0-255ms. But in my firmware macro doesn't look anything like fancy application from Logitech. It is C codes actually like this, very rough.
https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hhkb/keymap_hasu.c#L219-L239

No problem, I'm a quick learner  :)) Last question, can you press keys simultaneously with macros?

No, unfortunately. It is not interruptable and blocks completely other macros and human keystrokes during it runs.
Title: Re: USB to USB keyboard converter
Post by: Harima on Tue, 06 September 2016, 22:03:12
Is programming macros possible with this converter? Will the 28kb limitation be a problem?

You can use 5KB at most to define keymap layers and macros. It consumes 256 bytes per layer and a few tens of bytes for simple short macro. That space seems to me enough in most cases but it depens completely on your usage.

Is there a max character length for macros and are delays possible, such as delay 1ms, 5ms, 10 ms, etc?

No length limt and you can delay any 0-255ms. But in my firmware macro doesn't look anything like fancy application from Logitech. It is C codes actually like this, very rough.
https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hhkb/keymap_hasu.c#L219-L239

No problem, I'm a quick learner  :)) Last question, can you press keys simultaneously with macros?

No, unfortunately. It is not interruptable and blocks completely other macros and human keystrokes during it runs.

That's fine. I have a Soarer converter and it does the same. Is that something that cannot be changed in the firmware? Either way, I like what I know now about your converter. OS will detect as 6KRO right? Soarer is NKRO only and it's a problem for me.
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 06 September 2016, 22:46:20
Is programming macros possible with this converter? Will the 28kb limitation be a problem?

You can use 5KB at most to define keymap layers and macros. It consumes 256 bytes per layer and a few tens of bytes for simple short macro. That space seems to me enough in most cases but it depens completely on your usage.

Is there a max character length for macros and are delays possible, such as delay 1ms, 5ms, 10 ms, etc?

No length limt and you can delay any 0-255ms. But in my firmware macro doesn't look anything like fancy application from Logitech. It is C codes actually like this, very rough.
https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hhkb/keymap_hasu.c#L219-L239

No problem, I'm a quick learner  :)) Last question, can you press keys simultaneously with macros?

No, unfortunately. It is not interruptable and blocks completely other macros and human keystrokes during it runs.

That's fine. I have a Soarer converter and it does the same. Is that something that cannot be changed in the firmware? Either way, I like what I know now about your converter. OS will detect as 6KRO right? Soarer is NKRO only and it's a problem for me.

Right, USB-USB converter supports only 6KRO on both sides.
Title: Re: USB to USB keyboard converter
Post by: DreymaR on Fri, 09 September 2016, 02:51:44
What is the new 'unimap'? I can't see any differences between UNIMAP and KEYMAP_ALL (which is what I've been using so far). But there are many keys. ;-)
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 09 September 2016, 04:18:50
What is the new 'unimap'? I can't see any differences between UNIMAP and KEYMAP_ALL (which is what I've been using so far). But there are many keys. ;-)

Unimap is basically used to support keymap editor on web browser, so you don't have to use it if you edit keymap file and compile firmware from source. And unimap can support 128keys at most while existent keymap(and actionmap) support more keys(or all 256 keys).
Title: Re: USB to USB keyboard converter
Post by: DreymaR on Fri, 09 September 2016, 04:38:45
Oh. A thought: Would it be useful to make it possible to compile using the smaller map format of 128 keys, to produce layouts only 128 bytes in size? Then a layout definition would only take up 1/2 as much memory, leaving more device bytes for shortstrings and other stuff.

For 99% of purposes, I suppose that people would want to ignore the F13-24 etc keys if those even exist on their board. Those codes could just be passed through without remapping.
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 09 September 2016, 20:17:19
It is absolutely possible by using 128 size matrix instead of 256. If you are sure about which keys you need it will be easy to shrink them to 128.
https://github.com/tmk/tmk_keyboard/blob/master/converter/usb_usb/usb_usb.cpp#L47-L52
Title: Re: USB to USB keyboard converter
Post by: mseaworthy on Tue, 13 September 2016, 00:23:40
Wondering if anyone can offer a tip on getting a key layout accurate for a Matias Quiet Mini Pro on Hasu’s USB-to-USB Converter (http://matias.ca/miniquietpro/pc/)

In using Hasu’s new editor (nice work, Hasu!), I have swapped L-CTRL and and Caps Lock as well as backspace and back slash. I’m using the keyboard on a Windows 10 box but I can’t get the hex to load in Windows…but I’m flashing it without problems on OS X using DFU Programmer.

But I can’t seem to get the right side of the bottom row (all keys right of spacebar) accurately or the up arrow and right Shift on the second row. Also the odd-ball Delete, Page Up, Page Down are off. I have attached my .hex file.


Just an observation: Some of the TMK Keyboard Editor user interface elements are off or missing all together when I use Safari, but using Chrome there are no issues.
Title: Re: USB to USB keyboard converter
Post by: Harima on Tue, 13 September 2016, 00:42:25
Ok I want to make sure I get this right. I've successfully used the browser keymap to make the firmware and have flashed that to my converter and everything works. By my understanding is that by using the browser keymap is that it doesn't allow the making of macro keys. So all I have to do is edit keymap.c and then build the firmware?
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 13 September 2016, 01:15:16
Wondering if anyone can offer a tip on getting a key layout accurate for a Matias Quiet Mini Pro on Hasu’s USB-to-USB Converter (http://matias.ca/miniquietpro/pc/)

In using Hasu’s new editor (nice work, Hasu!), I have swapped L-CTRL and and Caps Lock as well as backspace and back slash. I’m using the keyboard on a Windows 10 box but I can’t get the hex to load in Windows…but I’m flashing it without problems on OS X using DFU Programmer.

But I can’t seem to get the right side of the bottom row (all keys right of spacebar) accurately or the up arrow and right Shift on the second row. Also the odd-ball Delete, Page Up, Page Down are off. I have attached my .hex file.


Just an observation: Some of the TMK Keyboard Editor user interface elements are off or missing all together when I use Safari, but using Chrome there are no issues.

Did you install driver on Windows 10? You can use driver supplied by dfu-programmer or atmel FLIP. I can confirm dfu-programmer works on Windows 10.

You can check scan codes of the problematic keys with hid_listen. And share your keymap it would be helpful.
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 13 September 2016, 01:19:20
Ok I want to make sure I get this right. I've successfully used the browser keymap to make the firmware and have flashed that to my converter and everything works. By my understanding is that by using the browser keymap is that it doesn't allow the making of macro keys. So all I have to do is edit keymap.c and then build the firmware?

right. editor doens't support macro.
Title: Re: USB to USB keyboard converter
Post by: Sifo on Tue, 13 September 2016, 01:20:36
hmm would it be possible to make a universal bluetooth converter with your firmware
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 13 September 2016, 01:36:35
hmm would it be possible to make a universal bluetooth converter with your firmware

maybe possible but not sure flash space is still available for this. you will have to remove some features to save flash.
you need power bank, usb hub and bluetooth dongle.
Title: Re: USB to USB keyboard converter
Post by: mseaworthy on Tue, 13 September 2016, 08:23:21
Quote
Did you install driver on Windows 10? You can use driver supplied by dfu-programmer or atmel FLIP. I can confirm dfu-programmer works on Windows 10.

You can check scan codes of the problematic keys with hid_listen. And share your keymap it would be helpful.


I installed Flip but it hangs every time. I'm fine using dfu-programmer on the Mac so I have no issue with flashing the firmware. It's getting the right keymap from TMK Keyboard Editor--visually each key is assigned correctly in the Editor.

The bottom row to the right of the spacebar is all mixed up. Using the Switch Hitter software from ElitedKeyboards, I can see which codes are registered with each pressed key. I don't know how to show a keymap from the firmware but attached is an illustration of what's happening with the current hex I'm using.

[attach=1]
Title: Re: USB to USB keyboard converter
Post by: Harima on Tue, 13 September 2016, 15:03:31
I need help

Error
Code: [Select]
usb_usb_keymap.o.d  keymap.c -o obj_usb_usb/keymap.o
keymap.c:11:313: error: macro "KEYMAP_DSI" passed 105 arguments, but takes just 104
keymap.c:5: error: 'KEYMAP_DSI' undeclared here (not in a function)
keymap.c:19:284: error: macro "KEYMAP_DSI" passed 105 arguments, but takes just 104
make: *** [obj_usb_usb/keymap.o] Error 1

custom entry in keymap_common.h
Code: [Select]
/* ,---.   ,---------------. ,---------------. ,---------------. ,-----------.
 * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
 * `---'   `---------------' `---------------' `---------------' `-----------'
 * ,-----------------------------------------------------------. ,-----------. ,---------------.
 * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  \|Bsp| |Ins|Hom|PgU| |NmL|  /|  *|  -|
 * |-----------------------------------------------------------| |-----------| |---------------|
 * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]| Retn| |Del|End|PgD| |  7|  8|  9|  +|
 * |------------------------------------------------------`    | `-----------' |-----------|   |
 * |CapsL |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|  |    |               |  4|  5|  6|   |
 * |-----------------------------------------------------------|     ,---.     |---------------|
 * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift     |     |Up |     |  1|  2|  3|   |
 * |-----------------------------------------------------------| ,-----------. |-----------|   |
 * |Ctl|Gui|Alt|           Space               |Alt|Gui|App|Ctl| |Lef|Dow|Rig| |      0|  .|   |
 * `-----------------------------------------------------------' `-----------' `---------------'
 */
#define KEYMAP_DSI( \
    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,                   \
    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K31,K2A,  K49,K4A,K4B,  K53,K54,K55,K56, \
    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K28,  K4C,K4D,K4E,  K5F,K60,K61,K57, \
    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,                        K5C,K5D,K5E,     \
    KE1,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,        KE5,      K52,      K59,K5A,K5B,K58, \
    KE0,KE3,KE2,       K2C,                         KE6,KE7,K65,KE4,      K50,K51,K4F,  K62,    K63      \
) KEYMAP_ALL( \
            NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO,                                               \
    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,  NO, NO, NO, NO,  NO,      \
    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K31,K2A,  K49,K4A,K4B,  K53,K54,K55,K56, NO, NO,  \
    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K32,  K4C,K4D,K4E,  K5F,K60,K61,K57, NO, NO,  \
    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,    NO,K28,                K5C,K5D,K5E,NO,  NO, NO,  \
    KE1,NO, K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,    NO,KE5,      K52,      K59,K5A,K5B,NO,  NO, NO,  \
    KE0,KE3,KE2,NO,NO,     K2C,    NO, NO,NO,KE6,KE7,K65,KE4,  K50,K51,K4F,  K62,    K63,K58, NO, NO   \
)

#endif

my edited keymap.c
Code: [Select]
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* 0: dsi */
    KEYMAP_DSI(
        ESC,          F1,               F2,             F3,             F4,            F5,                  F6,              F7,            F8,                 F9,              F10,            F11,               F12,                                          PSCR,         SLCK,      BRK,                                                                                      \
        GRV,         1,                 2,               3,               4,                5,                  6,                7,               8,                   9,               0,                 MINS,            EQL,       BSLS,     BSPC,        INS,             HOME,    PGUP,            NLCK,       PSLS,         PAST,       PMNS,       \
        TAB,          Q,                W,              E,              R,               T,                   Y,               U,               I,                   O,               P,                LBRC,            RBRC,    ENT,                         DEL,            END,       PGDN,            P7,            P8,             P9,             PPLS,        \
        LCTL,         A,                S,               D,              F,                G,                  H,               J,                K,                  L,               SCLN,         QUOT,                                                                                                                      P4,            P5,             P6,                               \
        LSFT,         Z,                X,               C,              V,                B,                  N,              M,               COMM,          DOT,          SLSH,         RO,                RSFT,                                                          UP,                                 P1,            P2,             P3,            PENT,         \
        LCTL,         LGUI,          LALT,                                                                   SPC,                                                  RALT,         RGUI,         FN0,              RCTL,                                      LEFT,           DOWN,    RGHT,           P0,            PDOT),                         
    /* 1: FN1 */
    KEYMAP_DSI(
        SPC,    TRANS,      TRANS,      TRANS,     TRANS,       TRANS,      TRANS,     TRANS,      TRANS,        TRANS,      TRANS,      TRANS,       TRANS,                                     TRANS,     TRANS,     TRANS,                                                                                \
        TRANS,    TRANS,      TRANS,      TRANS,     TRANS,       TRANS,      TRANS,     TRANS,      TRANS,        TRANS,      TRANS,      TRANS,       TRANS,    TRANS,  TRANS,    TRANS,     TRANS,      TRANS,       TRANS,    TRANS,      TRANS,    TRANS,      \
        TRANS,    TRANS,      TRANS,      TRANS,     TRANS,       TRANS,      TRANS,     TRANS,      TRANS,        TRANS,      TRANS,      TRANS,       TRANS,    TRANS,                    TRANS,     TRANS,     TRANS,        TRANS,    TRANS,      TRANS,    TRANS,       \
        TRANS,    TRANS,      TRANS,      TRANS,     TRANS,       TRANS,      TRANS,     TRANS,      TRANS,        TRANS,      TRANS,      TRANS,                                                                                                                    TRANS,    TRANS,      TRANS,                         \
        TRANS,    TRANS,      TRANS,      TRANS,     TRANS,       TRANS,      TRANS,     TRANS,      TRANS,        TRANS,      TRANS,      TRANS,       TRANS,                                                        TRANS,                          TRANS,    TRANS,      TRANS,    TRANS,        \
        TRANS,    TRANS,      TRANS,                                                                TRANS,                                              TRANS,      TRANS,      TRANS,       TRANS,                                     TRANS,     TRANS,   TRANS,          TRANS,    TRANS),                         
};
const action_t PROGMEM fn_actions[] = {
    /* DSI Layout*/
    [0] = ACTION_LAYER_MOMENTARY(1),
};

Trying to keep it simple by just changing 1 key but when I build the firmware I get errors
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 13 September 2016, 15:32:58
Quote
Did you install driver on Windows 10? You can use driver supplied by dfu-programmer or atmel FLIP. I can confirm dfu-programmer works on Windows 10.

You can check scan codes of the problematic keys with hid_listen. And share your keymap it would be helpful.


I installed Flip but it hangs every time. I'm fine using dfu-programmer on the Mac so I have no issue with flashing the firmware. It's getting the right keymap from TMK Keyboard Editor--visually each key is assigned correctly in the Editor.

The bottom row to the right of the spacebar is all mixed up. Using the Switch Hitter software from ElitedKeyboards, I can see which codes are registered with each pressed key. I don't know how to show a keycap but attached is an illustration of what's happening with the current hex I'm using.

(Attachment Link)


What is actually your problem on Windows? Do you have error message or something? It would be helpful for other users to solve this and document it.

Hmm, I really have to document to explain how to use keymap editor keymap editor as soon as possible. Your cursor keys are sitll cursor keys on editor wherever they are placed on your kyeboard. Also other keys are. So this will work for you. http://goo.gl/YWo85a

Note that as the first post explains Fn key won't be recognized by the converter probably.
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 13 September 2016, 15:46:20
I need help

Error
Code: [Select]
usb_usb_keymap.o.d  keymap.c -o obj_usb_usb/keymap.o
keymap.c:11:313: error: macro "KEYMAP_DSI" passed 105 arguments, but takes just 104
keymap.c:5: error: 'KEYMAP_DSI' undeclared here (not in a function)
keymap.c:19:284: error: macro "KEYMAP_DSI" passed 105 arguments, but takes just 104
make: *** [obj_usb_usb/keymap.o] Error 1

Trying to keep it simple by just changing 1 key but when I build the firmware I get errors

Probably, you are messing with comma or something.
Title: Re: USB to USB keyboard converter
Post by: Harima on Tue, 13 September 2016, 15:47:41
OK I fixed keymap.c code (CAPS was LCTRL, extra RO key, TRANS supposed to be TRNS)

Current error
Code: [Select]
usb_usb.cpp: In function 'uint8_t matrix_scan()':
usb_usb.cpp:129: error: expected primary-expression before '{' token
usb_usb.cpp:129: error: expected `;' before '{' token
make: *** [obj_usb_usb/usb_usb.o] Error 1

https://github.com/tmk/tmk_keyboard/blob/master/converter/usb_usb/usb_usb.cpp#L129
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 13 September 2016, 16:28:50
OK I fixed some of the keymap.c code (CAPS was LCTRL, extra RO key)

Current error
Code: [Select]
usb_usb.cpp: In function 'uint8_t matrix_scan()':
usb_usb.cpp:129: error: expected primary-expression before '{' token
usb_usb.cpp:129: error: expected `;' before '{' token
make: *** [obj_usb_usb/usb_usb.o] Error 1

https://github.com/tmk/tmk_keyboard/blob/master/converter/usb_usb/usb_usb.cpp#L129

Did you compile firmware before editing keymap?
You better confirm whether you can compile without your change first.

I'm using GCC 4.9.2. I guess some version may have problem.
Code: [Select]
$ avr-gcc --version
avr-gcc (GCC) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 13 September 2016, 19:16:45
Just an observation: Some of the TMK Keyboard Editor user interface elements are off or missing all together when I use Safari, but using Chrome there are no issues.

Thanks. I develop it with Chrome on Ubuntu, you will get better result with Chrome. But problem reports on other browsers would help me a lot.
I occasionally check with IE and Edge on Windows10 but it still has problems. And I found Safari on Windows so I'll check using it.

Title: Re: USB to USB keyboard converter
Post by: mseaworthy on Tue, 13 September 2016, 22:50:34
Quote
Your cursor keys are sitll cursor keys on editor wherever they are placed on your kyeboard. Also other keys are. So this will work for you. http://goo.gl/YWo85a

Note that as the first post explains Fn key won't be recognized by the converter probably.

Hasu,
Thank you for helping me with the firmware for my USB-to-USB Connector. I am happy to report the link you supplied for me to the TMK Keymap Editor with the pre-populated keymap is much improved. I am only having one remaining issue.

It appears you programmed an HHKB arrow navigation cluster ([;’/) on Layer 1. I realize the Fn functionality is not programmable in the USB-to-USB connector so I tried using L-CTRL as a layer switcher (even though it appears there was no layer switching key designated in the keymap you supplied.

The HHKB arrow cluster did not work (as I suspected it wouldn’t), but pressing and holding L-CTRL + I resulted in Up arrow and L-CTRL + J resulted in Left arrow. However, when I hold and press L-CTRL + K, I just get “k.” And when I hold and press L-CTRL + L I get Down arrow (instead of the anticipated Right arrow).
This is odd for two reasons:

1) it doesn’t appear L-CTRL is anywhere in the keymap as a layer switcher nor are IJKL in the keymap as a navigation cluster (at least not visable in the TMK Keymap Editor)
2) with “I” and “J” working with L-CTRL I’d think “K” and “L” would also be working correctly (even though they don’t appear in the “visual” keymap).

In an attempt at troubleshooting, I added L-CTRL as a layer switcher to Layer 1 and moved the HHBK arrow cluster to IJKL. And oddly I got the exact same results as when there was no layer switcher and the arrow closer formatted for HHKB (namely, “I” and “J” worked as expected and “K” and “L” didn’t.

This is my uniformed guess, but I wonder if the USB-to-USB converter is transposing some key codes in the process of creating the hex file or if perhaps my Matias Quiet Mini Pro is partially incompatible with the converter (really hoping this is not the case).

My hope is to have IJKL as a home row arrow cluster on Layer 1 accessed by holding L-CTRL. Thank you for your innovative products and the tireless support.

Screen grabs are of the keymap you linked me to in the previous message (http://goo.gl/YWo85a). The hex file is from exporting the map you linked.
Title: Re: USB to USB keyboard converter
Post by: Harima on Tue, 13 September 2016, 22:55:36
Did you compile firmware before editing keymap?
You better confirm whether you can compile without your change first.

I'm using GCC 4.9.2. I guess some version may have problem.
Code: [Select]
$ avr-gcc --version
avr-gcc (GCC) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thank you. You were right. Was not able to compile properly, so I spent some time to learn how everything works. Made my first firmware and it worked! Now I can see if I can make a macro.

Edit: Fixed the problem I was having
Title: Re: USB to USB keyboard converter
Post by: Sifo on Tue, 13 September 2016, 23:52:19
hmm would it be possible to make a universal bluetooth converter with your firmware

maybe possible but not sure flash space is still available for this. you will have to remove some features to save flash.
you need power bank, usb hub and bluetooth dongle.

I only need basic features. I'll have to look into what parts to get to build it
Title: Re: USB to USB keyboard converter
Post by: Harima on Wed, 14 September 2016, 00:59:01
Code: [Select]
        case HELLO:
            return (record->event.pressed ?
                    MACRO( I(0), T(H), T(E), T(L), T(L), W(255), T(O), END ) :
                    MACRO_NONE );

What's the syntax for adding delays?

Edit: After flashing this example, I was wondering why "O" was taking longer to type than the rest. W() is wait, and I now see it in the keymap.md. I'm learning :)
Edit2: I love this converter!
Title: Re: USB to USB keyboard converter
Post by: DreymaR on Wed, 14 September 2016, 07:51:19
MSeaworthy: Take a look at my Keymap Configuration post, under Online Editor:

https://forum.colemak.com/post/18410/#p18410

There you'll find a link to an editor layout with the CapsLock key as layer1 switcher and an arrow key cross on the OKL; keys (IJKL plus Wide mod). Test it out if you need guidance.

If you get arrow keys from Ctrl+I/J, I suspect it has nothing to do with the converter since the L-Ctrl key is only CapsLock in the keymap you linked to. Could be something your keyboard does, or something your OS does?

The layer1 switch must be on layer0 to work. Layer0 is the default.

As for your uniformed guess: As you were, soldier. ;-)
Title: Re: USB to USB keyboard converter
Post by: mseaworthy on Wed, 14 September 2016, 09:48:24
Quote
The layer1 switch must be on layer0 to work. Layer0 is the default.

As for your uniformed guess: As you were, soldier. ;-)

@DreymaR thanks for your thoughtful response. Your blog post on USB devices and TMK is very helpful and informative. It turns out my layer switching was the issue (should have placed it on Layer 0). Your helpful page and Haus’s TMK Keymap Editor make this an embarrassment of riches for a customized keyboard experience. Thank you both so much for your contributions to the community!

Very useful post in getting started with TMK (a lot more than just colemak stuff)
https://forum.colemak.com/topic/2158-dreymars-big-bag-of-keyboard-tricks-usb2usb-edition/#p18410
Title: Re: USB to USB keyboard converter
Post by: Harima on Fri, 16 September 2016, 21:04:50
Code: [Select]
        case ALT_TAB:
            return (record->event.pressed ?
                    MACRO( D(LALT), D(TAB), END ) :
                    MACRO( U(TAB), END ));

I'm having trouble with this kind of macro. LALT was being held down after macro finished so I added U(LALT), but then sometimes only TAB would be pressed.
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 16 September 2016, 21:17:45
Code: [Select]
        case ALT_TAB:
            return (record->event.pressed ?
                    MACRO( D(LALT), D(TAB), END ) :
                    MACRO( U(TAB), END ));

I'm having trouble with this kind of macro. LALT was being held down after macro finished so I added U(LALT), but then sometimes only TAB would be pressed.

It is a very dirty trick depending on current implementation of keymap framework which will be changed in future. So you are recommended not to use this trick.
This is very useful for my keymaps where I use this macro to switch applications with space+tab.
Title: Re: USB to USB keyboard converter
Post by: Harima on Fri, 16 September 2016, 21:24:31
Code: [Select]
        case ALT_TAB:
            return (record->event.pressed ?
                    MACRO( D(LALT), D(TAB), END ) :
                    MACRO( U(TAB), END ));

I'm having trouble with this kind of macro. LALT was being held down after macro finished so I added U(LALT), but then sometimes only TAB would be pressed.

It is a very dirty trick depending on current implementation of keymap framework which will be changed in future. So you are recommended not to use this trick.
This is very useful for my keymaps where I use this macro to switch applications with space+tab.

OK, thank you. Could you explain to me the meaning of SM(), RM(), and CM() commands?
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 16 September 2016, 22:46:12
Code: [Select]
        case ALT_TAB:
            return (record->event.pressed ?
                    MACRO( D(LALT), D(TAB), END ) :
                    MACRO( U(TAB), END ));

I'm having trouble with this kind of macro. LALT was being held down after macro finished so I added U(LALT), but then sometimes only TAB would be pressed.

It is a very dirty trick depending on current implementation of keymap framework which will be changed in future. So you are recommended not to use this trick.
This is very useful for my keymaps where I use this macro to switch applications with space+tab.

OK, thank you. Could you explain to me the meaning of SM(), RM(), and CM() commands?

To be honest I can't remember detail but I hope this expains them :D
https://github.com/tmk/tmk_keyboard/issues/116
Title: Re: USB to USB keyboard converter
Post by: Harima on Sat, 17 September 2016, 03:12:55
Is it possible to have tap toggle modifier as 1 tap to toggle, but if holding only momentary, and 2 taps to toggle off?

I want to retain the instantaneous nature of holding down the key without having the tapping term delay

Is it possible to remove the delay from all of the hold down actions? Like ACTION_LAYER_MOMENTARY or ACTION_MODS_TAP_TOGGLE
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 17 September 2016, 17:14:48
Is it possible to have tap toggle modifier as 1 tap to toggle, but if holding only momentary, and 2 taps to toggle off?

I want to retain the instantaneous nature of holding down the key without having the tapping term delay

Is it possible to remove the delay from all of the hold down actions? Like ACTION_LAYER_MOMENTARY or ACTION_MODS_TAP_TOGGLE

You have to change codes directly but it is possible.
Number of taps to toggle can be configured with `TAPPING_TOGGLE` in `config.h`, `5` by default. But this is not what you want. It always toggles off with 1 tap, iirc.

'hold down actions'? for example?
Title: Re: USB to USB keyboard converter
Post by: Harima on Sat, 17 September 2016, 20:41:21
Is it possible to have tap toggle modifier as 1 tap to toggle, but if holding only momentary, and 2 taps to toggle off?

I want to retain the instantaneous nature of holding down the key without having the tapping term delay

Is it possible to remove the delay from all of the hold down actions? Like ACTION_LAYER_MOMENTARY or ACTION_MODS_TAP_TOGGLE

You have to change codes directly but it is possible.
Number of taps to toggle can be configured with `TAPPING_TOGGLE` in `config.h`, `5` by default. But this is not what you want. It always toggles off with 1 tap, iirc.

'hold down actions'? for example?

Examples like ACTION_MODS_TAP_KEY(MOD_RSFT [Hold], KC_GRV [Tap]) or similar Dual Role keys with Hold and Tap.

For example I changed TAPPING_TOGGLE to 2. However when using ACTION_MODS_TAP_TOGGLE(MODS_LSFT), the momentary modifier by holding shift has a delay before the next key is modified, I have to wait a couple of seconds before the shift actually registers, and I presume it is because of the TAPPING_TERM 200(ms). If it is 0ms then obviously tapping toggle won't work. Right now I just changed TAPPING_TOGGLE to 0, made a key ACTION_LAYER_TOGGLE() that accesses a layer that has both ACTION_MODS_TAP_TOGGLE(MOD_LSFT) and ACTION_MODS_TAP_TOGGLE(MOD_LALT). This way I can access my regular layer with momentary shift and no delay and the other layer with toggle modifier shift. It would be much easier if I could just double tap Shift to toggle modifier but for my purpose I can't have the momentary modifier delay the next key.

Also, I tried to make macros that toggles the 2nd layer, presses toggle modifier, and then switches back to my regular layer but it doesn't work.

Probably easier if you looked at it:

Code: [Select]
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* 0: dsi */
    KEYMAP_HERMES(
        F13,           F14,             F15,           F16,           F17,          F18,               F19,            F20,           F21,               F22,             F23,          F24,                CLEAR,                                                                                                                                                                                       \
        ESC,          F1,               F2,             F3,             F4,            F5,                  F6,              F7,            F8,                 F9,              F10,            F11,               F12,                                                            PSCR,            SLCK,      BRK,                                                                                      \
        GRV,         1,                 2,               3,               4,                5,                  6,                7,               8,                   9,               0,                 MINS,            EQL,         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,           ENT,                                                                                                                       P4,            P5,             P6,                               \
        LSFT,         Z,                X,               C,              V,                B,                  N,              M,               COMM,          DOT,          SLSH,                               RSFT,                                                                             UP,                                   P1,            P2,             P3,            PENT,         \
        LCTL,         LGUI,          LALT,                                                                   SPC,                                                  RALT,         FN0,                                 RCTL,                                                         LEFT,           DOWN,    RGHT,           P0,            PDOT),                         
    /* 1: FN1 */
    KEYMAP_HERMES(
        FN1,            FN2,           FN3,          FN4,          FN5,               FN6,           FN7,          FN8,              FN9,            FN10,         FN11,            FN12,          FN13,                                                                                                                                                                                               \
        TRNS,    TRNS,      TRNS,          TRNS,         TRNS,       TRNS,         TRNS,          TRNS,      TRNS,          TRNS,          TRNS,        TRNS,            TRNS,                                                           TRNS,     TRNS,     TRNS,                                                                                     \
        SLCK,    TRNS,      TRNS,          TRNS,         TRNS,       TRNS,         TRNS,          TRNS,      TRNS,          TRNS,          TRNS,        TRNS,            TRNS,         TRNS,                                       TRNS,      TRNS,      TRNS,          TRNS,       TRNS,      TRNS,    TRNS,            \
        TRNS,    TRNS,      TRNS,          TRNS,         TRNS,       TRNS,         TRNS,          TRNS,      TRNS,          TRNS,          TRNS,        TRNS,            TRNS,         TRNS,                                         TRNS,     TRNS,     TRNS,            TRNS,        TRNS,      TRNS,    TRNS,             \
        TRNS,    TRNS,      TRNS,          TRNS,         TRNS,       TRNS,         TRNS,          TRNS,      TRNS,          TRNS,          TRNS,        TRNS,            TRNS,                                                                                                                    TRNS,    TRNS,      TRNS,                                  \
        TRNS,    TRNS,      TRNS,          TRNS,         TRNS,       TRNS,         TRNS,          TRNS,      TRNS,          TRNS,          TRNS,                               TRNS,                                                                             TRNS,                           TRNS,    TRNS,      TRNS,    TRNS,        \
        TRNS,    FN16,      TRNS,                                                                TRNS,                                                    TRNS,           TRNS,                              TRNS,                                                          TRNS,     TRNS,   TRNS,                TRNS,    TRNS),                                 
    /* 2: FN16 */
    KEYMAP_HERMES(
        FN1,            FN2,           FN3,          FN4,          FN5,               FN6,           FN7,          FN8,              FN9,            FN10,         FN11,            FN12,          FN13,                                                                                                                                                                                               \
        TRNS,    TRNS,      TRNS,          TRNS,         TRNS,       TRNS,         TRNS,          TRNS,      TRNS,          TRNS,          TRNS,        TRNS,            TRNS,                                                           TRNS,     TRNS,     TRNS,                                                                                     \
        TRNS,    TRNS,      TRNS,          TRNS,         TRNS,       TRNS,         TRNS,          TRNS,      TRNS,          TRNS,          TRNS,        TRNS,            TRNS,         TRNS,                                       TRNS,      TRNS,      TRNS,          TRNS,       TRNS,      TRNS,    TRNS,            \
        TRNS,    TRNS,      TRNS,          TRNS,         TRNS,       TRNS,         TRNS,          TRNS,      TRNS,          TRNS,          TRNS,        TRNS,            TRNS,         TRNS,                                         TRNS,     TRNS,     TRNS,            TRNS,        TRNS,      TRNS,    TRNS,             \
        TRNS,    TRNS,      TRNS,          TRNS,         TRNS,       TRNS,         TRNS,          TRNS,      TRNS,          TRNS,          TRNS,        TRNS,            TRNS,                                                                                                                    TRNS,    TRNS,      TRNS,                                  \
        FN17,    TRNS,      TRNS,          TRNS,         TRNS,       TRNS,         TRNS,          TRNS,      TRNS,          TRNS,          TRNS,                               TRNS,                                                                             TRNS,                           TRNS,    TRNS,      TRNS,    TRNS,        \
        TRNS,    TRNS,      FN18,                                                                TRNS,                                                    TRNS,           TRNS,                              TRNS,                                                          TRNS,     TRNS,   TRNS,                TRNS,    TRNS),                                 
};

/* id for user defined functions */
enum macro_id {
    MACRO_TAP_TOGGLE_SHIFT,
    MACRO_TAP_TOGGLE_ALT,
};

/*
 * Fn action definition
 */
#ifdef KEYMAP_SECTION_ENABLE
const action_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
#else
const action_t fn_actions[] PROGMEM = {
#endif
    /* DSI Layout*/
    [16] = ACTION_LAYER_TOGGLE(2),
    [17] = ACTION_MODS_TAP_TOGGLE(MOD_LSFT),
    [18] = ACTION_MODS_TAP_TOGGLE(MOD_LALT),
};

/*
 * Macro definition
 */
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
    switch (id) {
        case MACRO_TAP_TOGGLE_SHIFT:
            return (record->event.pressed ?
                    MACRO( I(0), T(FN16), T(FN17), T(FN16), END ) :
                    MACRO_NONE );
        case MACRO_TAP_TOGGLE_ALT:
            return (record->event.pressed ?
                    MACRO( I(0), T(FN16), T(FN18), T(FN16), END ) :
                    MACRO_NONE );
    }
    return MACRO_NONE;
}






I've tried adding W() but I can't get the macros to work.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 17 September 2016, 22:50:22
TMK implementaiton(Tapping) of dual role key puts priority on use of tap key while hold key(modifier/layer) suffer from it. Because I use tapping on keys like space and semicolon in my keymap and hope the keys behave as normal key as possible. But it is possible to implement reversely as you want and I have had a plan to write code but not tried it yet.

I think you can define your own toggle modifier in action_function(), refer this code.
https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hhkb/keymap_hasu.c#L254-L280

Probably this works for your purpose.
Code: [Select]
        case RSHIFT_TOGGLE:
            // RShift with 2-tap toogle
            if (record->event.pressed) {
                // very short hold recognized as a tap && other key is pressed during that
                if (record->tap.count > 0 && !record->tap.interrupted) {
                    if (record->tap.interrupted) {
                        dprint("tap interrupted\n");
                        register_mods(MOD_BIT(KC_RSHIFT));
                    }
                } else {
                    register_mods(MOD_BIT(KC_RSHIFT));
                }
            } else {
                // taps && other key is not pressed during that
                if (record->tap.count >= 2 && !(record->tap.interrupted)) {
                    // toggle Layer 1
                    if (layer_state & (1<<1)) {
                        layer_off(1);
                    } else {
                        layer_on(1);
                    }
                } else {
                    unregister_mods(MOD_BIT(KC_RSHIFT));
                }
            }
            break;

Unfortunately, you cannot use FN* codes in macro, iirc. I have no idea why W() doesn't work.
Title: Re: USB to USB keyboard converter
Post by: Harima on Sun, 18 September 2016, 01:59:38
TMK implementaiton(Tapping) of dual role key puts priority on use of tap key while hold key(modifier/layer) suffer from it. Because I use tapping on keys like space and semicolon in my keymap and hope the keys behave as normal key as possible. But it is possible to implement reversely as you want and I have had a plan to write code but not tried it yet.

I think you can define your own toggle modifier in action_function(), refer this code.
https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hhkb/keymap_hasu.c#L254-L280

Probably this works for your purpose.
Code: [Select]
snip

Unfortunately, you cannot use FN* codes in macro, iirc. I have no idea why W() doesn't work.

Code: [Select]
keymap.c: In function 'action_function':
keymap.c:125:25: error: 'layer_state' undeclared (first use in this function)
                     if (layer_state & (1<<1)) {
                         ^
keymap.c:125:25: note: each undeclared identifier is reported only once for each function it appears in
keymap.c:126:25: warning: implicit declaration of function 'layer_off' [-Wimplicit-function-declaration]
                         layer_off(1);
                         ^
keymap.c:128:25: warning: implicit declaration of function 'layer_on' [-Wimplicit-function-declaration]
                         layer_on(1);
                         ^

I get this error when trying to compile. Tried searching  the repository for an answer, but I still can't figure it out
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 18 September 2016, 02:55:11
In C you have to include header file to show compiler prototype of functions you are using.  You can use text file searching tool like 'grep' or 'ctags' to find the header file.

In short add this line in your keymap :p
Code: [Select]
#include "action_layer.h "
Title: Re: USB to USB keyboard converter
Post by: Harima on Sun, 18 September 2016, 12:37:36
In short add this line in your keymap :p

(https://media.riffsy.com/images/e42d3b07d666aab0ad7efe4f53df5b68/tenor.gif)

Ok now that I've tried it it seems to still have momentary delay
I think what I want is a limitation of Tapping in current implementation

TMK implementaiton(Tapping) of dual role key puts priority on use of tap key while hold key(modifier/layer) suffer from it. Because I use tapping on keys like space and semicolon in my keymap and hope the keys behave as normal key as possible. But it is possible to implement reversely as you want and I have had a plan to write code but not tried it yet.
Please let me know when you do  ;D

Title: Re: USB to USB keyboard converter
Post by: Salt Peanuts on Sun, 09 October 2016, 17:11:09
Just ordered Arduino Leonardo and USB host shield.  Let's see if I can not screw this one up.
Title: Re: USB to USB keyboard converter
Post by: moparisthebest on Tue, 11 October 2016, 15:42:56
Has anyone tried to get this working with the new Teensy 3.6 ?

https://www.kickstarter.com/projects/paulstoffregen/teensy-35-and-36/description

It has a USB host port built-in, so that should *just work* without additional components right?  I just got one in the mail, just have to solder the USB leads on and I can start playing with it.
Title: Re: USB to USB keyboard converter
Post by: DreymaR on Wed, 12 October 2016, 03:23:10
Oh, that looks so awesome! With the built-in USB host, 1 Mb flash and 256 kb RAM this gives us enough room for all the hotstrings one can imagine and whatnot. It looks very very nice.
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Wed, 12 October 2016, 04:28:31
Indeed, I hope we can get it work with Teensy 3.6, It would be the definite solution

There are so many things I want to do with the keyboard, but being limited by the flash capacity
Title: Re: USB to USB keyboard converter
Post by: Salt Peanuts on Sun, 16 October 2016, 20:27:09
So I got myself an Arduino Leonardo and USB host shield.  When I try to load my hex file, I get the following message -

Quote
avrdude: butterfly_recv(): programmer is not responding

I'm guessing it has something to do with keeping Leonardo in bootloader mode.  I'd appreciate any help in figuring this out.
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 17 October 2016, 11:12:51
So I got myself an Arduino Leonardo and USB host shield.  When I try to load my hex file, I get the following message -

Quote
avrdude: butterfly_recv(): programmer is not responding

I'm guessing it has something to do with keeping Leonardo in bootloader mode.  I'd appreciate any help in figuring this out.

Bootloader of Leonardo may change serial port device in some cases and times out in 8 seconds. You have to find correct port name somehow and type command in the period, this is not so easy job. You will eventually get the gist of that after some tries.
Title: Re: USB to USB keyboard converter
Post by: Salt Peanuts on Mon, 17 October 2016, 11:58:15
Bootloader of Leonardo may change serial port device in some cases and times out in 8 seconds. You have to find correct port name somehow and type command in the period, this is not so easy job. You will eventually get the gist of that after some tries.
Thanks for the info, and I'm glad I have one converter from you coming my way.  Hopefully, I'll get Leonardo working soon, but I think chances are just as good I'll throw it against a wall in fit of frustration (at which point I'll need to get another converter from you).
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 18 October 2016, 03:32:17
Fixed LED indicator state at plugging-in, keyboard should display correct LED state from the beginning now. Upto this point it doesn't show indicators until pressing one of caps lock, scroll lock or num lock keys.
https://github.com/tmk/tmk_keyboard/commit/51326077b085ad5c82cb0ea7c63405364c052cd5

Firmware on keymap editor was also updated for this.
Title: Re: USB to USB keyboard converter
Post by: Salt Peanuts on Tue, 18 October 2016, 20:31:20
So I finally got my Leonardo/USB Host Shield working - I just wasn't getting Leonardo into bootloader mode properly.  It worked perfectly with my CODE TKL but did not play nice with my QFR w/ Frosty Flake running TMK.  The default layer worked fine but other layers would only work inconsistently.  Additionally, it did not work at all with my Kinesis Advantage2 keyboard.  This was disappointing for me as I really wanted to add some TMK features to my Advantage2.  I have an previous model Advantage coming my way tomorrow so I'll try it out with that as well.
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 18 October 2016, 20:57:59
So I finally got my Leonardo/USB Host Shield working - I just wasn't getting Leonardo into bootloader mode properly.  It worked perfectly with my CODE TKL but did not play nice with my QFR w/ Frosty Flake running TMK.  The default layer worked fine but other layers would only work inconsistently.  Additionally, it did not work at all with my Kinesis Advantage2 keyboard.  This was disappointing for me as I really wanted to add some TMK features to my Advantage2.  I have an previous model Advantage coming my way tomorrow so I'll try it out with that as well.

Nice. Leonardo bootlader is a little tedious to handle with command line :D

Interesting. what is your keymap on QFR like?

Kinetis advantage2 is NKRO? has USB hub or some extra device in it?

Title: Re: USB to USB keyboard converter
Post by: Salt Peanuts on Tue, 18 October 2016, 21:55:03
Nice. Leonardo bootlader is a little tedious to handle with command line :D

Interesting. what is your keymap on QFR like?

Kinetis advantage2 is NKRO? has USB hub or some extra device in it?
My QFR has Colemak, QWERTY, and function layers.  The keymap on Leonardo is just Colemak and SpaceFN layers.  Arrow keys in SpaceFN works, but none of the other keys (media/volume keys, Ctrl/ESC dual-role, etc.) work properly.

Advantage2 is 6KRO.  I've tried few different USB ports both on hub and motherboard without any success. 
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 19 October 2016, 02:56:21
Nice. Leonardo bootlader is a little tedious to handle with command line :D

Interesting. what is your keymap on QFR like?

Kinetis advantage2 is NKRO? has USB hub or some extra device in it?
My QFR has Colemak, QWERTY, and function layers.  The keymap on Leonardo is just Colemak and SpaceFN layers.  Arrow keys in SpaceFN works, but none of the other keys (media/volume keys, Ctrl/ESC dual-role, etc.) work properly.

Advantage2 is 6KRO.  I've tried few different USB ports both on hub and motherboard without any success. 

Media control keys  on keyboard don't work, this is limitation of the converter as described in first post. I confirmed dual role keys have problem with the converter, those keys send irregular key events too quickly and it is part of the problem. Another part is USB converter, which cannot handle the irregular events. I'll be able to fix this problem but it takes time.

I have no idea about problem with Kinesis at this point. Does hid_listen display any debug info when plugging the keyboard?
Title: Re: USB to USB keyboard converter
Post by: Salt Peanuts on Wed, 19 October 2016, 06:47:03
Media control keys  on keyboard don't work, this is limitation of the converter as described in first post. I confirmed dual role keys have problem with the converter, those keys send irregular key events too quickly and it is part of the problem. Another part is USB converter, which cannot handle the irregular events. I'll be able to fix this problem but it takes time.

I have no idea about problem with Kinesis at this point. Does hid_listen display any debug info when plugging the keyboard?
I meant the media control keys programmed onto the converter.  FWIW, everything works great when the converter is used with CODE TKL.  I'm wondering if the TMK/keymaps on QFR/FF is having some weird conflicts with the converter, especially since I haven't updated the TMK on QFR/FF in a looooong time.  In a grand scheme of things, this isn't a problem for me seeing as my QFR/FF is already running just fine on TMK.

I'll check the Advantage2 again later today.

Title: Re: USB to USB keyboard converter
Post by: Salt Peanuts on Wed, 19 October 2016, 20:14:20
No debug info on hid_listen with Advantage2.  It does make two small beeps when plugging it into Leonardo, just like it does when plugged in regularly, but none of the keys respond.

The converter does work just fine with the original Advantage model.
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 19 October 2016, 21:02:44
Advantage2 has intresting 'v-drive' funciton by which you can access keyboard configuration through virtual USB storage. I guess this leads the keyboard to a complex USB device while the converter expected simple keyboard.


Quote
Because the Advantage2 is a multimedia keyboard that can present itself to the computer as a virtual flash drive, it may not be compatible with all KVM switches. See the Advantage2 Resource page for information on compatibility.
http://www.kinesis-ergo.com/support/technical-support/troubleshooting-advantage2-keyboard/

And resources of Advantage2.
http://www.kinesis-ergo.com/advantage2-resources/


If you can share USB descriptor of the keyboard it would be useful to track this issue deep.
https://github.com/tmk/tmk_keyboard/wiki/HID-Report-Descriptor
Title: Re: USB to USB keyboard converter
Post by: Salt Peanuts on Thu, 20 October 2016, 13:47:30
If you can share USB descriptor of the keyboard it would be useful to track this issue deep.
https://github.com/tmk/tmk_keyboard/wiki/HID-Report-Descriptor

Code: [Select]
Information for device Advantage2 Keyboard (VID=0x29EA PID=0x0103):

Connection Information:
------------------------------
Connection status: Device connected
Device actual bus speed: FullSpeed
Device supports USB 1.1 specification
Device supports USB 2.0 specification
Device is hub: No
Device address: 0x0006
Current configuration value: 0x01
Number of open pipes: 3

Device Descriptor:
------------------------------
0x12 bLength
0x01 bDescriptorType
0x0200 bcdUSB
0x00 bDeviceClass   
0x00 bDeviceSubClass   
0x00 bDeviceProtocol   
0x40 bMaxPacketSize0   (64 Bytes)
0x29EA idVendor
0x0103 idProduct
0x0100 bcdDevice
0x01 iManufacturer   "Kinesis"
0x02 iProduct   "Advantage2 Keyboard"
0x03 iSerialNumber   "----------"
0x01 bNumConfigurations

Configuration Descriptor:
------------------------------
0x09 bLength
0x02 bDescriptorType
0x0039 wTotalLength   (57 Bytes)
0x02 bNumInterfaces
0x01 bConfigurationValue
0x00 iConfiguration
0xA0 bmAttributes   (Bus-powered Device, Remote-Wakeup)
0x32 bMaxPower   (100 mA)

Interface Descriptor:
------------------------------
0x09 bLength
0x04 bDescriptorType
0x00 bInterfaceNumber
0x00 bAlternateSetting
0x02 bNumEndPoints
0x08 bInterfaceClass   (Mass Storage Device Class)
0x06 bInterfaceSubClass   (Transparent SCSI subclass)
0x50 bInterfaceProtocol   (Bulk only transport)
0x00 iInterface

Endpoint Descriptor:
------------------------------
0x07 bLength
0x05 bDescriptorType
0x81 bEndpointAddress   (IN Endpoint)
0x02 bmAttributes (Transfer: Bulk / Synch: None / Usage: Data)
0x0040 wMaxPacketSize   (64 Bytes)
0x00 bInterval

Endpoint Descriptor:
------------------------------
0x07 bLength
0x05 bDescriptorType
0x02 bEndpointAddress   (OUT Endpoint)
0x02 bmAttributes (Transfer: Bulk / Synch: None / Usage: Data)
0x0040 wMaxPacketSize   (64 Bytes)
0x00 bInterval

Interface Descriptor:
------------------------------
0x09 bLength
0x04 bDescriptorType
0x01 bInterfaceNumber
0x00 bAlternateSetting
0x01 bNumEndPoints
0x03 bInterfaceClass   (Human Interface Device Class)
0x01 bInterfaceSubClass   
0x01 bInterfaceProtocol   
0x00 iInterface

HID Descriptor:
------------------------------
0x09 bLength
0x21 bDescriptorType
0x0111 bcdHID
0x00 bCountryCode
0x01 bNumDescriptors
0x22 bDescriptorType   (Report descriptor)
0x0041 bDescriptorLength

Endpoint Descriptor:
------------------------------
0x07 bLength
0x05 bDescriptorType
0x84 bEndpointAddress   (IN Endpoint)
0x03 bmAttributes (Transfer: Interrupt / Synch: None / Usage: Data)
0x0008 wMaxPacketSize   (8 Bytes)
0x02 bInterval

Microsoft OS Descriptor is not available. Error code: 0x0000001F

String Descriptor Table
--------------------------------
Index  LANGID  String
0x00   0x0000  0x0409
0x01   0x0409  "Kinesis"
0x02   0x0409  "Advantage2 Keyboard"
0x03   0x0409  "----------"
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 23 October 2016, 13:46:49
If you can share USB descriptor of the keyboard it would be useful to track this issue deep.
https://github.com/tmk/tmk_keyboard/wiki/HID-Report-Descriptor

Code: [Select]
Information for device Advantage2 Keyboard (VID=0x29EA PID=0x0103):

Connection Information:
------------------------------
Connection status: Device connected
Device actual bus speed: FullSpeed
Device supports USB 1.1 specification
Device supports USB 2.0 specification
Device is hub: No
Device address: 0x0006
Current configuration value: 0x01
Number of open pipes: 3

Device Descriptor:
------------------------------
0x12 bLength
0x01 bDescriptorType
0x0200 bcdUSB
0x00 bDeviceClass   
0x00 bDeviceSubClass   
0x00 bDeviceProtocol   
0x40 bMaxPacketSize0   (64 Bytes)
0x29EA idVendor
0x0103 idProduct
0x0100 bcdDevice
0x01 iManufacturer   "Kinesis"
0x02 iProduct   "Advantage2 Keyboard"
0x03 iSerialNumber   "----------"
0x01 bNumConfigurations

Configuration Descriptor:
------------------------------
0x09 bLength
0x02 bDescriptorType
0x0039 wTotalLength   (57 Bytes)
0x02 bNumInterfaces
0x01 bConfigurationValue
0x00 iConfiguration
0xA0 bmAttributes   (Bus-powered Device, Remote-Wakeup)
0x32 bMaxPower   (100 mA)

Interface Descriptor:
------------------------------
0x09 bLength
0x04 bDescriptorType
0x00 bInterfaceNumber
0x00 bAlternateSetting
0x02 bNumEndPoints
0x08 bInterfaceClass   (Mass Storage Device Class)
0x06 bInterfaceSubClass   (Transparent SCSI subclass)
0x50 bInterfaceProtocol   (Bulk only transport)
0x00 iInterface

Endpoint Descriptor:
------------------------------
0x07 bLength
0x05 bDescriptorType
0x81 bEndpointAddress   (IN Endpoint)
0x02 bmAttributes (Transfer: Bulk / Synch: None / Usage: Data)
0x0040 wMaxPacketSize   (64 Bytes)
0x00 bInterval

Endpoint Descriptor:
------------------------------
0x07 bLength
0x05 bDescriptorType
0x02 bEndpointAddress   (OUT Endpoint)
0x02 bmAttributes (Transfer: Bulk / Synch: None / Usage: Data)
0x0040 wMaxPacketSize   (64 Bytes)
0x00 bInterval

Interface Descriptor:
------------------------------
0x09 bLength
0x04 bDescriptorType
0x01 bInterfaceNumber
0x00 bAlternateSetting
0x01 bNumEndPoints
0x03 bInterfaceClass   (Human Interface Device Class)
0x01 bInterfaceSubClass   
0x01 bInterfaceProtocol   
0x00 iInterface

HID Descriptor:
------------------------------
0x09 bLength
0x21 bDescriptorType
0x0111 bcdHID
0x00 bCountryCode
0x01 bNumDescriptors
0x22 bDescriptorType   (Report descriptor)
0x0041 bDescriptorLength

Endpoint Descriptor:
------------------------------
0x07 bLength
0x05 bDescriptorType
0x84 bEndpointAddress   (IN Endpoint)
0x03 bmAttributes (Transfer: Interrupt / Synch: None / Usage: Data)
0x0008 wMaxPacketSize   (8 Bytes)
0x02 bInterval

Microsoft OS Descriptor is not available. Error code: 0x0000001F

String Descriptor Table
--------------------------------
Index  LANGID  String
0x00   0x0000  0x0409
0x01   0x0409  "Kinesis"
0x02   0x0409  "Advantage2 Keyboard"
0x03   0x0409  "----------"

Thanks for the info.
In Advantage2 keyboard is located in second interface while first interface is keyboard role in most cases. I guess this causes the problem with Host Shield library. I'll look into this later.
Title: Mouse/Trackball passthrough?
Post by: adreamer on Thu, 17 November 2016, 10:35:14
I have Kinesis advantage 1 keyboard and would like to try this converter.

However, I have plugged in a trackball into one of the USB ports in the keyboard. If I use this converter, can it just passthrough the mouse commands? Or the trackball won't work at all correctly?
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 17 November 2016, 12:06:51
Unfortunately no, this cannot pass through mouse or anything except for keyboard.
Title: Re: USB to USB keyboard converter
Post by: 00zeRO on Thu, 17 November 2016, 13:58:45
I just tried using mine with a Keycool 22 Key keypad. It works, but for some reason the function layer is disabled. Does this mean I can program it as I see fit?
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 17 November 2016, 14:11:48
I just tried using mine with a Keycool 22 Key keypad. It works, but for some reason the function layer is disabled. Does this mean I can program it as I see fit?

what's do you mean with "the function layer"? Keymap on USB-USB converter or the keypad has layer itself?
If you have your own keymap on the converter sharing it would be helpful.
Title: Re: USB to USB keyboard converter
Post by: 00zeRO on Thu, 17 November 2016, 14:16:45
I just tried using mine with a Keycool 22 Key keypad. It works, but for some reason the function layer is disabled. Does this mean I can program it as I see fit?

what's do you mean with "the function layer"? Keymap on USB-USB converter or the keypad has layer itself?
If you have your own keymap on the converter sharing it would be helpful.

Oh sorry. The keypad has its own built in function layer, meaning it has a Fn key when pressed allows for multimedia, hotkeys, and led functions to be used. But, when I plug it into my USB converter, only the first layer of each key is available, it appears that I cannot use the Fn layer from the original hardware while plugged into the converter. Does this make sense?
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 17 November 2016, 14:24:38
I just tried using mine with a Keycool 22 Key keypad. It works, but for some reason the function layer is disabled. Does this mean I can program it as I see fit?

what's do you mean with "the function layer"? Keymap on USB-USB converter or the keypad has layer itself?
If you have your own keymap on the converter sharing it would be helpful.

Oh sorry. The keypad has its own built in function layer, meaning it has a Fn key when pressed allows for multimedia, hotkeys, and led functions to be used. But, when I plug it into my USB converter, only the first layer of each key is available, it appears that I cannot use the Fn layer from the original hardware while plugged into the converter. Does this make sense?

OK. Media keys are not recognized as described in 'Limitation' section but other normal keys on function layer should be useful. Led functions should work because it handled completely inside the keypad. I'm not sure what "hotkey" is and whether it may work or not. And "Fn" key on keypad cannot be remap with the converter from its 'Limitation' also.
Title: Re: USB to USB keyboard converter
Post by: DreymaR on Mon, 28 November 2016, 08:56:30
Hasu: How hard would it be for the converter to just pass through anything it doesn't recognize? Like Multimedia keys, etc etc.
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 28 November 2016, 15:48:56
It seems to me like very very hard, almost impossible.
Title: Re: USB to USB keyboard converter
Post by: DreymaR on Tue, 29 November 2016, 03:29:59
Oh. Sounds simple, is hard.

"In the mind of the beginner, there are many possibilities. In the mind of the master, there are few."
Title: Re: USB to USB keyboard converter
Post by: testplsignore on Mon, 23 January 2017, 03:31:55
Hey Hasu, how hard would it be to create a version of this that could be used internally in a Novatouch?

This is the header that the novatouch uses internally for USB:
(http://i.imgur.com/xT86cSk.jpg)

I'm thinking this might even be possible with adaptors maybe? I'm not sure what that connector type is.

A programmable Novatouch with internal converter would be incredible.
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 23 January 2017, 08:09:00
I would be easy if the keyboard has enough space to place the converter inside.
You can remove USB connectors on the converter in order to solder those USB wires instead.

The connector of the pic looks to me JST PH.

Title: Re: USB to USB keyboard converter
Post by: testplsignore on Mon, 23 January 2017, 10:18:45
I'll try and get some more detailed pictures once I get my Novatouch from Originative, I think it might be the same connector Filco uses for their wired boards.

I'll also get some detailed measurements of the space inside and the exact dimensions of the connector using some calipers.

As always, props for the awesome work hasu!
Title: Re: USB to USB keyboard converter
Post by: tofgerl on Sat, 28 January 2017, 13:25:20
I've been trying to backport my QMK Satan GH60 keymap to a TMK usb_usb keymap, but I can't find a way to replace KC_HYPER. Should I just make a function...?
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 28 January 2017, 15:06:02
I've been trying to backport my QMK Satan GH60 keymap to a TMK usb_usb keymap, but I can't find a way to replace KC_HYPER. Should I just make a function...?

Now that QMK is very different from TMK now, so you would have to explain the "HYPER" to me first :p You mean KC_HYPR? I didn't know about what Hyper is and I think many don't know about Hyper as well so I'll have to place this quote from QMK.
https://github.com/qmk/qmk_firmware/wiki#fun-with-modifier-keys
Quote
HYPR(kc) - applies Hyper (all modifiers) to kc

OK. You will able to use ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL | MOD_LALT | MOD_LGUI, KC_NO) in TMK.

See right most key on bottom raw in "Code Edit" tab if you are using keymap editor.
https://goo.gl/ZkD71y
Title: Re: USB to USB keyboard converter
Post by: tofgerl on Sun, 29 January 2017, 06:01:40
Cool, thanks!
Yeah, QMK is rapidly leaving the TMK solar system...
Title: Re: USB to USB keyboard converter
Post by: xauser on Mon, 30 January 2017, 11:54:20
I just tested usb-usb converter with a fc660c and it does not work. Not a single key is working :(

Any hardware/software instructions to debug this issue? I think I can't work with a keyboard that isn't tmk enabled anymore.
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 30 January 2017, 14:04:29
Hmm, fc660c seems to be 6kro and work with the converter.
First you have to know hid descriptor, tmk wiki has how to get it.

Sent from my Nexus 5X

Title: Re: USB to USB keyboard converter
Post by: xauser on Tue, 31 January 2017, 11:45:16
This is what I got...

Code: [Select]
Bus 001 Device 013: ID 0853:0134 Topre Corporation
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x0853 Topre Corporation
  idProduct          0x0134
  bcdDevice            0.01
  iManufacturer           1 LEOPOLD
  iProduct                2 Mini Keyboard
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      1 Keyboard
      iInterface              4 Keyboard
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      65
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
Device Status:     0x0000
  (Bus Powered)
Title: Re: USB to USB keyboard converter
Post by: xauser on Wed, 01 February 2017, 12:58:38
I did some more tests with the connector and the fc660c and have some strange results. I've found a setup that gets the fc660c working.

I'm using a 50cm extension cable between usb3 port and the connector and that seems to help a lot.
Hitting keys on the keyboard during usb connect phase helps a lot.

Having the adapter with keyboard directly connected to usb3 port without hitting any keys on usb connect results in a not working fc660c for me. I have no issues with an other keyboard I tested the other day.

I hope the converter gets more robust with further patches.

Title: Re: USB to USB keyboard converter
Post by: tofgerl on Wed, 01 February 2017, 15:02:13
Usb is weird... We should have stuck with the PS/2...
Title: Re: USB to USB keyboard converter
Post by: stepardo on Thu, 02 February 2017, 10:19:52
Hello hackers!

I registered to ask these questions...

First of all I want to thank Hasu for his tremendous work of creating the tmk firmware and making it open source! This is an impressive accomplishment.

So I do have your usb to usb converter here and it works really well with a number of my keyboards. It doesn't work with two of my keyboards however, and I need a hint on how to debug this. So the symptoms are like this:
- keyboard is plugged in, and its leds flash, are off for a second and then num lock led lights up
- the keyboard does not emit any keycodes
- hid_listen shows this:
Code: [Select]
usb_state: 12
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
host.Task: 2709
usb_state: 90

Here are the usb descriptors of the keyboards that do not work.
Code: [Select]
Bus 005 Device 112: ID 04b4:2001 Cypress Semiconductor Corp.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x04b4 Cypress Semiconductor Corp.
  idProduct          0x2001
  bcdDevice            1.02
  iManufacturer           0
  iProduct                0
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           66
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          2 Game_Keyboard
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      1 Keyboard
      iInterface              2 Game_Keyboard
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      63
          Report Descriptor: (length is 63)
            Item(Global): Usage Page, data= [ 0x01 ] 1
                            Generic Desktop Controls
            Item(Local ): Usage, data= [ 0x06 ] 6
                            Keyboard
            Item(Main  ): Collection, data= [ 0x01 ] 1
                            Application
            Item(Global): Usage Page, data= [ 0x07 ] 7
                            Keyboard
            Item(Local ): Usage Minimum, data= [ 0xe0 ] 224
                            Control Left
            Item(Local ): Usage Maximum, data= [ 0xe7 ] 231
                            GUI Right
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0x01 ] 1
            Item(Global): Report Size, data= [ 0x01 ] 1
            Item(Global): Report Count, data= [ 0x08 ] 8
            Item(Main  ): Input, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Global): Report Count, data= [ 0x01 ] 1
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Main  ): Input, data= [ 0x01 ] 1
                            Constant Array Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Global): Report Count, data= [ 0x05 ] 5
            Item(Global): Report Size, data= [ 0x01 ] 1
            Item(Global): Usage Page, data= [ 0x08 ] 8
                            LEDs
            Item(Local ): Usage Minimum, data= [ 0x01 ] 1
                            NumLock
            Item(Local ): Usage Maximum, data= [ 0x05 ] 5
                            Kana
            Item(Main  ): Output, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Global): Report Count, data= [ 0x01 ] 1
            Item(Global): Report Size, data= [ 0x03 ] 3
            Item(Main  ): Output, data= [ 0x01 ] 1
                            Constant Array Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Global): Report Count, data= [ 0x06 ] 6
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0x65 ] 101
            Item(Global): Usage Page, data= [ 0x07 ] 7
                            Keyboard
            Item(Local ): Usage Minimum, data= [ 0x00 ] 0
                            No Event
            Item(Local ): Usage Maximum, data= [ 0x65 ] 101
                            Keyboard Application (Windows Key for Win95 or Compose)
            Item(Main  ): Input, data= [ 0x00 ] 0
                            Data Array Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Main  ): End Collection, data=none
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              4 Function_Device
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     176
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
Device Status:     0x0000
  (Bus Powered)

and

Code: [Select]
Bus 005 Device 106: ID 0744:0030 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x0744
  idProduct          0x0030
  bcdDevice            1.00
  iManufacturer           1 GMK electronic design GmbH
  iProduct                2 Cardreader Keyboar
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          2 Cardreader Keyboar
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower               50mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      1 Keyboard
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      66
          Report Descriptor: (length is 66)
            Item(Global): Usage Page, data= [ 0x01 ] 1
                            Generic Desktop Controls
            Item(Local ): Usage, data= [ 0x06 ] 6
                            Keyboard
            Item(Main  ): Collection, data= [ 0x01 ] 1
                            Application
            Item(Global): Report Size, data= [ 0x01 ] 1
            Item(Global): Report Count, data= [ 0x08 ] 8
            Item(Global): Usage Page, data= [ 0x07 ] 7
                            Keyboard
            Item(Local ): Usage Minimum, data= [ 0xe0 ] 224
                            Control Left
            Item(Local ): Usage Maximum, data= [ 0xe7 ] 231
                            GUI Right
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0x01 ] 1
            Item(Main  ): Input, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Report Count, data= [ 0x01 ] 1
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Main  ): Input, data= [ 0x01 ] 1
                            Constant Array Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Global): Report Count, data= [ 0x05 ] 5
            Item(Global): Report Size, data= [ 0x01 ] 1
            Item(Global): Usage Page, data= [ 0x08 ] 8
                            LEDs
            Item(Local ): Usage Minimum, data= [ 0x01 ] 1
                            NumLock
            Item(Local ): Usage Maximum, data= [ 0x05 ] 5
                            Kana
            Item(Main  ): Output, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Global): Report Count, data= [ 0x01 ] 1
            Item(Global): Report Size, data= [ 0x03 ] 3
            Item(Main  ): Output, data= [ 0x01 ] 1
                            Constant Array Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Global): Report Count, data= [ 0x06 ] 6
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0x8b 0x00 ] 139
            Item(Global): Usage Page, data= [ 0x07 ] 7
                            Keyboard
            Item(Local ): Usage Minimum, data= [ 0x00 ] 0
                            No Event
            Item(Local ): Usage Maximum, data= [ 0x8b ] 139
                            International 5 (PC98)
            Item(Main  ): Input, data= [ 0x00 ] 0
                            Data Array Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Main  ): End Collection, data=none
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
Device Status:     0x0002
  (Bus Powered)
  Remote Wakeup Enabled

Both keyboards should be HID BOOT compatible, I think.

So it would be cool if you could give me some hints on where and how to debug this. Thanks.

Best,
stepardo
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 03 February 2017, 07:29:37
xauser, stepardo,
Thanks for the info. Seems to me those keyboards should work with the converter judging from looking the descriptors. Something goes wrong in enumeration or somewhere else. I don't have any clear idea at this point. I'll have to check recent updates of USB Host Shield Library and learn its API thoroughly again.
Title: Re: USB to USB keyboard converter
Post by: stepardo on Fri, 03 February 2017, 15:15:55
I investigated further.

So both keyboards are successfully enumerated and HIDBoot<BOOT_PROTOCOL>::Init runs through to the end where it enabled polling. However, in HIDBOOT::Poll, pUsb->inTransfer always returns hrNAK, which means the keyboards tells us that there is no data.

One of the keyboards works if I do not call SetIdle in Init.

Now I will have to read some more about USB to get further with this, or do you have any idea what could go wrong?

A note about the Kinesis Advantage 2: If it insists on using an EP > 0 for HIB_BOOT, then this is a bug because HID_BOOT specifies EP0. But I haven't tested it because I don't have the keyboard here.
Title: Re: USB to USB keyboard converter
Post by: stepardo on Sun, 05 February 2017, 12:35:07
Update on my investigations.

So one keyboard that is not working sets lowspeed = false, which is different from all the keyboards that work. I have no idea why that could be a problem though.

Secondly, I could get the GMK keyboard to work reliably by increasing bInterval to 15 milliseconds (the board requests 10).
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 06 February 2017, 18:41:07
Update on my investigations.

So one keyboard that is not working sets lowspeed = false, which is different from all the keyboards that work. I have no idea why that could be a problem though.

Secondly, I could get the GMK keyboard to work reliably by increasing bInterval to 15 milliseconds (the board requests 10).

Thank you for your investigations.

I updated repository onto the latest library in this test branch. Could you try this and see if there is any difference?
https://github.com/tmk/tmk_keyboard/tree/usbhostlib_update
Title: Re: USB to USB keyboard converter
Post by: stepardo on Tue, 07 February 2017, 02:16:07
Hi Hasu,

thank you for updating the shield lib. I tested it immediately.

I have good and bad news. The good: The keyboards that previously worked still work. The bad: The non-working keyboards remain not working.

Best, Steffen
Title: Re: USB to USB keyboard converter
Post by: fine_italian_leather on Thu, 09 March 2017, 18:28:25
Got the converter today and flashed my keymap onto it, was very easy to get started. Really happy with my purchase, thank you!
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 25 March 2017, 20:12:17
I did some more tests with the connector and the fc660c and have some strange results. I've found a setup that gets the fc660c working.

I'm using a 50cm extension cable between usb3 port and the connector and that seems to help a lot.
Hitting keys on the keyboard during usb connect phase helps a lot.

Having the adapter with keyboard directly connected to usb3 port without hitting any keys on usb connect results in a not working fc660c for me. I have no issues with an other keyboard I tested the other day.

I hope the converter gets more robust with further patches.



I got FC660C the other day and confirmed this weirdness on my PC with USB2 ports. I'll look into this later.
Title: Re: USB to USB keyboard converter
Post by: moparisthebest on Fri, 31 March 2017, 12:30:21
Has anyone tried to get this working with the new Teensy 3.6 ?

https://www.kickstarter.com/projects/paulstoffregen/teensy-35-and-36/description

It has a USB host port built-in, so that should *just work* without additional components right?  I just got one in the mail, just have to solder the USB leads on and I can start playing with it.

Much later, as of today, the usb host library with I quote "preliminary keyboard support" has been released for the teensy 3.6:

https://www.pjrc.com/teensy/td_download.html

Hopefully that's one step closer to tmk running on this. :)
Title: Re: USB to USB keyboard converter
Post by: clorex on Sun, 30 April 2017, 06:19:14
I did some more tests with the connector and the fc660c and have some strange results. I've found a setup that gets the fc660c working.

I'm using a 50cm extension cable between usb3 port and the connector and that seems to help a lot.
Hitting keys on the keyboard during usb connect phase helps a lot.

Having the adapter with keyboard directly connected to usb3 port without hitting any keys on usb connect results in a not working fc660c for me. I have no issues with an other keyboard I tested the other day.

I hope the converter gets more robust with further patches.



I got FC660C the other day and confirmed this weirdness on my PC with USB2 ports. I'll look into this later.


Did you ever manage to get the FC660C to work with the USB-USB Converter? I was going to order this Converter to use with my 660C, instead of the new Alt Controller, so as to tide me over while I wait for a possible bluetooth version of the controller.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 30 April 2017, 06:41:23
I have not had time to look into this problem yet.

Tapatalk を使用して私の Nexus 5 から送信

Title: Re: USB to USB keyboard converter
Post by: tofgerl on Sun, 30 April 2017, 14:27:03
So my USB_USB converter won't work with my Realforce RGB if I plug the keyboard into the converter before I plug the converter into the laptop.

It's really just an issue because I have the keyboard and converter plugged into a USB Hub at work, so this means I have to first plug the hub into my computer, then nothing works because I'm sleepy and have forgotten about the problem... Then I have to pull the converter out, pull the keyboard out, and then plug everything in the right way.

Is this a known issue? Is there a workaround besides my very manual workaround?
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 30 April 2017, 17:38:19
So my USB_USB converter won't work with my Realforce RGB if I plug the keyboard into the converter before I plug the converter into the laptop.

It's really just an issue because I have the keyboard and converter plugged into a USB Hub at work, so this means I have to first plug the hub into my computer, then nothing works because I'm sleepy and have forgotten about the problem... Then I have to pull the converter out, pull the keyboard out, and then plug everything in the right way.

Is this a known issue? Is there a workaround besides my very manual workaround?


It sounds to me like rush current or temporary low voltage of power due to the keyboard drawing relatively much current at plugin. And it will delay starupt of chips on converters and may prevent USB emumeration process.

Chaning value of capacitors on converter may help or it may be possible to circumvent with firmware but not sure.
Title: Re: USB to USB keyboard converter
Post by: tofgerl on Mon, 01 May 2017, 08:48:01
I assume it does grab a lot of power, though I never use the RGB lighting. Unfortunately it's an adapter I bought from you, so I wouldn't even know how to change out the parts...
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 01 May 2017, 16:22:51
I'm not sure if changing caps resolves the problem, perhaps fixing firmware may be needed.
I would try changing these two capacitors below if rush current is one of culprits.
1) right one of 1uF capacitors(1608metric size) on bottom side and
(http://i.imgur.com/4yQfptG.png)

2) 4.7uF capacitor(3216metric size) on top side.
(http://i.imgur.com/7NUxWs1.png)

You will have to try conbination of some values like 1u, 4.7u, 10u or more.
I would try combinations below to see if the problem changes.
1) 4.7u and  2) 4.7u
1) 10u  and  2) 4.7u
1) 10u  and  2) 10u
1) 1u    and  2) 22u
1) 1u    and  2) 10u
1) 1u    and  2) 1u

EDIT: fixed the combinations.
Title: Re: USB to USB keyboard converter
Post by: apanzerj on Mon, 01 May 2017, 18:31:39
QQ: I'm thinking I might be able to use the hid_listen executable as a template so I can build a driver that would tell me what layer I am on (or what layers are active). Is there anything already like this? If there isn't, is there a better to communicate between the host and the keyboard besides print messages? My thought was to just send print messages with current layer status and other stuff.
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 01 May 2017, 19:15:23
Yes, it is possible to convey currently layer to host with current implementaion, you will be able to modify hid_listen. With current firmware it is oneway communication of keyboard to host but I think you can extend it to both way. Or virtual serial communication is another option as other firmwares like kiibohd uses.
Title: Re: USB to USB keyboard converter
Post by: tofgerl on Tue, 02 May 2017, 03:35:01
I'm not sure if changing caps resolves the problem, perhaps fixing firmware may be needed.
I would try changing these two capacitors below if rush current is one of culprits.


EDIT: fixed the combinations.
Sorry, that's greek to me :)
It's not that big of an issue, I'll try to update the firmware in a few months and see if that changes anything...
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 10 May 2017, 11:18:28
I did some more tests with the connector and the fc660c and have some strange results. I've found a setup that gets the fc660c working.

I'm using a 50cm extension cable between usb3 port and the connector and that seems to help a lot.
Hitting keys on the keyboard during usb connect phase helps a lot.

Having the adapter with keyboard directly connected to usb3 port without hitting any keys on usb connect results in a not working fc660c for me. I have no issues with an other keyboard I tested the other day.

I hope the converter gets more robust with further patches.



I got FC660C the other day and confirmed this weirdness on my PC with USB2 ports. I'll look into this later.

Fixed at this commit: https://github.com/tmk/tmk_keyboard/commit/3eae475f8b98152b466f8f3763a74f0ef2330d9d and update keymap editor.
FC660C seems to boot up quickly at early stage comparing to other keyboards and converter missed it at enumeration. Removed delay code from converter startup code.
Now the converter works well with FC660C.

tofgerl, new firmware may work with your Realforce RGB,  give it a try!
Title: Re: USB to USB keyboard converter
Post by: tofgerl on Wed, 10 May 2017, 13:34:27
I will!
Title: Re: USB to USB keyboard converter
Post by: spacemonkey001 on Fri, 12 May 2017, 13:11:44
Is it possible to run QMK on this converter?
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 12 May 2017, 14:27:25
Is it possible to run QMK on this converter?

I think so. I find no reason why it is not possible.
Title: Re: USB to USB keyboard converter
Post by: tofgerl on Mon, 15 May 2017, 12:27:35
tofgerl, new firmware may work with your Realforce RGB,  give it a try!

No, didn't work...
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 15 May 2017, 20:17:46
tofgerl, new firmware may work with your Realforce RGB,  give it a try!

No, didn't work...

hmm,  it smells like its NKRO or USB interface for configuration causes :(

Can you post USB descriptors of the keyboard?
https://github.com/tmk/tmk_keyboard/wiki/HID-Report-Descriptor

its price is going down fairly threse recent days here, it is time to get one finally :D
Title: Re: USB to USB keyboard converter
Post by: xauser on Tue, 16 May 2017, 12:51:45
fc660c works now with latest tmk changes.

Thanks hasu!
Title: Re: USB to USB keyboard converter
Post by: tofgerl on Tue, 16 May 2017, 14:16:23
tofgerl, new firmware may work with your Realforce RGB,  give it a try!

No, didn't work...

hmm,  it smells like its NKRO or USB interface for configuration causes :(

Can you post USB descriptors of the keyboard?
https://github.com/tmk/tmk_keyboard/wiki/HID-Report-Descriptor

its price is going down fairly threse recent days here, it is time to get one finally :D
It'll have to wait a couple of days, bank holiday tomorrow.

Yeah, it's the best keyboard I've ever owned, with one minor exception: RGB :)
Title: Re: USB to USB keyboard converter
Post by: UncleGary on Fri, 26 May 2017, 23:46:05
I have a JS realforce that I love but don't really use because it's not programmable. If I use one of these USB to USB converters, I can just pass it through and use a TMK keymap?
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 26 May 2017, 23:48:28
I have a JS realforce that I love but don't really use because it's not programmable. If I use one of these USB to USB converters, I can just pass it through and use a TMK keymap?

Hi,
What is JS realforce? can you post a link or something?
If it is a classic normal Realforce I thinik it works with the converter.
Title: Re: USB to USB keyboard converter
Post by: UncleGary on Sat, 27 May 2017, 00:31:54
I have a JS realforce that I love but don't really use because it's not programmable. If I use one of these USB to USB converters, I can just pass it through and use a TMK keymap?

Hi,
What is JS realforce? can you post a link or something?
If it is a classic normal Realforce I thinik it works with the converter.

My bad, it's one of the Justsystems ones with the Japanese layout.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 27 May 2017, 00:40:36
I have a JS realforce that I love but don't really use because it's not programmable. If I use one of these USB to USB converters, I can just pass it through and use a TMK keymap?

Hi,
What is JS realforce? can you post a link or something?
If it is a classic normal Realforce I thinik it works with the converter.

My bad, it's one of the Justsystems ones with the Japanese layout.

Ah, OK. I think it works with this because the keyboard has neither NKRO nor fancy functions.
Title: Re: USB to USB keyboard converter
Post by: tofgerl on Tue, 30 May 2017, 01:55:23
hmm,  it smells like its NKRO or USB interface for configuration causes :(
Can you post USB descriptors of the keyboard?
https://github.com/tmk/tmk_keyboard/wiki/HID-Report-Descriptor
This is all I could find:
Code: [Select]
BackLightKB:

  Product ID: 0x013a
  Vendor ID: 0x0853
  Version: 0.01
  Speed: Up to 12 Mb/sec
  Manufacturer: Topre
  Location ID: 0x14513330 / 15
  Current Available (mA): 500
  Current Required (mA): 500
  Extra Operating Current (mA): 0

I don't use Linux or Windows, so lsusb isn't available. this is from System Report.
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 30 May 2017, 02:26:22
Thanks.
I got Realforce RGB the other day but forgot to say it here. I found it has weirdness on Linux, it takes 20secs until it start registering keys. After that it works fine though. it seems like the keyboard does something exotic anyway :D I have not had time enough to look into it closely so far.
Title: Re: USB to USB keyboard converter
Post by: xauser on Tue, 30 May 2017, 04:34:00
Thanks.
I got Realforce RGB the other day but forgot to say it here. I found it has weirdness on Linux, it takes 20secs until it start registering keys. After that it works fine though. it seems like the keyboard does something exotic anyway :D I have not had time enough to look into it closely so far.

I see this behaviour on a lot of my tmk enabled keyboards on linux. On grub everything is fine but when boot process reaches X11 login screen keyboard does not work at first but starts working after 20 seconds (same with mouse). No problem on windows though. I haven't debugged that any further.

Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 30 May 2017, 04:43:13
Thanks.
I got Realforce RGB the other day but forgot to say it here. I found it has weirdness on Linux, it takes 20secs until it start registering keys. After that it works fine though. it seems like the keyboard does something exotic anyway :D I have not had time enough to look into it closely so far.

I see this behaviour on a lot of my tmk enabled keyboards on linux. On grub everything is fine but when boot process reaches X11 login screen keyboard does not work at first but starts working after 20 seconds (same with mouse). No problem on windows though. I haven't debugged that any further.

Oh, interesting.
I have never had that 20secs delay with TMK. I had the delay only with RF RGB(without USB-USB converter).

Can you still reproduce the problem with the latest TMK? What's your distribution and version actually? I'm on Ubuntu 16.04 with Xfce(I think).
Title: Re: USB to USB keyboard converter
Post by: xauser on Tue, 30 May 2017, 06:09:36
Oh, interesting.
I have never had that 20secs delay with TMK. I had the delay only with RF RGB(without USB-USB converter).

Can you still reproduce the problem with the latest TMK? What's your distribution and version actually? I'm on Ubuntu 16.04 with Xfce(I think).


I'm on Debian 9 (stretch) using xorg 7.7, systemd 232, kernel 4.9.0-3-amd64
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 28 June 2017, 01:01:17
tofgerl, new firmware may work with your Realforce RGB,  give it a try!

No, didn't work...

Sorry for late response.
I confirmed Realforce RGB works with the converter using the current firmware available from KeymapEditor. I have to (re)plug the keyboard after pluging the converter on some of USB ports. Seems that there are still room to improve on enumeration.

tofgerl, can you try it again?
Title: Re: USB to USB keyboard converter
Post by: tofgerl on Wed, 28 June 2017, 04:54:12
ponse.
I confirmed Realforce RGB works with the converter using the current firmware available from KeymapEditor. I have to (re)plug the keyboard after pluging the converter on some of USB ports. Seems that there are still room to improve on enumeration.

tofgerl, can you try it again?

No rush, It literally takes me seven seconds to fix this issue every time it pops up, which is pretty much once a day.

I don't really like KME, but I'm having problems porting my keymap to TMK, since I keep the "master" in QMK format. Right now I get this error:

Code: [Select]
/Users/tom/dev/keyboards/tmk_keyboard/converter/usb_usb/usb_usb.c:76: multiple definition of `action_get_macro'
obj_usb_usb/keymap.o:/Users/tom/dev/keyboards/tmk_keyboard/converter/usb_usb/keymap.c:73: first defined here

I assume I have the macro block wrong. It looks like this:
Code: [Select]
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
  switch (id)
  {
  case PASSWORD:
*****
 }
  return MACRO_NONE;
}
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 28 June 2017, 05:31:42
ponse.
I confirmed Realforce RGB works with the converter using the current firmware available from KeymapEditor. I have to (re)plug the keyboard after pluging the converter on some of USB ports. Seems that there are still room to improve on enumeration.

tofgerl, can you try it again?

No rush, It literally takes me seven seconds to fix this issue every time it pops up, which is pretty much once a day.

Sorry, I don't get what you mean.
Are you using QMK? what's actually your issue here?
you means it takes seven secs to replug and the repluging the keyboard is exactly your problem?


Quote
I don't really like KME, but I'm having problems porting my keymap to TMK, since I keep the "master" in QMK format. Right now I get this error:

Code: [Select]
/Users/tom/dev/keyboards/tmk_keyboard/converter/usb_usb/usb_usb.c:76: multiple definition of `action_get_macro'
obj_usb_usb/keymap.o:/Users/tom/dev/keyboards/tmk_keyboard/converter/usb_usb/keymap.c:73: first defined here

I assume I have the macro block wrong. It looks like this:
Code: [Select]
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
  switch (id)
  {
  case PASSWORD:
*****
 }
  return MACRO_NONE;
}

Unfortunately I don't know QMK much and won't support QMK here.

You can get TMK binary with default keymap here to test, btw.
https://github.com/tmk/tmk_keyboard/tree/master/converter/usb_usb/binary
Title: Re: USB to USB keyboard converter
Post by: tofgerl on Wed, 28 June 2017, 07:49:14
I'm using QMK on my main board, so I need to port the keymap back to TMK in order to recompile it.
Yeah, I need to replug the keyboard every time I reboot or wake the computer. It used to be a big deal because I had to climb underneath the desk, but after two days or so I put the converter on a usb-hub instead. Now it takes me 7 seconds.
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 29 June 2017, 23:07:42
Thanks for clarifying. And sorry, I missed or forgot what problem is in Realforce RGB completely.
Yes, the problem you described is still there, I'll look into this farther more.

Quote
So my USB_USB converter won't work with my Realforce RGB if I plug the keyboard into the converter before I plug the converter into the laptop.

EDIT: for future reference,
at current time workaroudn is plugin converter first, then the keyboard in order.
Title: Re: USB to USB keyboard converter
Post by: hoffs1 on Sun, 16 July 2017, 02:52:51
Would this work with Leopold FC750R?
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 16 July 2017, 17:35:51
Updated source and firmware binary of  keymap editor.

Fixed this issue. This affects only Japanese keyboards like HHKB JP.
https://github.com/tmk/tmk_keyboard/issues/482
Quote
KANA(ひらがな, 0x88) is not recognized with unimap on usb-usb converter.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 16 July 2017, 17:40:02
Would this work with Leopold FC750R?

This page says it is 6KRO it probably works with this converter.
https://www.amazon.com/Leopold-FC750R-Mechanical-Keyboard-Cherry/dp/B01IBK0LZ4

But it also supports PS/2 why don't you take PS/2 converter!
Title: Re: USB to USB keyboard converter
Post by: clorex on Thu, 27 July 2017, 16:01:22
Will this work with the BT HHKB JP/Pro 2 (PD-KB 620/600) if I connect a Bluetooth receiver to the converter?
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 27 July 2017, 17:15:56
Will this work with the BT HHKB JP/Pro 2 (PD-KB 620/600) if I connect a Bluetooth receiver to the converter?

No, my firmware doesn't support bluetooth dongle at this time. But the converter hardware itself with USB_Host_Shield_2.0 library can host bluetooth HID devices and it is theoretically possible if you write firmware.
https://github.com/felis/USB_Host_Shield_2.0#bluetooth-libraries
Title: Re: USB to USB keyboard converter
Post by: Eugene94 on Tue, 15 August 2017, 23:43:34
Hasu, have you considered creating a plastic casing for this converter? Perhaps something similar to this?

(https://www.customusb.com/img/customshapes/americancrew/case-design-rendering1-americancrew.jpg)

A black translucent plastic case with very high opacity would be very nice, because the amber light on the device is pretty bright. I would be interested in purchasing one if that was possible :thumb:
Title: Re: USB to USB keyboard converter
Post by: tofgerl on Wed, 16 August 2017, 05:00:15
Would be fairly easy to 3d print, though I don't know if you can 3d-print translucent plastic.
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 16 August 2017, 20:36:30
I have wanted to learn 3d cad and printer for very long time, but my laziness ...

some years ago author sent me this keyboard converter with 3d printed case, which works really well and impressive.
https://keyturbine.com/
https://github.com/zhouer/KeyTurbine/blob/master/KeyTurbine-20140321.STL
Title: Re: USB to USB keyboard converter
Post by: hanya on Thu, 17 August 2017, 08:38:01
I tried to design case the converter as practice. If someone interested in it, see:
https://github.com/hanya/USB2USB_Converter/tree/case/case
Not sure the data to match the converter PCB. But I have no plan to test the data myself now.
Polyamide SLS 3D printing is the best choice to the case which I designed. It is low price and tapping screw should work well to it.
Title: Re: USB to USB keyboard converter
Post by: Eugene94 on Thu, 17 August 2017, 14:08:23
I tried to design case the converter as practice. If someone interested in it, see:
https://github.com/hanya/USB2USB_Converter/tree/case/case
Not sure the data to match the converter PCB. But I have no plan to test the data myself now.
Polyamide SLS 3D printing is the best choice to the case which I designed. It is low price and tapping screw should work well to it.

That's a nice one!
Title: Re: USB to USB keyboard converter
Post by: Eugene94 on Sun, 20 August 2017, 13:22:25
Anyone know where cheap injection molding could be found?

(http://upstateinjectionmolding.com/wp-content/uploads/2012/12/injection-molding-890.jpg)
Title: Re: USB to USB keyboard converter
Post by: Eugene94 on Wed, 30 August 2017, 23:31:08
I tried to design case the converter as practice. If someone interested in it, see:
https://github.com/hanya/USB2USB_Converter/tree/case/case
Not sure the data to match the converter PCB. But I have no plan to test the data myself now.
Polyamide SLS 3D printing is the best choice to the case which I designed. It is low price and tapping screw should work well to it.

I tried the design with 3D Hubs and I received my resin case today.

[attachimg=1][attachimg=2]
[attachimg=3][attachimg=4]
[attachimg=5][attachimg=6]

I had to tape the two halves together because the spokes would not enter into the holes on the top part (perhaps a clipping mechanism would be better?)

[attachimg=7][attachimg=8]

The amber glow is really nice. I couldn't capture it as well on camera.

[attachimg=9]

Title: Re: USB to USB keyboard converter
Post by: domsch1988 on Tue, 26 September 2017, 04:31:20
i just want to make sure i've got this right.
I have a cherry mx board. Would this adapter allow me to use a completely custom layout without changing anything in Windows? I'm asking because Windows refuses to use a custom layout for shortcuts. I'd like to remap everything including combos while leaving qwerty as a os Layout. This would also solve my rdp problems...
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 26 September 2017, 06:07:25
This converter never be off-the-shelf soluton and not for consumers. It requires your time and money to know whether it works for you or not. There are some uncertanties; the converter may work with your keyboard or not, firmware may meet your requirments or not. Though, if you are a good programmer you will be able to solve your problems perhaps.

More detailed infos may helps:
What is actually your keyboard, 6KRO/NKRO?
What are actually the shourcuts and rdp problems?

Also check this doc about keymap, you can know what you can do basically.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/keymap.md
Title: Re: USB to USB keyboard converter
Post by: clappingcactus on Mon, 09 October 2017, 09:14:07
So I just spent the last few days of free time making sure I can get QMK to work on this converter.

Things I used;
Hasu's USB-to-USB converter: https://geekhack.org/index.php?topic=72052.0

Default TMK firmware file: https://github.com/tmk/tmk_keyboard/tree/master/converter/usb_usb/binary

QMK USB-to-USB  converter firmware: https://github.com/qmk/qmk_firmware/tree/master/keyboards/converter/usb_usb
You'll need to setup your build environment (I used Bash on Windows as in here - https://docs.qmk.fm/getting_started_build_tools.html#toolchain-setup )
To compile CONFIRM that you are using a rules.mk, file in the same folder as your keymap, that has the CPU clock set to 16MHz.

Every time you want to flash a new firmware, flash to the default TMK firmware first, then to QMK. There are some things that aren't working like the indicator light for the mode of the converter and if you flash two QMK firmwares in a row, the converter gets stuck in bootloader mode for some reason.

Otherwise, it's great.

Not trying to overstep on your toes, Hasu, I just included this information here in case someone wants to have a guide at some point of how to get QMK working on this.
Title: Re: USB to USB keyboard converter
Post by: Glod on Fri, 13 October 2017, 15:05:14
Still think this is one of the best buys I have gotten from Geekhack over the 5+ years I have been on here. It is starting to bend a bit, it needs a case.
Title: Re: USB to USB keyboard converter
Post by: Eraicos on Tue, 07 November 2017, 04:20:21
Hi, I would like to buy a mechanical keyboard and your USB to USB converter to use a custom layout at work. I've never used a mechanical keyboard so I'm not sure what to buy, but I'm sure I need it to be compatible with your converter.  I've though about buying a custom keyboard from WASDkeyboards, but I'm not sure. I've read you post but fear that, after I buy the keyboard and the converter, they can be incompatible. Do the converter work with all keyboards, apart from the ones specified at the "Incompatibiliy" section?
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 07 November 2017, 15:59:27
Hi, I would like to buy a mechanical keyboard and your USB to USB converter to use a custom layout at work. I've never used a mechanical keyboard so I'm not sure what to buy, but I'm sure I need it to be compatible with your converter.  I've though about buying a custom keyboard from WASDkeyboards, but I'm not sure. I've read you post but fear that, after I buy the keyboard and the converter, they can be incompatible. Do the converter work with all keyboards, apart from the ones specified at the "Incompatibiliy" section?

I can't say that the converter works with WASDkeyboard with 100% certainty unfortunately. as long as i know noone try the keyboard so far.

"Incompatibility" and "Reported Keyboards" list both are incomplete and just based on user reports.
Title: Re: USB to USB keyboard converter
Post by: Eraicos on Wed, 08 November 2017, 02:39:01
Hi, I would like to buy a mechanical keyboard and your USB to USB converter to use a custom layout at work. I've never used a mechanical keyboard so I'm not sure what to buy, but I'm sure I need it to be compatible with your converter.  I've though about buying a custom keyboard from WASDkeyboards, but I'm not sure. I've read you post but fear that, after I buy the keyboard and the converter, they can be incompatible. Do the converter work with all keyboards, apart from the ones specified at the "Incompatibiliy" section?

I can't say that the converter works with WASDkeyboard with 100% certainty unfortunately. as long as i know noone try the keyboard so far.

"Incompatibility" and "Reported Keyboards" list both are incomplete and just based on user reports.

So, I understand that "Reported Keyboards" are the ones that are known to work. Could you tell me things that could produce incompatibilities besides "Limitations" section? For instance, back-lighting, macro keys...
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 08 November 2017, 02:52:50
Hi, I would like to buy a mechanical keyboard and your USB to USB converter to use a custom layout at work. I've never used a mechanical keyboard so I'm not sure what to buy, but I'm sure I need it to be compatible with your converter.  I've though about buying a custom keyboard from WASDkeyboards, but I'm not sure. I've read you post but fear that, after I buy the keyboard and the converter, they can be incompatible. Do the converter work with all keyboards, apart from the ones specified at the "Incompatibiliy" section?

I can't say that the converter works with WASDkeyboard with 100% certainty unfortunately. as long as i know noone try the keyboard so far.

"Incompatibility" and "Reported Keyboards" list both are incomplete and just based on user reports.

So, I understand that "Reported Keyboards" are the ones that are known to work. Could you tell me things that could produce incompatibilities besides "Limitations" section? For instance, back-lighting, macro keys...
Most related things is NKRO.
If keyboard is normal 6KRO you can expect it works with the converter basically.

Sent from my WAS-LX2J using Tapatalk

Title: Re: USB to USB keyboard converter
Post by: Eraicos on Wed, 08 November 2017, 07:00:58
Hi, I would like to buy a mechanical keyboard and your USB to USB converter to use a custom layout at work. I've never used a mechanical keyboard so I'm not sure what to buy, but I'm sure I need it to be compatible with your converter.  I've though about buying a custom keyboard from WASDkeyboards, but I'm not sure. I've read you post but fear that, after I buy the keyboard and the converter, they can be incompatible. Do the converter work with all keyboards, apart from the ones specified at the "Incompatibiliy" section?

I can't say that the converter works with WASDkeyboard with 100% certainty unfortunately. as long as i know noone try the keyboard so far.

"Incompatibility" and "Reported Keyboards" list both are incomplete and just based on user reports.

So, I understand that "Reported Keyboards" are the ones that are known to work. Could you tell me things that could produce incompatibilities besides "Limitations" section? For instance, back-lighting, macro keys...
Most related things is NKRO.
If keyboard is normal 6KRO you can expect it works with the converter basically.

Sent from my WAS-LX2J using Tapatalk

I've read that over USB it's only possible to use 6KRO, but, with a adapter to PS/2, it's possible to have NKRO. WASD keyboards work that way, so they send you a USB to PS/2 adapter to enable NKRO if you need it. Then, your converter should work normally if I only use the USB, shouldn't it?
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 10 November 2017, 05:24:51
Hi, I would like to buy a mechanical keyboard and your USB to USB converter to use a custom layout at work. I've never used a mechanical keyboard so I'm not sure what to buy, but I'm sure I need it to be compatible with your converter.  I've though about buying a custom keyboard from WASDkeyboards, but I'm not sure. I've read you post but fear that, after I buy the keyboard and the converter, they can be incompatible. Do the converter work with all keyboards, apart from the ones specified at the "Incompatibiliy" section?

I can't say that the converter works with WASDkeyboard with 100% certainty unfortunately. as long as i know noone try the keyboard so far.

"Incompatibility" and "Reported Keyboards" list both are incomplete and just based on user reports.

So, I understand that "Reported Keyboards" are the ones that are known to work. Could you tell me things that could produce incompatibilities besides "Limitations" section? For instance, back-lighting, macro keys...
Most related things is NKRO.
If keyboard is normal 6KRO you can expect it works with the converter basically.

Sent from my WAS-LX2J using Tapatalk

I've read that over USB it's only possible to use 6KRO, but, with a adapter to PS/2, it's possible to have NKRO. WASD keyboards work that way, so they send you a USB to PS/2 adapter to enable NKRO if you need it. Then, your converter should work normally if I only use the USB, shouldn't it?

Yes, it will work probably.
If the keyboard supports PS/2 you can use PS/2-USB converter instead :D
Title: Re: USB to USB keyboard converter
Post by: haydoselefantes on Mon, 15 January 2018, 13:02:49
Picked up one of these last week.  Works great - mapped the power key, volume, screen brightness, swapped the Alt and Windows keys - basically got my Realforce 87u to behave just like an Apple keyboard with my MacBook Pro.  Great easy purchasing experience too: arrrived in California in about a week. 

Thanks hasu!
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Fri, 02 March 2018, 12:05:20
I've been exceeding the memory on the converter, I've been using the same keymap for 2 years, decided to build using the latest project files, but it's not working for me size-wise (small note, would be nice to upgrade things to 128kb levels, I'd definitely buy another converter, 30kb is so limiting)

Any ideas on how to reduce the size without reducing the macro's and stuff?

For example, I stumbled onto a related discussion on QMK, the solution in that case was to disable a feature, I wonder if there are such features on TMK that I can disable
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 02 March 2018, 19:18:25
I've been exceeding the memory on the converter, I've been using the same keymap for 2 years, decided to build using the latest project files, but it's not working for me size-wise (small note, would be nice to upgrade things to 128kb levels, I'd definitely buy another converter, 30kb is so limiting)

Any ideas on how to reduce the size without reducing the macro's and stuff?

For example, I stumbled onto a related discussion on QMK, the solution in that case was to disable a feature, I wonder if there are such features on TMK that I can disable

You can disable functions to comment out these lines in Makefile.
https://github.com/tmk/tmk_keyboard/blob/master/converter/usb_usb/Makefile#L93-L97

Where is the "related discussion on QMK" ? I'm intrested in how different in QMK.
Title: Re: USB to USB keyboard converter
Post by: KHAANNN on Sat, 03 March 2018, 06:04:25
It was this issue: https://github.com/qmk/qmk_firmware/issues/922

And sorry I missed those flags in Makefile, I looked at the Makefile for the flags, but somehow missed them, thought they were deprecated

#MOUSEKEY_ENABLE ?= yes   # Mouse keys
EXTRAKEY_ENABLE ?= yes   # Media control and System control
#CONSOLE_ENABLE ?= yes   # Console for debug
#COMMAND_ENABLE ?= yes    # Commands for debug and configuration
#NKRO_ENABLE ?= yes   # USB Nkey Rollover


It reduced the .hex from 81kb to 63kb - haven't tried flashing it yet, but very promising so far

Mouse keys are pretty cool, but apart from being cool, never used anyway

By the way, as a bit of side info for anyone, I tried using https://github.com/luizribeiro/tmk_keyboard/tree/ps2avrGB/keyboard/ps2avrGB directly on my FaceW PCB, however, "wait_ms() / _delay_ms" doesn't work with VUSB well, they are erratic and awkward - I have a lot of custom code on my TMK (thanks to you hasu: https://github.com/tmk/tmk_keyboard/issues/233)

And long story short, I just couldn't reproduce what I have with the usb-usb converter using the direct port, tho it was pretty cool using TMK directly on the PCB, without assistance, it works awesomely if you don't use delays (the answer isn't crucial, but I do wonder why delays work on one setup and not in the another, I'm guessing, since these MCU's have built-in USB routines, maybe they handle delays on that level, and not sever the USB communication during delays?)
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 04 March 2018, 17:34:32
This is not related to USB to USB converter, I'd mention this just to prevent other users from beeing confused.

[OFF TOPIC]
By the way, as a bit of side info for anyone, I tried using https://github.com/luizribeiro/tmk_keyboard/tree/ps2avrGB/keyboard/ps2avrGB directly on my FaceW PCB, however, "wait_ms() / _delay_ms" doesn't work with VUSB well, they are erratic and awkward - I have a lot of custom code on my TMK (thanks to you hasu: https://github.com/tmk/tmk_keyboard/issues/233)

And long story short, I just couldn't reproduce what I have with the usb-usb converter using the direct port, tho it was pretty cool using TMK directly on the PCB, without assistance, it works awesomely if you don't use delays (the answer isn't crucial, but I do wonder why delays work on one setup and not in the another, I'm guessing, since these MCU's have built-in USB routines, maybe they handle delays on that level, and not sever the USB communication during delays?)

I think your guess are right, V-USB implements USB communication completely by firmware while popular ATMega32u4 has hardware USB engine. You can break V-USB black magic easily with interefrence of its activity.

WIth V-USB you have to call usbPoll() repeatedly in short interval to do housekeeping task, your delay code could broke this rule probably.
https://github.com/obdev/v-usb/blob/master/usbdrv/usbdrv.h#L199-L205

I guess you can call the function intermittently during the delay to avoid that situation.

[/OFF TOPIC]
Title: Re: USB to USB keyboard converter
Post by: senso on Thu, 08 March 2018, 10:03:59
Why is the firmware so big?

I made a Lora to Ethernet concentrator on an atmega, with logging to flash memory, reading a couple more i2c sensors, a configuration console and it was right around the 30KB build size, that is with float printf in there, that alone eats 4KB, but this is "just" a keyboard, read row/column matrix, pass it through matrix to decode keypressed, I dont think that LUFA/PJRC USB code is THAT big.

Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 08 March 2018, 18:00:03
Why is the firmware so big?

I made a Lora to Ethernet concentrator on an atmega, with logging to flash memory, reading a couple more i2c sensors, a configuration console and it was right around the 30KB build size, that is with float printf in there, that alone eats 4KB, but this is "just" a keyboard, read row/column matrix, pass it through matrix to decode keypressed, I dont think that LUFA/PJRC USB code is THAT big.



I have no clear idea about how each module consumes flash space. Though, main diffrence from normal keyboard firmware is that the converter have to handle USB keyboard intput instead of matrix scan. It uses "USB Host Library for Arduino" to support USB keyboard input, which is not trivial job comparing to normal switch matrix scan, it can be primary culprit. But not that other parts of my firmware are implemented concise and clean, there must be room to improve everywhere.
https://github.com/felis/USB_Host_Shield_2.0
Title: Re: USB to USB keyboard converter
Post by: Blaise170 on Thu, 08 March 2018, 18:14:43
Would this work well for converting a USB board from PC-compatible to Macintosh compatible? I took a USB board into work but it doesn't work at all on my MBP. Types complete gibberish even when I try to change keyboard layouts.
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 08 March 2018, 18:43:39
Would this work well for converting a USB board from PC-compatible to Macintosh compatible? I took a USB board into work but it doesn't work at all on my MBP. Types complete gibberish even when I try to change keyboard layouts.

Hmm, I think this convert won't fix such keyboard with broken controller.  What is the keyboard actually?
Title: Re: USB to USB keyboard converter
Post by: Blaise170 on Thu, 08 March 2018, 19:05:51
Would this work well for converting a USB board from PC-compatible to Macintosh compatible? I took a USB board into work but it doesn't work at all on my MBP. Types complete gibberish even when I try to change keyboard layouts.

Hmm, I think this convert won't fix such keyboard with broken controller.  What is the keyboard actually?

GAMDIAS Hermes GKB2010

P.S. I don't know why, but your avatar causes my browser to keep refreshing over and over again.   :-X
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 08 March 2018, 19:27:47
Would this work well for converting a USB board from PC-compatible to Macintosh compatible? I took a USB board into work but it doesn't work at all on my MBP. Types complete gibberish even when I try to change keyboard layouts.

Hmm, I think this convert won't fix such keyboard with broken controller.  What is the keyboard actually?

GAMDIAS Hermes GKB2010

P.S. I don't know why, but your avatar causes my browser to keep refreshing over and over again.   :-X

ha, nice keyboard, I'm not sure you are really want to use it or just curious :D

It seems Mac doesn't like Its NKRO, I guess the keyboard uses tricky report descriptor Mac can't handle.
Try the keyboard on BIOS/UEFI setup  screen, this shows whether it works well in 6KRO mode. If it works,  the converter should handle it in 6KRO mode and works with Mac.
Title: Re: USB to USB keyboard converter
Post by: Blaise170 on Fri, 09 March 2018, 01:07:01
Haha both a serious and non-serious question. I am curious if it would work, but not sure I want to spend the time or money on it when I've already got a working keyboard at work.  :))
Title: Re: USB to USB keyboard converter
Post by: njbair on Thu, 05 April 2018, 13:01:24
I can't get any debug printing to work from matrix_init(). I've tried using print() and dprint() to no effect. When I plug in the board this is what I get from hid_listen:

Code: [Select]
Listening:
host.Task: 4070
usb_state: 90
speed: full
LED: 01

So debug output seems to be enabled, it's just not working from within matrix_init().

What I'm really trying to do is figure out if/why my hook_early_init() and hook_late_init() are not working as expected.

Can anyone point me in the right direction?
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 05 April 2018, 17:13:11
It won't print until console output is initialized and get ready.

ah, those hook functions are not suppored in USB-USB converter yet because the converter uses different startup code than other ones. You will have to add call of the hooks in main.cpp for USB-USB converter.

Check this code for how to add hooks, for example.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/protocol/lufa/lufa.c#L641


EDIT: Added new issue for this on github.
Title: Re: USB to USB keyboard converter
Post by: beamingrobot on Sun, 08 April 2018, 07:39:28
Has anyone used this with an OTD board? I'm asking because Mac OS refuses to recognise my 356mini but my Koala works. Would love to get the mini working, if not it's quite useless for me :(
Title: Re: USB to USB keyboard converter
Post by: njbair on Tue, 10 April 2018, 08:26:37
It won't print until console output is initialized and get ready.

ah, those hook functions are not suppored in USB-USB converter yet because the converter uses different startup code than other ones. You will have to add call of the hooks in main.cpp for USB-USB converter.

Check this code for how to add hooks, for example.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/protocol/lufa/lufa.c#L641


EDIT: Added new issue for this on github.

Thanks, hasu. At least I know I'm not crazy.

I'm going to take a crack at that issue on GitHub and see if I can get it working based on the other working configurations. I probably don't know enough about the protocols to implement all the hooks, but I believe I can get hook_early_init() and hook_late_init() working, at least.
Title: Re: USB to USB keyboard converter
Post by: hernick on Thu, 12 April 2018, 15:50:27
So I made my own USB2USB converter and it worked great on the first try! I was a little worried because the tiny MAX3421 is a pain to solder, I bent a few spare pins, and I had pad wetting issues - I think my flux is getting old, and SnBiAg solder doesn't wet that well to begin with. Anyway, it doesn't look good, but it's everything I hoped for.

What I needed out of the USB2USB converter is to take a standard QWERTY keyboard and connect it to the atrocious Konica Minolta C552 copier, which, when set to french language, requires an AZERTY keyboard! Whoever developed that copier around 2010 somehow didn't realise that there are more keyboard layouts than AZERTY, and that maybe hardcoding keyboard layouts by UI language isn't such a good idea... Here in Québec, we use QWERTY and we speak french. So, I'm using TMK to transcode QWERTY to AZERTY. What a pain!

I used the LinDon Tech 68 key mechanical keyboard, which is NKRO but I can confirm it works perfectly with TMK. Very nice compact mechanical keyboard.

Here is my QWERTY to AZERTY keymap: https://goo.gl/zz2DUx

The BOM on github seemed a little out of date, so I subbed the 18pF caps with 10pF as indicated on the latest board revision, and I couldn't source the ALPS switch so I used CKN10502CT-ND instead.

Anyway, thanks a lot to hasu who made this project possible! Great work
Title: Re: USB to USB keyboard converter
Post by: MandrewDavis on Sun, 22 April 2018, 14:29:56
Did this a while ago (with zero issues) but forgot to post, please excuse the shoddy picture.

(https://i.imgur.com/uYGbsaU.jpg)

A little while after receiving the USB-USB converter and using it with my Realforce 87u, I realized it how much I would prefer an internal converter. Turns out, once you de-solder the connectors it fits perfectly between the top housing and RF PCB near the top-right corner. As you can see it was completely reversible and just acts as a go-between. 

The part numbers are as follows:
Male JST EH series connector: B4B-EH-A
Female JST EH series connector: EHR-4
6" JST stranded precrimped wires: ASEHSEH22K152 (2 and 12 inch lengths also available)

The colored solid wires in the picture are just soldered on the terminal connectors and heatshrinked.
I would create a barrier between the converter and RF PCB but you get the wire lengths right, it will sit without the need for adhesive.
Title: Re: USB to USB keyboard converter
Post by: billm on Sun, 20 May 2018, 00:40:58
Damn. My new ace pad tech hall effect board appears to be unsupported. I'm just now getting into programmable boards so I actually don't know much about it. I've heard the terms "SoNiX" and "Cortex M0" in relation to the controller, but I don't know much else about it.

Stupid me, I just assumed that all usb keyboards sent the same codes. It's also LED backlit like some of the other unsupported devices. No NKRO according to what little documentation is provided.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 20 May 2018, 17:52:31
Thanks for feedback.
Do you have a link to manufacturer's product page and the documentation? It would be appriciated. I couldn't useful info for the device with my quick search.

This will be addred to 'Incompatible Keyboards' in the first post.
Title: Re: USB to USB keyboard converter
Post by: billm on Mon, 21 May 2018, 11:56:59
http://www.ace-pad-tech.com/pd.jsp?id=188#_pp=2_2
I believe this is the OEM version of the 61 key XMIT hall effect keyboard here:

http://www.xmitkeyboards.com/wp-content/uploads/2016/11/XMIT-Keyboards-Manual-Letter.pdf

"The keyboard is built   around the SoNiXSN32F240/230/220 Series 32-Bit Cortex-M0 microcontroller" says the doc above.

http://www.sonix.com.tw/category-en-947

According to the Chyros review here, the board doesn't support NKRO, but he seems to be claiming that it supports more than 6KRO:
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 21 May 2018, 18:58:58
Thank you for the infos!
Title: Re: USB to USB keyboard converter
Post by: Giorgio on Tue, 22 May 2018, 14:41:13
How do I use the magic combos? Are they supposed to work in a terminal?
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 23 May 2018, 14:23:23
How do I use the magic combos? Are they supposed to work in a terminal?


In firmware of this converter in Keymap Editor the magic command is disabled deu to firmware size and precaution against accidental misuse. You have to build firmware with enabling it by a line below in Makefile. The commands require flash size quite a bit you will have to disable other features like MOUSEKEY or EXTRAKEY.

Code: [Select]
COMMAND_ENABLE ?= yes

yes, hid_listen on terminal is useful to try the magic commands.
Title: Re: USB to USB keyboard converter
Post by: Mr_BeastQuake on Thu, 24 May 2018, 21:15:58
I seem to be having a large amount of trouble using the "easy method". I've used Hasu controllers before and just can't remember the steps.

1) I design keymap on keymap editor, download and save.

2) Upload. . . how do I load the keymap? Unplug, press and hold then plug in, load keymap? Click load keymap and should be good? Load keymap and restart?


**Nevermind**

1) Make layout and download .hex (save as .hex file)
2) Install Flip
3) Press button on converter
4) Open Flip> Select > ATmega32u4
5) Select a communication medium (USB cord icon)
6) Load hex file (arrow down on book icon)
7) Run
8) Unplug and replug and presto.
Title: Re: USB to USB keyboard converter
Post by: rigdeback on Wed, 13 June 2018, 05:59:06
Anyone tested the USB2USB adapter with Matias Ergo Pro (PC-version)?
Title: Re: USB to USB keyboard converter
Post by: MandrewDavis on Wed, 13 June 2018, 12:43:16
I seem to be having a large amount of trouble using the "easy method". I've used Hasu controllers before and just can't remember the steps.

1) I design keymap on keymap editor, download and save.

2) Upload. . . how do I load the keymap? Unplug, press and hold then plug in, load keymap? Click load keymap and should be good? Load keymap and restart?


**Nevermind**

1) Make layout and download .hex (save as .hex file)
2) Install Flip
3) Press button on converter
4) Open Flip> Select > ATmega32u4
5) Select a communication medium (USB cord icon)
6) Load hex file (arrow down on book icon)
7) Run
8) Unplug and replug and presto.

I did that for a while but found that downloading dfu-programmer and creating a .bat file is MUCH easier. Here is my code:

Code: [Select]
cd C:\tmk_keyboard\dfu-programmer-win-0.7.2

dfu-programmer.exe atmega32u4 erase --force

dfu-programmer.exe atmega32u4 flash C:\tmk_keyboard\converter\usb_usb\usb_usb.hex

dfu-programmer.exe atmega32u4 reset

This way, all you have to do is compile the .hex and run the .bat file.
Title: Re: USB to USB keyboard converter
Post by: rigdeback on Fri, 15 June 2018, 00:55:16
Anyone tested the USB2USB adapter with Matias Ergo Pro (PC-version)?

Some more information:
Code: [Select]
Linux detection:
Jun 15 07:43:33 esb kernel: [344699.266660] hid-generic 0003:1111:1111.001A: input,hidraw0: USB HID v1.00 Device [Matias Ergo Pro Keyboard] on usb-0000:00:14.0-2.3/input1
Jun 15 07:43:33 esb kernel: [344699.268796] input: Matias Ergo Pro Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.3/1-2.3:1.0/0003:1111:1111.001B/input/input58
Jun 15 07:43:33 esb kernel: [344699.326856] hid-generic 0003:1111:1111.001B: input,hidraw1: USB HID v1.00 Keyboard [Matias Ergo Pro Keyboard] on usb-0000:00:14.0-2.3/input0

lsusb:
Bus 001 Device 024: ID 1111:1111 Pandora International Ltd.
Bus 001 Device 023: ID 05e3:0614 Genesys Logic, Inc.

(The keyboard has a USB hub, I think that is the Genesys part)

sudo usbhid-dump -a 001:024 |grep -v : | xxd -r -p | hidrd-convert -o spec:

Usage Page (Consumer),                  ; Consumer (0Ch)
Usage (Consumer Control),               ; Consumer control (01h, application collection)
Collection (Application),
    Report ID (1),
    Logical Minimum (0),
    Logical Maximum (1),
    Report Size (1),
    Report Count (20),
    Usage (Scan Next Track),            ; Scan next track (B5h, one-shot control)
    Usage (Scan Previous Track),        ; Scan previous track (B6h, one-shot control)
    Usage (Stop),                       ; Stop (B7h, one-shot control)
    Usage (Play Pause),                 ; Play/pause (CDh, one-shot control)
    Usage (Mute),                       ; Mute (E2h, on/off control)
    Usage (Volume Inc),                 ; Volume increment (E9h, re-trigger control)
    Usage (Volume Dec),                 ; Volume decrement (EAh, re-trigger control)
    Usage (AL Consumer Control Config), ; AL consumer control configuration (0183h, selector)
    Usage (AL Email Reader),            ; AL email reader (018Ah, selector)
    Usage (AL Calculator),              ; AL calculator (0192h, selector)
    Usage (AL Local Machine Brwsr),     ; AL local machine browser (0194h, selector)
    Usage (AC Search),                  ; AC search (0221h, selector)
    Usage (AC Home),                    ; AC home (0223h, selector)
    Usage (AC Back),                    ; AC back (0224h, selector)
    Usage (AC Forward),                 ; AC forward (0225h, selector)
    Usage (AC Stop),                    ; AC stop (0226h, selector)
    Usage (AC Refresh),                 ; AC refresh (0227h, selector)
    Usage (AC Bookmarks),               ; AC bookmarks (022Ah, selector)
    Usage (AL Screen Saver),            ; AL screen saver (01B1h, selector)
    Usage (Eject),                      ; Eject (B8h, one-shot control)
    Input (Variable),
    Report Count (4),
    Input (Constant),
End Collection,
Usage Page (Desktop),                   ; Generic desktop controls (01h)
Usage (Sys Control),                    ; System control (80h, application collection)
Collection (Application),
    Report ID (2),
    Usage Page (Desktop),               ; Generic desktop controls (01h)
    Usage Minimum (Sys Power Down),     ; System power down (81h, one-shot control)
    Usage Maximum (Sys Wake Up),        ; System wake up (83h, one-shot control)
    Logical Minimum (0),
    Logical Maximum (1),
    Report Count (3),
    Report Size (1),
    Input (Variable, Relative),
    Report Count (1),
    Report Size (5),
    Input (Constant),
End Collection,
Usage Page (Desktop),                   ; Generic desktop controls (01h)
Usage (Keyboard),                       ; Keyboard (06h, application collection)
Collection (Application),
    Usage Page (Keyboard),              ; Keyboard/keypad (07h)
    Usage Minimum (KB Leftcontrol),     ; Keyboard left control (E0h, dynamic value)
    Usage Maximum (KB Right GUI),       ; Keyboard right GUI (E7h, dynamic value)
    Logical Minimum (0),
    Logical Maximum (1),
    Report Size (1),
    Report Count (8),
    Input (Variable),
    Usage Page (LED),                   ; LEDs (08h)
    Report Size (8),
    Report Count (1),
    Input (Constant),
    Usage Minimum (01h),
    Usage Maximum (05h),
    Report Size (1),
    Report Count (5),
    Output (Variable),
    Report Size (3),
    Report Count (1),
    Output (Constant),
    Usage Page (Keyboard),              ; Keyboard/keypad (07h)
    Logical Minimum (0),
    Logical Maximum (255),
    Usage Minimum (None),               ; No event (00h, selector)
    Usage Maximum (FFh),
    Report Size (8),
    Report Count (12),
    Input,
    Usage Page (FFh),                   ; FFh, reserved
    Usage (03h),
    Report Size (8),
    Report Count (1),
    Input (Variable),
    Usage Page (FFh),                   ; FFh, reserved
    Usage (00h),
    Logical Minimum (-128),
    Logical Maximum (127),
    Report Size (8),
    Report Count (8),
    Feature (Variable),
End Collection

Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 15 June 2018, 03:21:00
Anyone tested the USB2USB adapter with Matias Ergo Pro (PC-version)?

Some more information:
Code: [Select]
Linux detection:
Jun 15 07:43:33 esb kernel: [344699.266660] hid-generic 0003:1111:1111.001A: input,hidraw0: USB HID v1.00 Device [Matias Ergo Pro Keyboard] on usb-0000:00:14.0-2.3/input1
Jun 15 07:43:33 esb kernel: [344699.268796] input: Matias Ergo Pro Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.3/1-2.3:1.0/0003:1111:1111.001B/input/input58
Jun 15 07:43:33 esb kernel: [344699.326856] hid-generic 0003:1111:1111.001B: input,hidraw1: USB HID v1.00 Keyboard [Matias Ergo Pro Keyboard] on usb-0000:00:14.0-2.3/input0

lsusb:
Bus 001 Device 024: ID 1111:1111 Pandora International Ltd.
Bus 001 Device 023: ID 05e3:0614 Genesys Logic, Inc.

(The keyboard has a USB hub, I think that is the Genesys part)

sudo usbhid-dump -a 001:024 |grep -v : | xxd -r -p | hidrd-convert -o spec:

Usage Page (Consumer),                  ; Consumer (0Ch)
Usage (Consumer Control),               ; Consumer control (01h, application collection)
Collection (Application),
    Report ID (1),
    Logical Minimum (0),
    Logical Maximum (1),
    Report Size (1),
    Report Count (20),
    Usage (Scan Next Track),            ; Scan next track (B5h, one-shot control)
    Usage (Scan Previous Track),        ; Scan previous track (B6h, one-shot control)
    Usage (Stop),                       ; Stop (B7h, one-shot control)
    Usage (Play Pause),                 ; Play/pause (CDh, one-shot control)
    Usage (Mute),                       ; Mute (E2h, on/off control)
    Usage (Volume Inc),                 ; Volume increment (E9h, re-trigger control)
    Usage (Volume Dec),                 ; Volume decrement (EAh, re-trigger control)
    Usage (AL Consumer Control Config), ; AL consumer control configuration (0183h, selector)
    Usage (AL Email Reader),            ; AL email reader (018Ah, selector)
    Usage (AL Calculator),              ; AL calculator (0192h, selector)
    Usage (AL Local Machine Brwsr),     ; AL local machine browser (0194h, selector)
    Usage (AC Search),                  ; AC search (0221h, selector)
    Usage (AC Home),                    ; AC home (0223h, selector)
    Usage (AC Back),                    ; AC back (0224h, selector)
    Usage (AC Forward),                 ; AC forward (0225h, selector)
    Usage (AC Stop),                    ; AC stop (0226h, selector)
    Usage (AC Refresh),                 ; AC refresh (0227h, selector)
    Usage (AC Bookmarks),               ; AC bookmarks (022Ah, selector)
    Usage (AL Screen Saver),            ; AL screen saver (01B1h, selector)
    Usage (Eject),                      ; Eject (B8h, one-shot control)
    Input (Variable),
    Report Count (4),
    Input (Constant),
End Collection,
Usage Page (Desktop),                   ; Generic desktop controls (01h)
Usage (Sys Control),                    ; System control (80h, application collection)
Collection (Application),
    Report ID (2),
    Usage Page (Desktop),               ; Generic desktop controls (01h)
    Usage Minimum (Sys Power Down),     ; System power down (81h, one-shot control)
    Usage Maximum (Sys Wake Up),        ; System wake up (83h, one-shot control)
    Logical Minimum (0),
    Logical Maximum (1),
    Report Count (3),
    Report Size (1),
    Input (Variable, Relative),
    Report Count (1),
    Report Size (5),
    Input (Constant),
End Collection,
Usage Page (Desktop),                   ; Generic desktop controls (01h)
Usage (Keyboard),                       ; Keyboard (06h, application collection)
Collection (Application),
    Usage Page (Keyboard),              ; Keyboard/keypad (07h)
    Usage Minimum (KB Leftcontrol),     ; Keyboard left control (E0h, dynamic value)
    Usage Maximum (KB Right GUI),       ; Keyboard right GUI (E7h, dynamic value)
    Logical Minimum (0),
    Logical Maximum (1),
    Report Size (1),
    Report Count (8),
    Input (Variable),
    Usage Page (LED),                   ; LEDs (08h)
    Report Size (8),
    Report Count (1),
    Input (Constant),
    Usage Minimum (01h),
    Usage Maximum (05h),
    Report Size (1),
    Report Count (5),
    Output (Variable),
    Report Size (3),
    Report Count (1),
    Output (Constant),
    Usage Page (Keyboard),              ; Keyboard/keypad (07h)
    Logical Minimum (0),
    Logical Maximum (255),
    Usage Minimum (None),               ; No event (00h, selector)
    Usage Maximum (FFh),
    Report Size (8),
    Report Count (12),
    Input,
    Usage Page (FFh),                   ; FFh, reserved
    Usage (03h),
    Report Size (8),
    Report Count (1),
    Input (Variable),
    Usage Page (FFh),                   ; FFh, reserved
    Usage (00h),
    Logical Minimum (-128),
    Logical Maximum (127),
    Report Size (8),
    Report Count (8),
    Feature (Variable),
End Collection


I don't have the keyboard but it looks like it has N-key rollover, media keys and vendor specific reports. Note that those funcy features aren't  supported by the covnerter as its 'Limitations' described in the first post. It supports only 6KRO mode.

If the keyobard works well with BIOS or UEFI(try with reboot, cold boot and replug), it means it has proper 6KRO mode implementation. In this case you can speculate the converter is likely to work with the keyboard.

Title: Re: USB to USB keyboard converter
Post by: Harima on Sun, 24 June 2018, 23:49:51
@hasu

Hi. I'm trying to make a new keymap for this keyboard

(https://i.imgur.com/JKjDjKz.jpg)

I'm confused as how to go about mapping the left side. They give the same keycodes as the regular keys, for example WASD on the left cluster give the same keycodes as WASD in the rows and columns. Do I enter them twice or do I just ignore that cluster and map the right side? Can I have the clusters of keys differentiate from the rows and columns keys even though they give the same keycodes?

Thanks in advance.
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 25 June 2018, 00:19:26
If those keys in the left cluster spit out keycodes of WASD, they are indentical to WASD keys. You can't differentiate them from WASD keys.

EDIT: oops, the pic are showed correctly now.
EDIT2: No. something wrong still seems to happen with imgur :(

For those who can't see the pic above, this is one Harima posted.
(http://i.imgur.com/JKjDjKz.jpg)

Folow this link when the pic isn't loaded: http://i.imgur.com/JKjDjKz.jpg
Title: Re: USB to USB keyboard converter
Post by: Blaise170 on Mon, 25 June 2018, 08:22:00
Harima's image makes my browser refresh and I can't see yours at all Hasu.
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 26 June 2018, 19:50:20
Harima's image makes my browser refresh and I can't see yours at all Hasu.

imgur may changed something or their policy of TOS about embeding images.
https://geekhack.org/index.php?topic=33106.msg2628263#msg2628263
Title: Re: USB to USB keyboard converter
Post by: Giorgio on Wed, 27 June 2018, 08:23:25
Is it possible that when typing very fast, the keyboard sends some random codes like ctrl-l and ctrl-f (^l and ^f). I'm sure that I don't accidentally press other keys. The keyboard is a cherry g80-3000, and this fact has been recorded on vim, but happens mostly on the browser, where I can't log the output of the keybard, but I register some accidental events.
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 27 June 2018, 18:15:53
Is it possible that when typing very fast, the keyboard sends some random codes like ctrl-l and ctrl-f (^l and ^f). I'm sure that I don't accidentally press other keys. The keyboard is a cherry g80-3000, and this fact has been recorded on vim, but happens mostly on the browser, where I can't log the output of the keybard, but I register some accidental events.

Unfortunately the keyobard seems to have crappy firmware :( Do you see the behaviour without converter?
See this thread for more info.
https://deskthority.net/keyboards-f2/cherry-g80-3000-broke-down-t17899.html
https://deskthority.net/keyboards-f2/cherry-usb-controller-problems-visible-in-linux-and-macos-t17938.html
Title: Re: USB to USB keyboard converter
Post by: Giorgio on Thu, 28 June 2018, 02:53:15
Is it possible that when typing very fast, the keyboard sends some random codes like ctrl-l and ctrl-f (^l and ^f). I'm sure that I don't accidentally press other keys. The keyboard is a cherry g80-3000, and this fact has been recorded on vim, but happens mostly on the browser, where I can't log the output of the keybard, but I register some accidental events.

Unfortunately the keyobard seems to have crappy firmware :( Do you see the behaviour without converter?
See this thread for more info.
https://deskthority.net/keyboards-f2/cherry-g80-3000-broke-down-t17899.html
https://deskthority.net/keyboards-f2/cherry-usb-controller-problems-visible-in-linux-and-macos-t17938.html

That's really unfortunate. Please add the g80-3000 to the list of incompatible keyboards.

Will the g80-1800 have the same incompatibility? What about the g80-8000? Thanks in advance.

I don't see the behaviour without the converter; I've tried to press the keys as specified on your links with no advers effect. I've got windows 10.

Is the usb g80-8000 compatible with the usb_usb converter?

It seems that there are nkro and not nkro versions
"Make sure it's the PS/2 version. The USB version doesn't have NKRO and the macros are all software instead of hardware."
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 28 June 2018, 10:39:21
Is it possible that when typing very fast, the keyboard sends some random codes like ctrl-l and ctrl-f (^l and ^f). I'm sure that I don't accidentally press other keys. The keyboard is a cherry g80-3000, and this fact has been recorded on vim, but happens mostly on the browser, where I can't log the output of the keybard, but I register some accidental events.

Unfortunately the keyobard seems to have crappy firmware :( Do you see the behaviour without converter?
See this thread for more info.
https://deskthority.net/keyboards-f2/cherry-g80-3000-broke-down-t17899.html
https://deskthority.net/keyboards-f2/cherry-usb-controller-problems-visible-in-linux-and-macos-t17938.html

That's really unfortunate. Please add the g80-3000 to the list of incompatible keyboards.

Will the g80-1800 have the same incompatibility? What about the g80-8000? Thanks in advance.

I don't see the behaviour without the converter; I've tried to press the keys as specified on your links with no advers effect. I've got windows 10.

Is the usb g80-8000 compatible with the usb_usb converter?

It seems that there are nkro and not nkro versions
"Make sure it's the PS/2 version. The USB version doesn't have NKRO and the macros are all software instead of hardware."

Not sure but those keyboards may have same issue because they doesn't seem to have plan to fix firmware for this. Perhaps you had better avoid those keyboard unless you already own them.
https://deskthority.net/keyboards-f2/cherry-usb-controller-problems-visible-in-linux-and-macos-t17938.html#p413367

It seems the G80-3000 works on Windows but not on Mac and Linux as the thead indicates, I guess WIndows manage to handle the issue in some way.
https://deskthority.net/keyboards-f2/cherry-g80-3000-broke-down-t17899.html#p395088
Title: Re: USB to USB keyboard converter
Post by: Giorgio on Fri, 29 June 2018, 06:37:00
Is it possible that when typing very fast, the keyboard sends some random codes like ctrl-l and ctrl-f (^l and ^f). I'm sure that I don't accidentally press other keys. The keyboard is a cherry g80-3000, and this fact has been recorded on vim, but happens mostly on the browser, where I can't log the output of the keybard, but I register some accidental events.

Unfortunately the keyobard seems to have crappy firmware :( Do you see the behaviour without converter?
See this thread for more info.
https://deskthority.net/keyboards-f2/cherry-g80-3000-broke-down-t17899.html
https://deskthority.net/keyboards-f2/cherry-usb-controller-problems-visible-in-linux-and-macos-t17938.html

That's really unfortunate. Please add the g80-3000 to the list of incompatible keyboards.

Will the g80-1800 have the same incompatibility? What about the g80-8000? Thanks in advance.

I don't see the behaviour without the converter; I've tried to press the keys as specified on your links with no advers effect. I've got windows 10.

Is the usb g80-8000 compatible with the usb_usb converter?

It seems that there are nkro and not nkro versions
"Make sure it's the PS/2 version. The USB version doesn't have NKRO and the macros are all software instead of hardware."

Not sure but those keyboards may have same issue because they doesn't seem to have plan to fix firmware for this. Perhaps you had better avoid those keyboard unless you already own them.
https://deskthority.net/keyboards-f2/cherry-usb-controller-problems-visible-in-linux-and-macos-t17938.html#p413367

It seems the G80-3000 works on Windows but not on Mac and Linux as the thead indicates, I guess WIndows manage to handle the issue in some way.
https://deskthority.net/keyboards-f2/cherry-g80-3000-broke-down-t17899.html#p395088

I've found out that g80-8000 and g80-8040 are 6kro; this means that they work with the converter?
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 29 June 2018, 08:49:09
I think so. You can expect it will work at least until 7th key are pressed.

EDIT: but I don't think it is safe idea to buy the Cherry USB keyboard newly.
Title: Re: USB to USB keyboard converter
Post by: AdrianMan on Sat, 30 June 2018, 09:35:03
Hello !

Is this compatible with Leopold FC750R PD TKL ?

I would love to make it programmable somehow :) (I would like to put the converter inside the case)

Thanks !
Title: Re: USB to USB keyboard converter
Post by: Harima on Mon, 02 July 2018, 23:30:46
Sorry, late reply. Thank you for the info on my keyboard hasu. Now I have something else come up.

Code: [Select]
--output usb_usb.elf -Wl,-Map=usb_usb.map,--cref -Wl,--gc-sections     -lm
obj_usb_usb/common/keymap.o: In function `keymap_fn_to_action':
C:\tmk_keyboard\converter\usb_usb/../../tmk_core/common/keymap.c:246: undefined reference to `fn_actions'
C:\tmk_keyboard\converter\usb_usb/../../tmk_core/common/keymap.c:246: undefined reference to `fn_actions'
collect2.exe: error: ld returned 1 exit status
make: *** [../../tmk_core/rules.mk:552: usb_usb.elf] Error 1

Everything is pretty much default except keymap_common.h and keymap.c

keymap.c
Code: [Select]
#include "action_layer.h "
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* 0: Foot Pedal */
    KEYMAP_ALL(
                LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT,
    LALT,       LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT,           LALT, LALT, LALT,       LALT, LALT, LALT, LALT,  LALT,
    LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT,     LALT, LALT, LALT,       LALT, LALT, LALT, LALT,  LALT, LALT,
    LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT,       LALT,     LALT, LALT, LALT,       LALT, LALT, LALT, LALT,  LALT, LALT,
    LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT,       LALT, LALT,                             LALT, LALT, LALT, LALT,  LALT, LALT,
    LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT,       LALT, LALT,           LALT,             LALT, LALT, LALT, LALT,  LALT, LALT,
    LALT, LALT, LALT, LALT, LALT,       LALT,       LALT, LALT, LALT, LALT, LALT, LALT, LALT,      LALT,LALT,LALT,        LALT,       LALT, LALT,  LALT, LALT),         
};

keymap_common.h
Code: [Select]
/*
Copyright 2014 Jun Wako <wakojun@gmail.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KEYMAP_COMMON_H
#define KEYMAP_COMMON_H

#include <stdint.h>
#include <stdbool.h>
#include "keycode.h"
#include "action.h"
#include "action_macro.h"
#include "report.h"
#include "print.h"
#include "debug.h"
#include "keymap.h"


/*         ,---------------. ,---------------. ,---------------.
 *         |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| |PrS|ScL|Pau| |VDn|VUp|Mut|Pwr| | Help  |
 * `---'   `---------------' `---------------' `---------------' `-----------' `---------------' `-------'
 * ,-----------------------------------------------------------. ,-----------. ,---------------. ,-------.
 * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|JPY|Bsp| |Ins|Hom|PgU| |NmL|  /|  *|  -| |Stp|Agn|
 * |-----------------------------------------------------------| |-----------| |---------------| |-------|
 * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|  \  | |Del|End|PgD| |  7|  8|  9|  +| |Mnu|Und|
 * |-----------------------------------------------------------| `-----------' |---------------| |-------|
 * |CapsL |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  :|  #|Retn|               |  4|  5|  6|KP,| |Sel|Cpy|
 * |-----------------------------------------------------------|     ,---.     |---------------| |-------|
 * |Shft|  <|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /| RO|Shift |     |Up |     |  1|  2|  3|KP=| |Exe|Pst|
 * |-----------------------------------------------------------| ,-----------. |---------------| |-------|
 * |Ctl|Gui|Alt|MHEN|HNJ| Space  |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| |  0    |  .|Ent| |Fnd|Cut|
 * `-----------------------------------------------------------' `-----------' `---------------' `-------'
 *
 *
 * App:         Windows Menu key
 * Gui:         Windows key, Mac ⌘ key or Meta key
 *
 * Pwr:         Power for Unix and Mac
 * VDn,Vup,Mut: Volume control for Unix and Mac
 * Stp,Agn..:   for Unix
 *
 * KP,:         Brazilian Keypad Comma
 * KP=:         Keypad = for Mac
 * <,#:         ISO keys(UK legend)
 * JPY:         Japanese Yen(¥)
 * RO:          Japanese ろ or Brazilian /
 * MHEN:        Japanese 無変換 Non Conversion
 * HENK:        Japanese 変換 Conversion
 * KANA:        Japanese かな Hiragana/Katakana
 *              https://en.wikipedia.org/wiki/Keyboard_layout#Japanese
 * H/E:         Korean 한/영 Hangul/English
 * HNJ:         Korean 한자 Hanja
 *              https://en.wikipedia.org/wiki/Keyboard_layout#Hangul_.28for_Korean.29
 *
 * TODO: use same keycode to pass through instead of KC_NO?
 */
#define KEYMAP_ALL( \
            K68,K69,K6A,K6B,K6C,K6D,K6E,K6F,K70,K71,K72,K73,K9C,                                              \
    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,  K81,K80,K7F,K66, K75,     \
    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K89,K2A,  K49,K4A,K4B,  K53,K54,K55,K56, K78,K79, \
    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K31,  K4C,K4D,K4E,  K5F,K60,K61,K57, K76,K7A, \
    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,    K32,K28,                K5C,K5D,K5E,K85, K77,K7C, \
    KE1,K64,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,    K87,KE5,      K52,      K59,K5A,K5B,K67, K74,K7D, \
    KE0,KE3,KE2,K8B,K91,    K2C,    K90,K8A,K88,KE6,KE7,K65,KE4,  K50,K51,K4F,  K62,    K63,K58, K7E,K7B  \
) { \
    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_##K04, KC_##K05, KC_##K06, KC_##K07,   /* 00-07 */ \
      KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, /* 08-0F */ \
    { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17,   /* 10-17 */ \
      KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, /* 18-1F */ \
    { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27,   /* 20-27 */ \
      KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, /* 28-2F */ \
    { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37,   /* 30-37 */ \
      KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, /* 38-3F */ \
    { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47,   /* 40-47 */ \
      KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_##K4F }, /* 48-4F */ \
    { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57,   /* 50-57 */ \
      KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_##K5C, KC_##K5D, KC_##K5E, KC_##K5F }, /* 58-5F */ \
    { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67,   /* 60-67 */ \
      KC_##K68, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_##K6D, KC_##K6E, KC_##K6F }, /* 68-6F */ \
    { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77,   /* 70-77 */ \
      KC_##K78, KC_##K79, KC_##K7A, KC_##K7B, KC_##K7C, KC_##K7D, KC_##K7E, KC_##K7F }, /* 78-7F */ \
    { KC_##K80, KC_##K81, KC_NO,    KC_NO,    KC_NO,    KC_##K85, KC_NO,    KC_##K87,   /* 80-87 */ \
      KC_##K88, KC_##K89, KC_##K8A, KC_##K8B, KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* 88-8F */ \
    { KC_##K90, KC_##K91, KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,      /* 90-97 */ \
      KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_##K9C,    KC_NO,    KC_NO,    KC_NO    }, /* 98-9F */ \
    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,      /* A0-A7 */ \
      KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* A8-AF */ \
    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,      /* B0-B7 */ \
      KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* B8-BF */ \
    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,      /* C0-C7 */ \
      KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* C8-CF */ \
    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,      /* D0-D7 */ \
      KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* D8-DF */ \
    { KC_##KE0, KC_##KE1, KC_##KE2, KC_##KE3, KC_##KE4, KC_##KE5, KC_##KE6, KC_##KE7,   /* E0-E7 */ \
      KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* E8-EF */ \
    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,      /* F0-F7 */ \
      KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* F8-FF */ \
}

/* ,---.   ,---------------. ,---------------. ,---------------. ,-----------.
 * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
 * `---'   `---------------' `---------------' `---------------' `-----------'
 * ,-----------------------------------------------------------. ,-----------. ,---------------.
 * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|    Bsp| |Ins|Hom|PgU| |NmL|  /|  *|  -|
 * |-----------------------------------------------------------| |-----------| |---------------|
 * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|  \  | |Del|End|PgD| |  7|  8|  9|  +|
 * |-----------------------------------------------------------| `-----------' |-----------|   |
 * |CapsL |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|  Return|               |  4|  5|  6|  +|
 * |-----------------------------------------------------------|     ,---.     |---------------|
 * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift     |     |Up |     |  1|  2|  3|   |
 * |-----------------------------------------------------------| ,-----------. |-----------|   |
 * |Ctl|Gui|Alt|           Space               |Alt|Gui|App|Ctl| |Lef|Dow|Rig| |      0|  .|Ent|
 * `-----------------------------------------------------------' `-----------' `---------------'
 */
#define KEYMAP( \
    K29,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,                   \
    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K2A,  K49,K4A,K4B,  K53,K54,K55,K56, \
    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,K31,  K4C,K4D,K4E,  K5F,K60,K61,     \
    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,    K28,                K5C,K5D,K5E,K57, \
    KE1,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,        KE5,      K52,      K59,K5A,K5B,     \
    KE0,KE3,KE2,        K2C,                KE6,KE7,K65,KE4,  K50,K51,K4F,  K62,    K63,K58  \
) KEYMAP_ALL( \
            NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO,                                               \
    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,  NO, NO, NO, NO,  NO,      \
    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,NO, K2A,  K49,K4A,K4B,  K53,K54,K55,K56, NO, NO,  \
    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K31,  K4C,K4D,K4E,  K5F,K60,K61,K57, NO, NO,  \
    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,    NO, K28,                K5C,K5D,K5E,NO,  NO, NO,  \
    KE1,NO, K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,    NO, KE5,      K52,      K59,K5A,K5B,NO,  NO, NO,  \
    KE0,KE3,KE2,NO, NO,     K2C,    NO, NO, NO, KE6,KE7,K65,KE4,  K50,K51,K4F,  K62,    K63,K58, NO, NO   \
)

/* ,---.   ,---------------. ,---------------. ,---------------. ,-----------.
 * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
 * `---'   `---------------' `---------------' `---------------' `-----------'
 * ,-----------------------------------------------------------. ,-----------. ,---------------.
 * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|    Bsp| |Ins|Hom|PgU| |NmL|  /|  *|  -|
 * |-----------------------------------------------------------| |-----------| |---------------|
 * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]| Retn| |Del|End|PgD| |  7|  8|  9|  +|
 * |------------------------------------------------------`    | `-----------' |-----------|   |
 * |CapsL |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  :|  #|    |               |  4|  5|  6|   |
 * |-----------------------------------------------------------|     ,---.     |---------------|
 * |Shft|  <|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift     |     |Up |     |  1|  2|  3|Ent|
 * |-----------------------------------------------------------| ,-----------. |-----------|   |
 * |Ctl|Gui|Alt|           Space               |Alt|Gui|App|Ctl| |Lef|Dow|Rig| |      0|  .|   |
 * `-----------------------------------------------------------' `-----------' `---------------'
 */
#define KEYMAP_ISO( \
    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,  K46,K47,K48,                   \
    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K2A,  K49,K4A,K4B,  K53,K54,K55,K56, \
    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,K28,  K4C,K4D,K4E,  K5F,K60,K61,K57, \
    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,K32,                    K5C,K5D,K5E,     \
    KE1,K64,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,    KE5,      K52,      K59,K5A,K5B,K58, \
    KE0,KE3,KE2,        K2C,                KE6,KE7,K65,KE4,  K50,K51,K4F,  K62,    K63      \
) KEYMAP_ALL( \
            NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO,                                               \
    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,  NO, NO, NO, NO,  NO,      \
    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,NO, K2A,  K49,K4A,K4B,  K53,K54,K55,K56, NO, NO,  \
    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K32,  K4C,K4D,K4E,  K5F,K60,K61,K57, NO, NO,  \
    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,    K32,K28,                K5C,K5D,K5E,NO,  NO, NO,  \
    KE1,K64,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,    NO, KE5,      K52,      K59,K5A,K5B,NO,  NO, NO,  \
    KE0,KE3,KE2,NO, NO,     K2C,    NO, NO, NO, KE6,KE7,K65,KE4,  K50,K51,K4F,  K62,    K63,K58, NO, NO   \
)

/* ,---.   ,---------------. ,---------------. ,---------------. ,-----------.
 * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
 * `---'   `---------------' `---------------' `---------------' `-----------'
 * ,-----------------------------------------------------------. ,-----------. ,---------------.
 * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  ^|JPY|Bsp| |Ins|Hom|PgU| |NmL|  /|  *|  -|
 * |-----------------------------------------------------------| |-----------| |---------------|
 * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  @|  [| Retn| |Del|End|PgD| |  7|  8|  9|  +|
 * |------------------------------------------------------`    | `-----------' |-----------|   |
 * |CapsL |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  :|  ]|    |               |  4|  5|  6|   |
 * |-----------------------------------------------------------|     ,---.     |---------------|
 * |Shft    |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /| RO|Shift |     |Up |     |  1|  2|  3|Ent|
 * |-----------------------------------------------------------| ,-----------. |-----------|   |
 * |Ctl|Gui|Alt|MHEN|      Space      |HENK|KNA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| |      0|  .|   |
 * `-----------------------------------------------------------' `-----------' `---------------'
 */
#define KEYMAP_JIS( \
    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,                   \
    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K89,K2A,  K49,K4A,K4B,  K53,K54,K55,K56, \
    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K28,  K4C,K4D,K4E,  K5F,K60,K61,K57, \
    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,K32,                        K5C,K5D,K5E,     \
    KE1,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,        K87,KE5,      K52,      K59,K5A,K5B,K58, \
    KE0,KE3,KE2,K8B,    K2C,        K8A,K88,KE6,KE7,K65,KE4,      K50,K51,K4F,  K62,    K63      \
) KEYMAP_ALL( \
            NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO,                                               \
    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,  NO, NO, NO, NO,  NO,      \
    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K89,K2A,  K49,K4A,K4B,  K53,K54,K55,K56, NO, NO,  \
    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K32,  K4C,K4D,K4E,  K5F,K60,K61,K57, NO, NO,  \
    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,    K32,K28,                K5C,K5D,K5E,NO,  NO, NO,  \
    KE1,NO, K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,    K87,KE5,      K52,      K59,K5A,K5B,NO,  NO, NO,  \
    KE0,KE3,KE2,K8B,NO,     K2C,    NO, K8A,K88,KE6,KE7,K65,KE4,  K50,K51,K4F,  K62,    K63,K58, NO, NO   \
)

/* ,---.   ,---------------. ,---------------. ,---------------. ,-----------.
 * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
 * `---'   `---------------' `---------------' `---------------' `-----------'
 * ,-----------------------------------------------------------. ,-----------. ,---------------.
 * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  \|Bsp| |Ins|Hom|PgU| |NmL|  /|  *|  -|
 * |-----------------------------------------------------------| |-----------| |---------------|
 * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]| Retn| |Del|End|PgD| |  7|  8|  9|  +|
 * |------------------------------------------------------`    | `-----------' |-----------|   |
 * |CapsL |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|  |     |               |  4|  5|  6|   |
 * |-----------------------------------------------------------|     ,---.     |---------------|
 * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift     |     |Up |     |  1|  2|  3|   |
 * |-----------------------------------------------------------| ,-----------. |-----------|   |
 * |Ctl|Gui|Alt|           Space               |Alt|Gui|App|Ctl| |Lef|Dow|Rig| |      0|  .|   |
 * `-----------------------------------------------------------' `-----------' `---------------'
 */
#define KEYMAP_DSI( \
    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,                            \
    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K31,K2A,  K49,K4A,K4B,  K53,K54,K55,K56,          \
    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K28,  K4C,K4D,K4E,  K5F,K60,K61,K57,          \
    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,                            K5C,K5D,K5E,              \
    KE1,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,            KE5,      K52,      K59,K5A,K5B,K58,          \
    KE0,KE3,KE2,        K2C,                    KE6,KE7,K65,KE4,   K50,K51,K4F, K62,    K63               \
) KEYMAP_ALL( \
            NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO,                                               \
    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,  NO, NO, NO, NO,  NO,      \
    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K31,K2A,  K49,K4A,K4B,  K53,K54,K55,K56, NO, NO,  \
    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K31,  K4C,K4D,K4E,  K5F,K60,K61,K57, NO, NO,  \
    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, NO,    K28,                K5C,K5D,K5E,NO,  NO, NO,  \
    KE1,NO, K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, NO,    KE5,      K52,      K59,K5A,K5B,NO,  NO, NO,  \
    KE0,KE3,KE2,NO,NO,      K2C,       NO,NO,NO,KE6,KE7,K65,KE4,  K50,K51,K4F,  K62,    K63,K58, NO, NO   \
)

/*         ,---------------. ,---------------. ,---------------.
 *         |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| |PrS|ScL|Pau|
 * `---'   `---------------' `---------------' `---------------' `-----------'
 * ,-----------------------------------------------------------. ,-----------. ,---------------.
 * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|    Bsp| |Ins|Hom|PgU| |NmL|  /|  *|  -|
 * |-----------------------------------------------------------| |-----------| |---------------|
 * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]| Retn| |Del|End|PgD| |  7|  8|  9|  +|
 * |------------------------------------------------------`    | `-----------' |-----------|   |
 * |CapsL |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  :|  #|    |               |  4|  5|  6|   |
 * |-----------------------------------------------------------|     ,---.     |---------------|
 * |Shft|  <|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift     |     |Up |     |  1|  2|  3|Ent|
 * |-----------------------------------------------------------| ,-----------. |-----------|   |
 * |Ctl|Gui|Alt|           Space               |Alt|Gui|App|Ctl| |Lef|Dow|Rig| |      0|  .|   |
 * `-----------------------------------------------------------' `-----------' `---------------'
 */
#define KEYMAP_HERMES( \
            K68,K69,K6A,K6B,K6C,K6D,K6E,K6F,K70,K71,K72,K73,K9C,                                          \
    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,                            \
    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K2A,      K49,K4A,K4B,  K53,K54,K55,K56,          \
    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K31,  K4C,K4D,K4E,  K5F,K60,K61,K57,          \
    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,        K28,                K5C,K5D,K5E,              \
    KE1,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,            KE5,      K52,      K59,K5A,K5B,K58,          \
    KE0,KE3,KE2,            K2C,                    KE6,K65,KE4,  K50,K51,K4F,  K62,    K63               \
) KEYMAP_ALL( \
            K68,K69,K6A,K6B,K6C,K6D,K6E,K6F,K70,K71,K72,K73,K9C,                                          \
    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,  NO , NO, NO, NO,NO,       \
    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,NO, K2A,  K49,K4A,K4B,  K53,K54,K55,K56,NO,NO,    \
    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K31,  K4C,K4D,K4E,  K5F,K60,K61,K57,NO,NO,    \
    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, NO,    K28,                K5C,K5D,K5E, NO,NO,NO,    \
    KE1,NO,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,  NO,    KE5,      K52,      K59,K5A,K5B, NO,NO,NO,    \
    KE0,KE3,KE2,NO,NO,     K2C,         NO,NO,NO,KE6,NO,K65,KE4,  K50,K51,K4F,  K62,    K63,K58,NO,NO     \
)

/*         ,---------------. ,---------------. ,---------------.
 *         |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| |PrS|ScL|Pau|
 * `---'   `---------------' `---------------' `---------------' `-----------'
 * ,-----------------------------------------------------------. ,-----------. ,---------------.
 * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|    Bsp| |Ins|Hom|PgU| |NmL|  /|  *|  -|
 * |-----------------------------------------------------------| |-----------| |---------------|
 * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]| Retn| |Del|End|PgD| |  7|  8|  9|  +|
 * |------------------------------------------------------`    | `-----------' |-----------|   |
 * |CapsL |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  :|  #|    |               |  4|  5|  6|   |
 * |-----------------------------------------------------------|     ,---.     |---------------|
 * |Shft|  <|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift     |     |Up |     |  1|  2|  3|Ent|
 * |-----------------------------------------------------------| ,-----------. |-----------|   |
 * |Ctl|Gui|Alt|           Space               |Alt|Gui|App|Ctl| |Lef|Dow|Rig| |      0|  .|   |
 * `-----------------------------------------------------------' `-----------' `---------------'
 */
#define KEYMAP_MERC( \
            K68,K69,K6A,K71,K72,                                                                          \
    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,                            \
    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,    K2A,  K49,K4A,K4B,  K53,K54,K55,K56,          \
    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K31,  K4C,K4D,K4E,  K5F,K60,K61,K57,          \
    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,        K28,                K5C,K5D,K5E,              \
    KE1,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,            KE5,      K52,      K59,K5A,K5B,              \
    KE0,KE3,KE2,            K2C,                KE6,KE7,K65,KE4,  K50,K51,K4F,  K62,    K63,K58           \
) KEYMAP_ALL( \
            K68,K69,K6A,K6B,K6C,K6D,K6E,K6F,K70,K71,K72,K73,K9C,                                          \
    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,  K81,K80,K7F,K66, K75,     \
    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K89,K2A,  K49,K4A,K4B,  K53,K54,K55,K56, K78,K79, \
    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K31,  K4C,K4D,K4E,  K5F,K60,K61,K57, K76,K7A, \
    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,    K32,K28,                K5C,K5D,K5E,K85, K77,K7C, \
    KE1,K64,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,    K87,KE5,      K52,      K59,K5A,K5B,K67, K74,K7D, \
    KE0,KE3,KE2,K8B,K91,    K2C,    K90,K8A,K88,KE6,KE7,K65,KE4,  K50,K51,K4F,  K62,    K63,K58, K7E,K7B  \
)
#endif

I was able to make my firmware through the online keymap editor but I want to learn what I did wrong  :(
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 02 July 2018, 23:51:21
Harima,
You need to define 'fn_actions' as gcc error message says.
Keymap file have to have 'fn_actions' even if you don't use it. See other keymap file in repo for reference.
Title: Re: USB to USB keyboard converter
Post by: Harima on Tue, 03 July 2018, 00:43:30
Ah! Yep, it went through! Thanks. Is it possible to use KEYMAP( instead of KEYMAP_ALL( for layer 0? I get a bunch of errors so I'm guessing not
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 03 July 2018, 01:13:07
of course you can use KEYMAP(), just notice it has diffrent number of arguments from KEYMAP_ALL().
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 03 July 2018, 01:29:01
I saw that you added a keycode 0x9C(KC_CLEAR) in your keymap_common.h, curious.
What keyboard or key send this keycode?

Code: [Select]
72c72
<             K68,K69,K6A,K6B,K6C,K6D,K6E,K6F,K70,K71,K72,K73,K9C,                                              \
---
>             K68,K69,K6A,K6B,K6C,K6D,K6E,K6F,K70,K71,K72,K73,                                              \
99c99
<       KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_##K9C,    KC_NO,    KC_NO,    KC_NO    }, /* 98-9F */ \
---
>       KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* 98-9F */ \
Title: Re: USB to USB keyboard converter
Post by: Harima on Tue, 03 July 2018, 01:33:02
gccmake gave me an error that KEYMAP_ALL requires 143 keys but I only gave 142, so I had to add it

This is what happens when I edit my keymap.c to fit with KEYMAP(

keymap.c
Code: [Select]
#include "action_layer.h "
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* 0: Foot Pedal */
    KEYMAP(
    LALT,       LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT,   LALT, LALT, LALT, 
    LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT,   LALT, LALT, LALT,  LALT, LALT, LALT, LALT,
    LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT,   LALT, LALT, LALT,  LALT, LALT, LALT,
    LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT,       LALT,                      LALT, LALT, LALT, LALT,
    LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT,             LALT,         LALT,        LALT, LALT, LALT,
    LALT, LALT, LALT,             LALT,                         LALT, LALT, LALT, LALT,    LALT,LALT,LALT,   LALT,       LALT, LALT),         
};

/*
 * Fn action definition
 */
#ifdef KEYMAP_SECTION_ENABLE
const action_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
#else
const action_t fn_actions[] PROGMEM = {
#endif
};

Error after make
Code: [Select]
Compiling C: keymap.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DINTERRUPT_CONTROL_END                                                                                                                                                                                               POINT -DBOOTLOADER_SIZE=4096 -DARDUINO=101 -DF_USB=16000000UL -DARCH=ARCH_AVR8 -                                                                                                                                                                                               DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_F                                                                                                                                                                                               ULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZ                                                                                                                                                                                               E=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DMOUSEKEY_ENABLE -DMOUSE_ENAB                                                                                                                                                                                               LE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DVERSION=1610250-dirty -Os -funsigned-cha                                                                                                                                                                                               r -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-fun                                                                                                                                                                                               ctions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototype                                                                                                                                                                                               s -Wa,-adhlns=obj_usb_usb/keymap.lst -I../../tmk_core/common -I. -I../../tmk_cor                                                                                                                                                                                               e -I../../tmk_core/protocol/usb_hid -I../../tmk_core/protocol/usb_hid/USB_Host_S                                                                                                                                                                                               hield_2.0 -I../../tmk_core/protocol/usb_hid/arduino-1.0.1/cores/arduino -I../../                                                                                                                                                                                               tmk_core/protocol/usb_hid/arduino-1.0.1/variants/leonardo -I../../tmk_core/proto                                                                                                                                                                                               col/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gn                                                                                                                                                                                               u99 -include config.h -MMD -MP -MF .dep/obj_usb_usb_keymap.o.d  keymap.c -o obj_                                                                                                                                                                                               usb_usb/keymap.o
keymap.c:12:132: error: macro "KEYMAP_ALL" requires 143 arguments, but only 142                                                                                                                                                                                                given
     LALT, LALT, LALT,             LALT,                         LALT, LALT, LAL                                                                                                                                                                                               T, LALT,    LALT,LALT,LALT,   LALT,       LALT, LALT),
                                                                                                                                                                                                                                                                                                                                   ^
In file included from keymap.c:2:0:
keymap_common.h:136:3: error: 'KEYMAP_ALL' undeclared here (not in a function)
 ) KEYMAP_ALL( \
   ^
keymap.c:6:5: note: in expansion of macro 'KEYMAP'
     KEYMAP(
     ^
make: *** [../../tmk_core/rules.mk:560: obj_usb_usb/keymap.o] Error 1
Title: Re: USB to USB keyboard converter
Post by: Giorgio on Thu, 05 July 2018, 06:55:50
Hello, after the update via (git pull), I've seen some errors, then I erased the git directory and reinstalled all, but yet I can't flash the firmware anymore....  Yet I  use the default config, including the keymap....


yes, I'ver reinstalled the dfu programmer erasing all config files.
Using ubuntu 18.04


dfu-programmer: waiting................
dfu-programmer atmega32u4 erase --force
Usage: dfu-programmer target[:usb-bus,usb-addr] command [options] [global-options] [file|data]

global-options:
        --quiet
        --debug level    (level is an integer specifying level of detail)
        Global options can be used with any command and must come
        after the command and before any file or data value

commands:
        configure {BSB|SBV|SSB|EB|HSB} [--suppress-validation] data
        dump
        dump-eeprom
        dump-user
        erase [--suppress-validation]
        flash [--suppress-validation] [--suppress-bootloader-mem]
                     [--serial=hexdigits:offset] {file|STDIN}
        flash-eeprom [--suppress-validation]
                     [--serial=hexdigits:offset] {file|STDIN}
        flash-user   [--suppress-validation]
                     [--serial=hexdigits:offset] {file|STDIN}
        get     {bootloader-version|ID1|ID2|BSB|SBV|SSB|EB|
                 manufacturer|family|product-name|
                 product-revision|HSB}
        getfuse {LOCK|EPFL|BOOTPROT|BODLEVEL|BODHYST|
                 BODEN|ISP_BOD_EN|ISP_IO_COND_EN|
                 ISP_FORCE}
        setfuse {LOCK|EPFL|BOOTPROT|BODLEVEL|BODHYST|
                 BODEN|ISP_BOD_EN|ISP_IO_COND_EN|
                 ISP_FORCE} data
        setsecure
        reset
        start
../../tmk_core/rules.mk:423: recipe for target 'dfu' failed
make: *** [dfu] Error 1


Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 05 July 2018, 08:02:29
Your dfu-programmer is old and doesn't accept '--force' option.
You have to install newew dfu-programmer or run commands by hand.
https://github.com/tmk/tmk_keyboard/wiki#dfu-programmer-for-windows-mac-and-linux

EDIT: I'll fix this error some later, perhaps.
Title: Re: USB to USB keyboard converter
Post by: Giorgio on Thu, 05 July 2018, 08:10:10
Your dfu-programmer is old and doesn't accept '--force' option.
You have to install newew dfu-programmer or run commands by hand.
https://github.com/tmk/tmk_keyboard/wiki#dfu-programmer-for-windows-mac-and-linux


Thanks the readme file still shows make dfu, can you please correct it?

Please kindly help, because I've learnt the way to use make dfu, and now I need to relearn everything. I've already lost an hour, and I've concluded nothing. Why make dfu doesn't work anymore?

what command do I need to use to compile?
make -f Makefile.<variant> clean
which variant?

and then to program?

Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 05 July 2018, 08:15:06
Use Makefile.unimap. Edit unimap.c to remap keys.

Run these to compile source code:

make -f Makefile.unimap clean
make -f Makefile.unimap
Title: Re: USB to USB keyboard converter
Post by: Giorgio on Thu, 05 July 2018, 10:14:47
Use Makefile.unimap. Edit unimap.c to remap keys.

Run these to compile source code:

make -f Makefile.unimap clean
make -f Makefile.unimap

Ok, I updated dfu from github and everything started to work again. This should be posted clear and bold... don't try to flash your usb_usb unless you have the lastest https://github.com/dfu-programmer/dfu-programmer

I don't understand why ubuntu doesn't ship with the lastes one, which is anyway quite old.
Title: Re: USB to USB keyboard converter
Post by: Giorgio on Thu, 05 July 2018, 10:49:51
Quite strange that the app key of the novatouch doesn't send any scancode. The app key, or whatever it's called, is the one after raltGr, rwin, APP, rctrl

I've tried with xev and with showscancodes.

The same results with and without the converter.

Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 05 July 2018, 10:57:53
Quite strange that the app key of the novatouch doesn't send any scancode. The app key, or whatever it's called, is the one after raltGr, rwin, APP, rctrl

I've tried with xev and with showscancodes.

The same results with and without the converter.



does your novatouch have really APP key?
I found FN key there on images on this site. In general FN key sends no scancode as you know.
http://www.coolermaster.com/peripheral/keyboards/novatouchtkl/
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 05 July 2018, 19:28:44
[Firmware Update]
Updated firmware to fix startup issue, you can download it from Keymap Editor or source repo now.

With some kind of keyboard you have to plug the converter in PC first and then hook up the keyboard without this fix. If you have suffered from this issue try new firmware.

See this commit (https://github.com/tmk/tmk_keyboard/commit/c2ce617a363f3b9d43aa81f98e70d58f928931f4) for detail.

Thanks
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 07 July 2018, 19:10:46
Use Makefile.unimap. Edit unimap.c to remap keys.

Run these to compile source code:

make -f Makefile.unimap clean
make -f Makefile.unimap

Ok, I updated dfu from github and everything started to work again. This should be posted clear and bold... don't try to flash your usb_usb unless you have the lastest https://github.com/dfu-programmer/dfu-programmer

I don't understand why ubuntu doesn't ship with the lastes one, which is anyway quite old.

Now you can do 'make dfu' with old dfu-programmer as before :D Updated makefile under tmk_core.
https://github.com/tmk/tmk_keyboard/commit/dd543150b45c8dc45a5837a6ce6c7d61c8525c52
Title: Re: USB to USB keyboard converter
Post by: Giorgio on Sat, 07 July 2018, 19:50:03
Use Makefile.unimap. Edit unimap.c to remap keys.

Run these to compile source code:

make -f Makefile.unimap clean
make -f Makefile.unimap

Ok, I updated dfu from github and everything started to work again. This should be posted clear and bold... don't try to flash your usb_usb unless you have the lastest https://github.com/dfu-programmer/dfu-programmer

I don't understand why ubuntu doesn't ship with the lastes one, which is anyway quite old.

Now you can do 'make dfu' with old dfu-programmer as before :D Updated makefile under tmk_core.
https://github.com/tmk/tmk_keyboard/commit/dd543150b45c8dc45a5837a6ce6c7d61c8525c52

Thanks for making this great tool. Being able to have the same shortcuts in all the keyboards and OSes is really valuable to me.

How could you become so good? Are you a full time programmer?
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 07 July 2018, 20:23:41
So my USB_USB converter won't work with my Realforce RGB if I plug the keyboard into the converter before I plug the converter into the laptop.

It's really just an issue because I have the keyboard and converter plugged into a USB Hub at work, so this means I have to first plug the hub into my computer, then nothing works because I'm sleepy and have forgotten about the problem... Then I have to pull the converter out, pull the keyboard out, and then plug everything in the right way.

Is this a known issue? Is there a workaround besides my very manual workaround?


Sorry for too late fix but Realforce RGB works now with the latest firmware (https://geekhack.org/index.php?topic=69169.msg2634041#msg2634041)!
Try if you still have it.
Title: Re: USB to USB keyboard converter
Post by: Harima on Fri, 13 July 2018, 00:19:32
Could not get this X-Keys Foot Pedal XF-10-US to work

http://www.ergocanada.com/detailed_specification_pages/pi_engineering_x_keys_triple_action_foot_pedal.html (http://www.ergocanada.com/detailed_specification_pages/pi_engineering_x_keys_triple_action_foot_pedal.html)
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 13 July 2018, 04:19:12
Could not get this X-Keys Foot Pedal XF-10-US to work

http://www.ergocanada.com/detailed_specification_pages/pi_engineering_x_keys_triple_action_foot_pedal.html (http://www.ergocanada.com/detailed_specification_pages/pi_engineering_x_keys_triple_action_foot_pedal.html)

Thank you for your feedback!
Added it in the first post.

Title: Re: USB to USB keyboard converter
Post by: Giorgio on Fri, 13 July 2018, 06:03:37
Could not get this X-Keys Foot Pedal XF-10-US to work

http://www.ergocanada.com/detailed_specification_pages/pi_engineering_x_keys_triple_action_foot_pedal.html (http://www.ergocanada.com/detailed_specification_pages/pi_engineering_x_keys_triple_action_foot_pedal.html)

Thank you for your feedback!
Added it in the first post.

You should add also the cherry g80-3000. I haven't tested the g80-1800 yet.
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 13 July 2018, 06:28:53
Could not get this X-Keys Foot Pedal XF-10-US to work

http://www.ergocanada.com/detailed_specification_pages/pi_engineering_x_keys_triple_action_foot_pedal.html (http://www.ergocanada.com/detailed_specification_pages/pi_engineering_x_keys_triple_action_foot_pedal.html)

Thank you for your feedback!
Added it in the first post.

You should add also the cherry g80-3000. I haven't tested the g80-1800 yet.

As fa as I know the keyboard has a sucky bug and it is not problem of this converter.

EDIT: I think you can still use it through this converter as keyboard  with the bug. The bug comes from crappy firmware of the Cherry keyboard, not the converter. For someone who are interested, check this post.
https://geekhack.org/index.php?topic=69169.msg2629507#msg2629507
Title: Combine multiple dual role modifiers?
Post by: T42 on Fri, 13 July 2018, 16:34:55
Hello,

I am planning to order two converters, but got some questions first.

Can multiple ACTION_MODS_TAP_KEY be combined? For example, I want to use (on a standard keyboard, probably getting a Fnatic Gear Rush, turned to have the F keys as thumb keys):
Dual-role modifier / tap:
f4    = mod_ralt  / kc_bspc
f5    = mod_rctl  / kc_spc
[     = <layer 5> / kc_rsft|kc_minus (-> question mark in German layout)
kc_i  = mod_lsft  / kc_e

Layer 5:

kc_b  = kc_f10
kc_v  = kc_f11
...

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


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!
Title: Re: USB to USB keyboard converter
Post by: Giorgio on Fri, 13 July 2018, 20:09:25
Could not get this X-Keys Foot Pedal XF-10-US to work

http://www.ergocanada.com/detailed_specification_pages/pi_engineering_x_keys_triple_action_foot_pedal.html (http://www.ergocanada.com/detailed_specification_pages/pi_engineering_x_keys_triple_action_foot_pedal.html)

Thank you for your feedback!
Added it in the first post.

You should add also the cherry g80-3000. I haven't tested the g80-1800 yet.

As fa as I know the keyboard has a sucky bug and it is not problem of this converter.

EDIT: I think you can still use it through this converter as keyboard  with the bug. The bug comes from crappy firmware of the Cherry keyboard, not the converter. For someone who are interested, check this post.
https://geekhack.org/index.php?topic=69169.msg2629507#msg2629507

In the end it makes no difference, if the keyboard has a problem, then it's incompatible with the converter.
The keyboard doesn't work, trust me, it sends some random scancodes that make any work impossible. If you have that keyboard you can't use the converter.
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 13 July 2018, 20:15:53
Hello,

I am planning to order two converters, but got some questions first.

Can multiple ACTION_MODS_TAP_KEY be combined? For example, I want to use (on a standard keyboard, probably getting a Fnatic Gear Rush, turned to have the F keys as thumb keys):
Dual-role modifier / tap:
f4    = mod_ralt  / kc_bspc
f5    = mod_rctl  / kc_spc
[     = <layer 5> / kc_rsft|kc_minus (-> question mark in German layout)
kc_i  = mod_lsft  / kc_e

Layer 5:

kc_b  = kc_f10
kc_v  = kc_f11
...


I think you can define those without hassle except for '['. You have to write code in keymap file to define action for the '[', ACTION_LAYER_TAP doesn't accept modified key like 'kc_rsft|kc_minus'.


Quote
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.


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.

Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 13 July 2018, 20:46:59

Could not get this X-Keys Foot Pedal XF-10-US to work

http://www.ergocanada.com/detailed_specification_pages/pi_engineering_x_keys_triple_action_foot_pedal.html (http://www.ergocanada.com/detailed_specification_pages/pi_engineering_x_keys_triple_action_foot_pedal.html)

Thank you for your feedback!
Added it in the first post.

You should add also the cherry g80-3000. I haven't tested the g80-1800 yet.

As fa as I know the keyboard has a sucky bug and it is not problem of this converter.

EDIT: I think you can still use it through this converter as keyboard  with the bug. The bug comes from crappy firmware of the Cherry keyboard, not the converter. For someone who are interested, check this post.
https://geekhack.org/index.php?topic=69169.msg2629507#msg2629507

In the end it makes no difference, if the keyboard has a problem, then it's incompatible with the converter.
The keyboard doesn't work, trust me, it sends some random scancodes that make any work impossible. If you have that keyboard you can't use the converter.

random scancodes? You see keys you don't press?
As far as I understand the bug sends 'unexpected control' only, not other random scancodes.


Is it possible that when typing very fast, the keyboard sends some random codes like ctrl-l and ctrl-f (^l and ^f). I'm sure that I don't accidentally press other keys. The keyboard is a cherry g80-3000, and this fact has been recorded on vim, but happens mostly on the browser, where I can't log the output of the keybard, but I register some accidental events.

I Assume you pressed L and F at least when the bug occurred.
On G80-3000 with 2KRO the bug can happen when pressing specific combo of three keys causes matrix ghost bloking state. The keyoard sends incompatible report: 0101010101010101 then as following posts says.

The keyboard is not usable with this converter, Mac, and Linux while it seems that Windows manage to handle  the incompatible report  somehow.


Not sure but those keyboards may have same issue because they doesn't seem to have plan to fix firmware for this. Perhaps you had better avoid those keyboard unless you already own them.
https://deskthority.net/keyboards-f2/cherry-usb-controller-problems-visible-in-linux-and-macos-t17938.html#p413367

It seems the G80-3000 works on Windows but not on Mac and Linux as the thead indicates, I guess WIndows manage to handle the issue in some way.
https://deskthority.net/keyboards-f2/cherry-g80-3000-broke-down-t17899.html#p395088
Title: Re: USB to USB keyboard converter
Post by: Giorgio on Fri, 13 July 2018, 21:24:51

Could not get this X-Keys Foot Pedal XF-10-US to work

http://www.ergocanada.com/detailed_specification_pages/pi_engineering_x_keys_triple_action_foot_pedal.html (http://www.ergocanada.com/detailed_specification_pages/pi_engineering_x_keys_triple_action_foot_pedal.html)

Thank you for your feedback!
Added it in the first post.

You should add also the cherry g80-3000. I haven't tested the g80-1800 yet.

As fa as I know the keyboard has a sucky bug and it is not problem of this converter.

EDIT: I think you can still use it through this converter as keyboard  with the bug. The bug comes from crappy firmware of the Cherry keyboard, not the converter. For someone who are interested, check this post.
https://geekhack.org/index.php?topic=69169.msg2629507#msg2629507

In the end it makes no difference, if the keyboard has a problem, then it's incompatible with the converter.
The keyboard doesn't work, trust me, it sends some random scancodes that make any work impossible. If you have that keyboard you can't use the converter.

random scancodes? You see keys you don't press?
As far as I understand the bug sends 'unexpected control' only, not other random scancodes.


Is it possible that when typing very fast, the keyboard sends some random codes like ctrl-l and ctrl-f (^l and ^f). I'm sure that I don't accidentally press other keys. The keyboard is a cherry g80-3000, and this fact has been recorded on vim, but happens mostly on the browser, where I can't log the output of the keybard, but I register some accidental events.

I Assume you pressed L and F at least when the bug occurred.
On G80-3000 with 2KRO the bug can happen when pressing specific combo of three keys causes matrix ghost bloking state. The keyoard sends incompatible report: 0101010101010101 then as following posts says.

The keyboard is not usable with this converter, Mac, and Linux while it seems that Windows manage to handle  the incompatible report  somehow.


Not sure but those keyboards may have same issue because they doesn't seem to have plan to fix firmware for this. Perhaps you had better avoid those keyboard unless you already own them.
https://deskthority.net/keyboards-f2/cherry-usb-controller-problems-visible-in-linux-and-macos-t17938.html#p413367

It seems the G80-3000 works on Windows but not on Mac and Linux as the thead indicates, I guess WIndows manage to handle the issue in some way.
https://deskthority.net/keyboards-f2/cherry-g80-3000-broke-down-t17899.html#p395088

The g80-3000 is unusable with the converter since it sends random commands that make software misbehave. Depending on the software that you're using, you might lose focus on what you're doing, have pdf of the guide open suddenly. And if you're using Gmail you'll suddenly lose whatever you've typed because the browser suddenly close your page and went back. So yes, it's absolutely unusable. It isn't the fault of the converter, but yet is unusable.
Title: Re: USB to USB keyboard converter
Post by: hasu 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.

Title: Re: USB to USB keyboard converter
Post by: T42 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:
(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.
Title: Re: USB to USB keyboard converter
Post by: Giorgio 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?
Title: Re: USB to USB keyboard converter
Post by: hasu 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.
Title: Re: USB to USB keyboard converter
Post by: hasu 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.
Title: Re: USB to USB keyboard converter
Post by: hasu 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.

Title: Re: USB to USB keyboard converter
Post by: T42 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.
Title: Re: USB to USB keyboard converter
Post by: hasu 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
Title: Re: USB to USB keyboard converter
Post by: T42 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 (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.
Title: Re: USB to USB keyboard converter
Post by: gdsports 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.
Title: Re: USB to USB keyboard converter
Post by: Giorgio 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 :-)
Title: Re: USB to USB keyboard converter
Post by: hasu 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.
Title: Re: USB to USB keyboard converter
Post by: Harima 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?
Title: Re: USB to USB keyboard converter
Post by: hasu 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.
Title: Re: USB to USB keyboard converter
Post by: Harima 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
Title: Re: USB to USB keyboard converter
Post by: hasu 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
Title: Re: USB to USB keyboard converter
Post by: tofgerl 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... ;)
Title: Re: USB to USB keyboard converter
Post by: hasu 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
Title: Re: USB to USB keyboard converter
Post by: AdrianMan 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 !
Title: Re: USB to USB keyboard converter
Post by: hasu 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
Title: Re: USB to USB keyboard converter
Post by: AdrianMan 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 !
Title: Re: USB to USB keyboard converter
Post by: online 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?
Title: Re: USB to USB keyboard converter
Post by: hasu 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.
Title: Re: USB to USB keyboard converter
Post by: online 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).
Title: Re: USB to USB keyboard converter
Post by: hasu 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.
Title: Re: USB to USB keyboard converter
Post by: online 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.
Title: Re: USB to USB keyboard converter
Post by: hasu 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.
Title: Re: USB to USB keyboard converter
Post by: PierceSutton 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?
Title: Re: USB to USB keyboard converter
Post by: hasu 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
Title: Re: USB to USB keyboard converter
Post by: netbike 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.
Title: Re: USB to USB keyboard converter
Post by: hasu 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.
Title: Re: USB to USB keyboard converter
Post by: netbike 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,

Title: Re: USB to USB keyboard converter
Post by: hasu 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.
Title: Re: USB to USB keyboard converter
Post by: hasu 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
Title: Re: USB to USB keyboard converter
Post by: netbike on Sun, 11 November 2018, 07:10:18
Thanks Master,  let me download the latest and try again.
Title: Re: USB to USB keyboard converter
Post by: netbike on Sun, 11 November 2018, 08:41:58
Thank you Hasu, looks like it works now. 

Title: Re: USB to USB keyboard converter
Post by: hasu 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?
Title: Re: USB to USB keyboard converter
Post by: netbike 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.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 11 November 2018, 19:21:23
netbike, thank you for the input!
Updated the compatibility list again.
Title: Re: USB to USB keyboard converter
Post by: netbike 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.
Title: Re: USB to USB keyboard converter
Post by: hasu 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.
Title: Re: USB to USB keyboard converter
Post by: netbike on Mon, 12 November 2018, 09:11:22
Tks again Hasu, and looking forward to.
Title: Re: USB to USB keyboard converter
Post by: Hanks 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?
Title: Re: USB to USB keyboard converter
Post by: hasu 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.
Title: Re: USB to USB keyboard converter
Post by: cajhin 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 :-)
Title: Re: USB to USB keyboard converter
Post by: Hanks 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
Title: Re: USB to USB keyboard converter
Post by: hasu 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?
Title: Re: USB to USB keyboard converter
Post by: Hanks 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


Title: Re: USB to USB keyboard converter
Post by: hasu 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
Title: Re: USB to USB keyboard converter
Post by: hasu 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

Title: Re: USB to USB keyboard converter
Post by: Hanks 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
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 27 November 2018, 00:34:42
Didn't 'repluging only keyboard' show more output?
And what is your os, btw?
Title: Re: USB to USB keyboard converter
Post by: Hanks 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
Title: Re: USB to USB keyboard converter
Post by: hasu 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?

Title: Re: USB to USB keyboard converter
Post by: Hanks 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.
Title: Re: USB to USB keyboard converter
Post by: 1ceman 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?
Title: Re: USB to USB keyboard converter
Post by: hasu 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.
Title: Re: USB to USB keyboard converter
Post by: 1ceman on Wed, 02 January 2019, 17:40:03
That was a very fast reply, thank you!
Title: Re: USB to USB keyboard converter
Post by: PierceSutton 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.
Title: Re: USB to USB keyboard converter
Post by: hasu 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
Title: Re: USB to USB keyboard converter
Post by: ustczzh 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.
[attach=1]

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.
[attach=2]

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!
[attach=3]

Another picture for DXT28. It only supports up to bluetooth 3.0.
[attach=4]
Title: Re: USB to USB keyboard converter
Post by: PierceSutton 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 ???
Title: Re: USB to USB keyboard converter
Post by: hasu 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
Title: Re: USB to USB keyboard converter
Post by: PierceSutton 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.
Title: Re: USB to USB keyboard converter
Post by: hasu 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.
Title: Re: USB to USB keyboard converter
Post by: fr08 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
Title: Re: USB to USB keyboard converter
Post by: Hypersphere 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.

Title: Re: USB to USB keyboard converter
Post by: Gouty 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:

Title: Re: USB to USB keyboard converter
Post by: fine_italian_leather on Mon, 28 January 2019, 17:58:56
Congrats on getting featured on LTT!
Title: Re: USB to USB keyboard converter
Post by: PatrickR 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
Title: Re: USB to USB keyboard converter
Post by: Hypersphere 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?

Title: Re: USB to USB keyboard converter
Post by: ustczzh on Sun, 24 February 2019, 06:04:02
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

1, Make sure you choose the right model of Pro Micro, which should be 3.3v@8MHz. 3.3v
is needed by USB Host Shield mini.

2, Since the MCU frequency is 8MHz, you should set these values in Makefile.
F_CPU = 8000000
F_USB = 8000000
Title: Re: USB to USB keyboard converter
Post by: PierceSutton on Sun, 24 February 2019, 11:52:08
I have given up on scripting my own "RAPID_TAPPING" or turbo method in hasu's software. Seeing that I don't have enough experience with C and also the fact that many of the files have same/similar names will sometimes gets me lost in what I'm trying to do. However if anyone would like to continue or start a similar project, I hope I can be of assistance to them. 

Hasu, if you could add a turbo method into your software that would be extremely helpful. I have found other keyboard converter software for teensy 2.0 that includes a turbo mode, but only for a usb to usb type conversion. However I am using an Apple Extended Keyboard which uses an ADB port, therefore I am limited to what you put out seeing that your software is the only that I've seen that supports ADB.

(Sorry for posting here, I couldn't find the topic on converter software development)
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 25 February 2019, 06:22:06
PierceSutton, what is 'RAPID_TAPPING' and 'turbo mode/method you are refering?
Title: Re: USB to USB keyboard converter
Post by: PierceSutton on Sat, 02 March 2019, 01:05:17
PierceSutton, what is 'RAPID_TAPPING' and 'turbo mode/method you are refering?

Turbo mode was a feature that was on some old game controllers. What it did was that when pressed, buttons you held down would be read as you rapidly tapping that button rather than just holding it down. So if I set the turbo mode on spacebar, when I hold down spacebar the computer will register it as spacebar being pressed, then released, then pressed over and over again until the key is no longer being pressed.

If you meant what I  was referring to, I was referring to a method I was trying to add to your list of action keys. I put some posts earlier in this topic of what I was trying to do.
Title: Re: USB to USB keyboard converter
Post by: tofgerl on Sun, 10 March 2019, 08:15:15
I'm confused, this keymap used to work, but now I get this error:

Code: [Select]
In file included from keymap.c:1:
keymap_common.h:85:77: error: called object is not a function or function pointer
       KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, /* 28-2F */ \
                                                                             ^~~
keymap.c:48:11: note: in expansion of macro 'KEYMAP_ALL'
     [1] = KEYMAP_ALL(
           ^~~~~~~~~~
keymap_common.h:86:37: error: called object is not a function or function pointer
     { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37,   /* 30-37 */ \
                                     ^~~
keymap.c:48:11: note: in expansion of macro 'KEYMAP_ALL'
     [1] = KEYMAP_ALL(
           ^~~~~~~~~~
keymap_common.h:86:47: error: called object is not a function or function pointer
     { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37,   /* 30-37 */ \
                                               ^~~
keymap.c:48:11: note: in expansion of macro 'KEYMAP_ALL'
     [1] = KEYMAP_ALL(
           ^~~~~~~~~~
make: *** [obj_usb_usb/keymap.o] Error 1

https://gist.github.com/to***erl/bb63d35e363fca7cc48d1de1af55d6ef

Any ideas?
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 10 March 2019, 09:02:57

https://gist.github.com/to***erl/bb63d35e363fca7cc48d1de1af55d6ef


The link is not accessible, it seems it was censored by system software?
Title: Re: USB to USB keyboard converter
Post by: tofgerl on Sun, 10 March 2019, 12:51:20

https://gist.github.com/to***erl/bb63d35e363fca7cc48d1de1af55d6ef


The link is not accessible, it seems it was censored by system software?

Oh yeah, this forum software is REALLY horrible...
What I wouldn't give for a transfer to Discourse

https://bit.ly/2HpOnjc
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 10 March 2019, 17:07:23
You can't use undefined LALT() there. I think it is QMK specific notation.
Title: Re: USB to USB keyboard converter
Post by: tofgerl on Mon, 11 March 2019, 03:36:15
You can't use undefined LALT() there. I think it is QMK specific notation.

/d'oh gif

Then why did I think it worked? I must have moved that from one of my QMK keyboard configs without testing it at some point...

Thanks, man!
Title: Re: USB to USB keyboard converter
Post by: AdrianMan on Mon, 11 March 2019, 14:03:08
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

Hey Hasu, managed to get the keyboard home at last :)

Here is the USB Descriptor log for the Xiaomi MK02s TKL Keyboard:

Information for device USB KB (VID=0x0483 PID=0x5710):

Connection Information:
------------------------------
Device current bus speed: FullSpeed
Device supports USB 1.1 specification
Device supports USB 2.0 specification
Device address: 0x0005
Current configuration value: 0x01
Number of open pipes: 2

Device Descriptor:
------------------------------
0x12   bLength
0x01   bDescriptorType
0x0200   bcdUSB
0x00   bDeviceClass     
0x00   bDeviceSubClass   
0x00   bDeviceProtocol   
0x40   bMaxPacketSize0   (64 bytes)
0x0483   idVendor
0x5710   idProduct
0x0202   bcdDevice
0x01   iManufacturer   "STMicroelectronics"
0x02   iProduct   "USB KB"
0x00   iSerialNumber
0x01   bNumConfigurations

Configuration Descriptor:
------------------------------
0x09   bLength
0x02   bDescriptorType
0x003B   wTotalLength   (59 bytes)
0x02   bNumInterfaces
0x01   bConfigurationValue
0x00   iConfiguration
0xA0   bmAttributes   (Bus-powered Device, Remote-Wakeup)
0x32   bMaxPower      (100 mA)

Interface Descriptor:
------------------------------
0x09   bLength
0x04   bDescriptorType
0x00   bInterfaceNumber
0x00   bAlternateSetting
0x01   bNumEndPoints
0x03   bInterfaceClass      (Human Interface Device Class)
0x01   bInterfaceSubClass   
0x01   bInterfaceProtocol   
0x00   iInterface

HID Descriptor:
------------------------------
0x09   bLength
0x21   bDescriptorType
0x0111   bcdHID
0x00   bCountryCode
0x01   bNumDescriptors
0x22   bDescriptorType   (Report descriptor)
0x0041   bDescriptorLength

Endpoint Descriptor:
------------------------------
0x07   bLength
0x05   bDescriptorType
0x81   bEndpointAddress  (IN endpoint 1)
0x03   bmAttributes      (Transfer: Interrupt / Synch: None / Usage: Data)
0x0008   wMaxPacketSize    (1 x 8 bytes)
0x01   bInterval         (1 frames)

Interface Descriptor:
------------------------------
0x09   bLength
0x04   bDescriptorType
0x01   bInterfaceNumber
0x00   bAlternateSetting
0x01   bNumEndPoints
0x03   bInterfaceClass      (Human Interface Device Class)
0x00   bInterfaceSubClass   
0x00   bInterfaceProtocol   
0x00   iInterface

HID Descriptor:
------------------------------
0x09   bLength
0x21   bDescriptorType
0x0111   bcdHID
0x00   bCountryCode
0x01   bNumDescriptors
0x22   bDescriptorType   (Report descriptor)
0x004D   bDescriptorLength

Endpoint Descriptor:
------------------------------
0x07   bLength
0x05   bDescriptorType
0x82   bEndpointAddress  (IN endpoint 2)
0x03   bmAttributes      (Transfer: Interrupt / Synch: None / Usage: Data)
0x0010   wMaxPacketSize    (1 x 16 bytes)
0x01   bInterval         (1 frames)

Microsoft OS Descriptor is not available. Error code: 0x0000001F

String Descriptor Table
--------------------------------
Index  LANGID  String
0x00   0x0000  0x0409
0x01   0x0409  "STMicroelectronics"
0x02   0x0409  "USB KB"

------------------------------

Connection path for device:
USB xHCI Compliant Host Controller
Root Hub
USB KB (VID=0x0483 PID=0x5710) Port: 1

Running on: Windows 10 or greater

Brought to you by TDD v2.11.0, Mar 26 2018, 09:54:50


______________________________

Let me know if you need anything else :)
Thanks !
Title: Re: USB to USB keyboard converter
Post by: AdrianMan on Mon, 11 March 2019, 14:10:41
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

Hey Hasu, managed to get the keyboard home at last :)

Here is the USB Descriptor log for the Xiaomi MK02s TKL Keyboard:

......
______________________________

Let me know if you need anything else :)
Thanks !

I attched another descriptor using USBlyzer
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 11 March 2019, 18:50:50
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

Hey Hasu, managed to get the keyboard home at last :)

Here is the USB Descriptor log for the Xiaomi MK02s TKL Keyboard:

......
______________________________

Let me know if you need anything else :)
Thanks !

I attched another descriptor using USBlyzer

Thanks for the info! It is greatly useful.

The keyboard has two interfaces, the first one is for standard 6KRO and the second is for NKRO and media keys. I guess USB-USB converter fails to make the keyboard turned NKRO into 6KRO mode for some reason. Debug prints on hid_listen console would be helpful to know what happens there. Could you post it when you have time?
https://www.pjrc.com/teensy/hid_listen.html
https://github.com/tmk/tmk_keyboard/wiki/FAQ#debug-console

It seems the keyobard always send modifier keys through 6KRO interface even if it is in NKRO mode. I guess the converter should handle modeifier keys at least, can you confirm this with tool like switchhitter?
http://elitekeyboards.com/switchhitter.php

Also, do you know the keyboard(without the converter) works on BIOS/UEFI screen without problem? I think BIOS/UEFI requires keyboards to send all keys in 6KRO instead of NKRO. If the keyobard works well it means the converter probably has some glitch on mode switching and it would be fixable by firmware.
Title: Re: USB to USB keyboard converter
Post by: irek on Tue, 12 March 2019, 09:55:15
Hello! I have bought USB-USB converter mostly to workaround this problem – https://www.reddit.com/r/HyperX/comments/arswbk/request_fw_for_fps_pro_keyboard_with_hardcoded/ (https://www.reddit.com/r/HyperX/comments/arswbk/request_fw_for_fps_pro_keyboard_with_hardcoded/) and make the keyboard macOS compatible. Converter works fine with Alloy FPS Pro, but the problem is still exists even with converter. Random keys randomly stop working still.

Also I have tried to build and flash firmware with uncommented string
Code: [Select]
NKRO_ENABLE ?= yes # USB Nkey RolloverResult – keyboard (or converter) starts to generate random keypresses itself.

Here is some info:
Code: [Select]
Bus 001 Device 007: ID 0951:16d2 Kingston Technology
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x0951 Kingston Technology
  idProduct          0x16d2
  bcdDevice           21.12
  iManufacturer           1 Kingston
  iProduct                2 HyperX Alloy FPS Pro Mechanical Gaming Keyboard
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0054
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              480mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      1 Keyboard
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      79
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      51
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      37
          Report Descriptor: (length is 37)
            Item(Global): Usage Page, data= [ 0x01 ] 1
                            Generic Desktop Controls
            Item(Local ): Usage, data= [ 0x06 ] 6
                            Keyboard
            Item(Main  ): Collection, data= [ 0x01 ] 1
                            Application
            Item(Global): Usage Page, data= [ 0x07 ] 7
                            Keyboard
            Item(Local ): Usage Minimum, data= [ 0xe0 ] 224
                            Control Left
            Item(Local ): Usage Maximum, data= [ 0xe7 ] 231
                            GUI Right
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0x01 ] 1
            Item(Global): Report Size, data= [ 0x01 ] 1
            Item(Global): Report Count, data= [ 0x08 ] 8
            Item(Main  ): Input, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Local ): Usage Minimum, data= [ 0x00 ] 0
                            No Event
            Item(Local ): Usage Maximum, data= [ 0x6f ] 111
                            F20
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0x01 ] 1
            Item(Global): Report Size, data= [ 0x01 ] 1
            Item(Global): Report Count, data= [ 0x70 ] 112
            Item(Main  ): Input, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Main  ): End Collection, data=none
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000f  1x 15 bytes
        bInterval               1
Device Status:     0x0000
  (Bus Powered)

Code: [Select]
Usage Page (Desktop),               ; Generic desktop controls (01h)
Usage (Keyboard),                   ; Keyboard (06h, application collection)
Collection (Application),
    Usage Page (Keyboard),          ; Keyboard/keypad (07h)
    Usage Minimum (KB Leftcontrol), ; Keyboard left control (E0h, dynamic value)
    Usage Maximum (KB Right GUI),   ; Keyboard right GUI (E7h, dynamic value)
    Logical Minimum (0),
    Logical Maximum (1),
    Report Size (1),
    Report Count (8),
    Input (Variable),
    Usage Minimum (None),           ; No event (00h, selector)
    Usage Maximum (KB F20),         ; Keyboard F20 (6Fh, selector)
    Logical Minimum (0),
    Logical Maximum (1),
    Report Size (1),
    Report Count (112),
    Input (Variable),
End Collection,
Usage Page (Consumer),              ; Consumer (0Ch)
Usage (Consumer Control),           ; Consumer control (01h, application collection)
Collection (Application),
    Report ID (3),
    Usage Minimum (00h),
    Usage Maximum (1FFFh),
    Logical Minimum (0),
    Logical Maximum (8191),
    Report Size (16),
    Report Count (1),
    Input,
End Collection,
Usage Page (FF1Ch),                 ; FF1Ch, vendor-defined
Usage (92h),
Collection (Application),
    Report ID (4),
    Usage Minimum (00h),
    Usage Maximum (FFh),
    Logical Minimum (0),
    Logical Maximum (255),
    Report Size (8),
    Report Count (63),
    Feature (Variable),
End Collection,
Usage Page (Desktop),               ; Generic desktop controls (01h)
Usage (Keyboard),                   ; Keyboard (06h, application collection)
Collection (Application),
    Usage Page (Keyboard),          ; Keyboard/keypad (07h)
    Usage Minimum (KB Leftcontrol), ; Keyboard left control (E0h, dynamic value)
    Usage Maximum (KB Right GUI),   ; Keyboard right GUI (E7h, dynamic value)
    Logical Minimum (0),
    Logical Maximum (1),
    Report Size (1),
    Report Count (8),
    Input (Variable),
    Report Count (1),
    Report Size (8),
    Input (Constant),
    Report Count (5),
    Report Size (1),
    Usage Page (LED),               ; LEDs (08h)
    Usage Minimum (01h),
    Usage Maximum (05h),
    Output (Variable),
    Report Count (1),
    Report Size (3),
    Output (Constant),
    Report Count (6),
    Report Size (8),
    Logical Minimum (0),
    Logical Maximum (255),
    Usage Page (Keyboard),          ; Keyboard/keypad (07h)
    Usage Minimum (None),           ; No event (00h, selector)
    Usage Maximum (FFh),
    Input,
    Usage Page (Consumer),          ; Consumer (0Ch)
    Usage (00h),
    Logical Minimum (-128),
    Logical Maximum (127),
    Report Count (64),
    Report Size (8),
    Feature (Variable),
End Collection

Keyboard supports BIOS/UEFI mode without converter of course.

Do you have any ideas what is wrong?

Thank you!
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 13 March 2019, 07:11:32
The converter won't fix defective keyboard, it just passes key events from keyboard to computer basically.

Does the keyboard have the problem only with MacOS? You never have the problem on Linux or Windows?

EDIT:
I meant original keyboard defect(not converter) by "the problem" here. I'm curious about whether your keyboard works well on those OSes other than MacOS(without converter).

EDIT:
USB-USB converter doesn't support NKRO mode. Build firmware without NKRO_ENABLE option. If you enable the option the result
is  unpredictable.
Title: Re: USB to USB keyboard converter
Post by: nevin on Wed, 13 March 2019, 08:17:53
mac definitely does not like NKRO. 6 is max. and keyboard companies do all kinds of weird/voodoo things to get NKRO.

here's a thought... and an extra piece to put in your chain going from your keyboard to your computer.....
try... USB -> PS2 (passive adapter) -> PS2 to USB
see article: https://deskthority.net/wiki/NKRO-over-USB_issues

from the reddit link above:
[attachimg=1]
Title: Re: USB to USB keyboard converter
Post by: irek on Wed, 13 March 2019, 12:44:22
Hello! Thanks for the answers!

Quote
The converter won't fix defective keyboard, it just passes key events from keyboard to computer basically.
The idea was that the converter would make it possbile to force the keyboard work in 6KRO (boot mode) mode only. Is it technically possible? This is probably a stupid question, so please forgive me.

Quote
Does the keyboard have the problem only with MacOS? You never have the problem on Linux or Windows?

EDIT:
I meant original keyboard defect(not converter) by "the problem" here. I'm curious about whether your keyboard works well on those OSes other than MacOS(without converter).
Yes, only with macOS (w/o converter). It works fine on Windows (w/o converter).
Of course, the problem is not converter related. I am very glad that I bought it. Thank for this wonderful tool!

Quote
EDIT:
USB-USB converter doesn't support NKRO mode. Build firmware without NKRO_ENABLE option. If you enable the option the result
is  unpredictable.
It's worth a try :]


Quote
here's a thought... and an extra piece to put in your chain going from your keyboard to your computer.....
try... USB -> PS2 (passive adapter) -> PS2 to USB
see article: https://deskthority.net/wiki/NKRO-over-USB_issues
I tried it. Keyboard -> USB to PS/2 passive adapter -> Old PC with PS/2 port. No luck. This keyboard doesn't work with PS/2.


It seems to me it's time to calm down and to admit that this keyboard is really crappy.
Title: Re: USB to USB keyboard converter
Post by: nevin on Wed, 13 March 2019, 13:14:47
"It seems to me it's time to calm down and to admit that this keyboard is really crappy."

even if that's the case, and you're totally S.O.L. you could pull it apart and use most of the parts for a build.... so not a total loss, will just get you deeper into this hobby.

and if your model is the Alloy FPS Pro, it looks like it's a pretty standard TKL... possibly, just swap out the pcb?
that's what i did with my 1st 60% (started out as a KBTalking Pure, started to fail so swapped in a GH60 pcb, better than new!)
Title: Re: USB to USB keyboard converter
Post by: irek on Wed, 13 March 2019, 16:57:05
"It seems to me it's time to calm down and to admit that this keyboard is really crappy."

even if that's the case, and you're totally S.O.L. you could pull it apart and use most of the parts for a build.... so not a total loss, will just get you deeper into this hobby.

and if your model is the Alloy FPS Pro, it looks like it's a pretty standard TKL... possibly, just swap out the pcb?
that's what i did with my 1st 60% (started out as a KBTalking Pure, started to fail so swapped in a GH60 pcb, better than new!)

Yes, It's good option. Thank you! I will dig deeper into it after some experiments with keyboard firmware.
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 13 March 2019, 19:29:28
Hello! Thanks for the answers!

Quote
The converter won't fix defective keyboard, it just passes key events from keyboard to computer basically.
The idea was that the converter would make it possbile to force the keyboard work in 6KRO (boot mode) mode only. Is it technically possible? This is probably a stupid question, so please forgive me.

Yes, the converter requests NKRO keyboard to turn into 'boot mode'(6KRO) because it doesn't support NKRO report from the keyboard at all. So the keyobard works in 6KRO with converter and I guess it still have problem even in 6KRO.


Quote
Quote
Does the keyboard have the problem only with MacOS? You never have the problem on Linux or Windows?

EDIT:
I meant original keyboard defect(not converter) by "the problem" here. I'm curious about whether your keyboard works well on those OSes other than MacOS(without converter).
Yes, only with macOS (w/o converter). It works fine on Windows (w/o converter).
Of course, the problem is not converter related. I am very glad that I bought it. Thank for this wonderful tool!

hmm, interesting... I can't come up with any idea why the issue happens only with MacOS.
USB descriptor may have minor issue somewhere and which occurs the problem only on the OS perhaps.

Hope the manufacturer can fix it with next firmware update.
Title: Re: USB to USB keyboard converter
Post by: Hypersphere on Mon, 18 March 2019, 18:07:18
@hasu: Any progress yet on the issue with the USB-USB converter and a RF R2 keyboard not being recognized when rebooting or when using a KM switch to switch among computers that are sharing the keyboard?

I am still finding it necessary to unplug and replug the USB-USB converter whenever I reboot or switch to another computer.

I had wondered if the problem could be due to some sort of signal interference, so I tried putting ferrite cores on the cables on each side of the converter, but this did not help.

Thanks.
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 18 March 2019, 18:23:39
@hasu: Any progress yet on the issue with the USB-USB converter and a RF R2 keyboard not being recognized when rebooting or when using a KM switch to switch among computers that are sharing the keyboard?

I am still finding it necessary to unplug and replug the USB-USB converter whenever I reboot or switch to another computer.

I had wondered if the problem could be due to some sort of signal interference, so I tried putting ferrite cores on the cables on each side of the converter, but this did not help.

Thanks.


No, no progress.
I confirmed the converter stop working sometimes after rebooting or powering computer. But I cannot find how to reproduce the issue consistently and it makes debug process difficult.

Can you share specific model number of your computer and KM switch?
And do you have the issue only with RF R2? what if with other keyboard?

Title: Re: USB to USB keyboard converter
Post by: nevin on Mon, 18 March 2019, 21:11:56
i'm familiar with the KVM issue: randomly dropping/not recognizing a usb device on switching. (it's not USB to USB specific) i would have intermittent trouble with the mouse i was using when switching .....if memory serves (mouse was noting special)

i don't have a usb converter but i have a TMK converter (DIY Teensy), Griffin iMate  and i have a KVM (Trendnet TK-207) and the keyboards in my signature. let me know if i can lend a hand testing or whatever.
Title: Re: USB to USB keyboard converter
Post by: Hypersphere on Wed, 20 March 2019, 12:58:12
@hasu: Any progress yet on the issue with the USB-USB converter and a RF R2 keyboard not being recognized when rebooting or when using a KM switch to switch among computers that are sharing the keyboard?

I am still finding it necessary to unplug and replug the USB-USB converter whenever I reboot or switch to another computer.

I had wondered if the problem could be due to some sort of signal interference, so I tried putting ferrite cores on the cables on each side of the converter, but this did not help.

Thanks.


No, no progress.
I confirmed the converter stop working sometimes after rebooting or powering computer. But I cannot find how to reproduce the issue consistently and it makes debug process difficult.

Can you share specific model number of your computer and KM switch?
And do you have the issue only with RF R2? what if with other keyboard?
Main host computer: 2013 Mac Pro running Windows 10 v 1809 on the bare metal (no virtualization or Bootcamp).

Other attached computers: Microway PC and Puget Systems PC running Linux Mint 19.1 Xfce.

KVM switch: Iogear DVI KVMP switch with audio. I do not use the video feature of the switch.

I also have a series of powered USB hubs between the KVM switch and the host computer.

Current keyboard: RF R2 PFU Edition silent TKL.

However, I think that the problem is localized to the USB-USB converter. This is because I still get the problem when the converter is connected directly to the computer and the keyboard is connected directly to the converter. I also still get the problem with direct connection to the linux PCs. In addition, I still get the problem with other keyboards. So, it appears that the problem is not in the KVM switch, hubs, computers, or keyboards.

Again, what happens is the keyboard is not responsive after restarting the computer, starting after a complete shutdown of the computer, or using the KVM switch to switch to other computers. In order to get the keyboard to register, I have to physically unplug the converter from the hub or computer and plug it in again.

This issue happens most of the time, but sometimes it does not happen. If I recall correctly, I think that the times it sometimes does not happen is when using the KVM switch to switch from one computer to another.





Title: Re: USB to USB keyboard converter
Post by: nevin on Wed, 20 March 2019, 14:51:55
NKRO conflict with OS?
Title: Re: USB to USB keyboard converter
Post by: zucca on Wed, 20 March 2019, 18:44:44
I watched the TaranHV Video on YT and I convinced myself this USB to USB converter is a gem.
A few weeks later I had already four HASU USB USB converters delivered from Japan to Germany, thanks HASU.

I flashed the F24.hex founded here:
https://github.com/TaranVH/2nd-keyboard/blob/master/HASU_USB/F24/F24.hex (https://github.com/TaranVH/2nd-keyboard/blob/master/HASU_USB/F24/F24.hex)

Unfortunately I am also experiencing massive reboot problems.

At work (Win10 1803, Keyboard HP KU-1156), there is no way I can get it working after a reboot. Tried everything: Monitor USB Hub, With or without docking station. Laptop HP won't play nicely with the converter.

At home I have a Lenovo P51 and a Desktop PC. In the Desktop PC I occasionally get it working if I connected it at the monitor USB 3.0 hub otherwise no way.

Tonight I focused on the P51, Win 10 Pro 1809, keyboard HP KU-0133.

I am a EE so I fired up my scope to understand what happens on the 5V USB during a reboot.
I used this USB jig to separate the 5v power buses:
https://oshpark.com/shared_projects/EwXI88CL (https://oshpark.com/shared_projects/EwXI88CL)

Here what happen with a  50OHm resistor connected between 5V and ground,
(https://geekhack.org/index.php?action=dlattach;topic=69169.0;attach=215697;image)
with AC charger connected
(https://geekhack.org/index.php?action=dlattach;topic=69169.0;attach=215703;image)

without AC Charger
(https://geekhack.org/index.php?action=dlattach;topic=69169.0;attach=215705;image)

I tried then to feed both HASU USB Converter with an external 5V source to understand if something was changing. I tried to keep the 5V constantly on the HASU Conv. connected with the keyboard or just at the keyboard without USB Converter. See pictures:
(https://geekhack.org/index.php?action=dlattach;topic=69169.0;attach=215699;image)
(https://geekhack.org/index.php?action=dlattach;topic=69169.0;attach=215701;image)
No changes, always no keyboard after reboot.

So I decided to plug it directly to the Lenovo P51 and run some tests.

Statistically here what I got
(https://geekhack.org/index.php?action=dlattach;topic=69169.0;attach=215707;image)
device manager ok means I got the device HID\VID_FEED&PID_005B&MI_00\7&391144F0&0&0000 in the device tree.


what scared me the most, at a certain point the HASU USB was blocking the PC boot, the Lenovo was stuck with the boot logo on the screen. Anyway after a replug everything was ok.

To me everything works if I plug the keyboard AFTER I connect the HASU to the PC. Maybe putting a transistor which enable the 5V keyboard after the handshake with the PC has completed could help.
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 21 March 2019, 13:17:00
Thank you for the info, guys.
I'll look into the boot time problem this weekend again.
Title: Re: USB to USB keyboard converter
Post by: zucca on Thu, 21 March 2019, 17:21:24
Thanks Hasu,

let me know if I can help somehow. You are so close to perfection!

PS: I am thinking to get a Lecroy Mercury T2 to debug the boot up sequence if you want.
Title: Re: USB to USB keyboard converter
Post by: Hypersphere on Sun, 24 March 2019, 17:03:28
@hasu: Today, after a reboot of my Windows 10 machine, I was unable to get the keyboard to work with the USB-USB converter even after unplugging and replugging the converter or rebooting again.

I finally reinstalled Flip and reinstalled my hex file into the converter. Then, after a reboot and unplugging/replugging the converter, I got the keyboard to work again. (BTW, in order to get Flip working again, I had to uninstall it and install the version that is bundled with the Java Runtime. Otherwise, I would get errors saying that no Java virtual machine could be found).

I hope that you are able to fix this problem. I really like the converter when it is working, and I need the remapping in order to use my RF R2 keyboards with the layout that I want to use.

Thanks for your ongoing efforts to solve this problem.
Title: Re: USB to USB keyboard converter
Post by: zucca on Mon, 25 March 2019, 09:11:33
Today, after a reboot of my Windows 10 machine, I was unable to get the keyboard to work with the USB-USB converter even after unplugging and replugging the converter or rebooting again.

Was it working prior the reboot?
Did you left the HASU converter plugged in with the keyboard plugged in during the reboot?

I improved a lot the situation with these steps:

1) Computer off or prior to reboot with HASU Conv. working ok.
2) Disconnect the Keyboard from the HASU Conv.  but leave the HASU connected to PC.
3) Reboot or turn on the PC. (HASU Conv. is still connected to the PC but without keyboard).
4) Wait until the OS is up and running (boot is done).
5) Connect the Keyboard.
6) Enjoy the HASU.
Title: Re: USB to USB keyboard converter
Post by: zucca on Tue, 26 March 2019, 02:39:06
If the SW solution/bugfix is too complicated, then I suggest a hardware change, something like this:

VBUS Power control

(https://www.circuitsathome.com/wp/wp-content/uploads/2013/08/board_mic2004.jpg)

https://www.circuitsathome.com/mcu/vbus-power-control-on-usb-host-shield/ (https://www.circuitsathome.com/mcu/vbus-power-control-on-usb-host-shield/)

to control when the keyboard has to startup.
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 26 March 2019, 04:06:22
zucca, thank you for the suggestion. I've also seen the power switch are recommended to people with weird device problem several times  by Host Shield library maintainers on github.com. It may be useful or must-have for some exceptional keyboards while I still suppose keyboard incompatibilities of the converter is solvable by software in most cases.

From recent debug and observation, I almost believe the 're/boot-time fail problem' of USB-USB converter resides on usb interface facing with PC, not usb host shield side. At computer boot time USB interface receives suspend, resume and reset events on its bus multiple times and the converter seems to fail to handle either of the events. The converter(TMK firmware) performs kind of power saving and related actions when suspend and resume occurs, this is probably cause or one of causes at least. Removing those actions code the problem is not observed so far, it is promising for us. The code in question is used in many other converter and keyboard projects and its change can affect many of them, I'll look into and test it with care.

Let me take a little more time.

Thank you

Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 26 March 2019, 04:42:49
if there is someone is interested or want to try this is patch:

Code: [Select]
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c
index b5d0b50e..12c451d8 100644
--- a/tmk_core/protocol/lufa/lufa.c
+++ b/tmk_core/protocol/lufa/lufa.c
@@ -220,18 +220,20 @@ void EVENT_USB_Device_Connect(void)
 {
     print("[C]");
     /* For battery powered device */
+/*
     if (!USB_IsInitialized) {
         USB_Disable();
         USB_Init();
         USB_Device_EnableSOFEvents();
     }
+*/
 }
 
 void EVENT_USB_Device_Disconnect(void)
 {
     print("[D]");
     /* For battery powered device */
-    USB_IsInitialized = false;
+    //USB_IsInitialized = false;
 /* TODO: This doesn't work. After several plug in/outs can not be enumerated.
     if (USB_IsInitialized) {
         USB_Disable();  // Disable all interrupts
@@ -253,7 +255,7 @@ void EVENT_USB_Device_Suspend()
 #ifdef LUFA_DEBUG
     print("[S]");
 #endif
-    hook_usb_suspend_entry();
+    //hook_usb_suspend_entry();
 }
 
 void EVENT_USB_Device_WakeUp()
@@ -261,7 +263,7 @@ void EVENT_USB_Device_WakeUp()
 #ifdef LUFA_DEBUG
     print("[W]");
 #endif
-    hook_usb_wakeup();
+    //hook_usb_wakeup();
 }
 
 // called every 1ms
Title: Re: USB to USB keyboard converter
Post by: zucca on Tue, 26 March 2019, 04:54:45
Thanks HASU!

It looks good, nice catch!

I have now to compile the code, so I have to set up a linux virtual machine in Windows, compile it and flash it.
I never have done it before so it will take some time, but I want to help in this project.

PS: also TaranVH has the same "rebooting" "re-plug" problem. See here:
https://github.com/TaranVH/2nd-keyboard/issues/45#issuecomment-455648812 (https://github.com/TaranVH/2nd-keyboard/issues/45#issuecomment-455648812)
Quote
Just unplug and re-plug a normal keyboard 10 times!
So if this works be prepared to sell trucks and trucks of your converter!
Title: Re: USB to USB keyboard converter
Post by: zucca on Thu, 04 April 2019, 16:44:11
Very Good hasu!

It was a long jorney but I learned a lot. First I need to set up an Ubuntu virtual machine and then I need to learn how GitHub works.

Since I am working with QMK I forked the QMK FW and I committed the patch to the branch "Reboot"

https://github.com/Zuckme/qmk_firmware/tree/Reboot (https://github.com/Zuckme/qmk_firmware/tree/Reboot)

https://github.com/Zuckme/qmk_firmware/commit/3832438bac82653917628edbe5de99b4bcdceeaf (https://github.com/Zuckme/qmk_firmware/commit/3832438bac82653917628edbe5de99b4bcdceeaf)

Now QMK is not equal to TMK, and I did this

https://github.com/Zuckme/qmk_firmware/commit/3832438bac82653917628edbe5de99b4bcdceeaf#r33042061 (https://github.com/Zuckme/qmk_firmware/commit/3832438bac82653917628edbe5de99b4bcdceeaf#r33042061)

guessing is the right thing to do.

Anyway here my results:

(https://geekhack.org/index.php?action=dlattach;topic=69169.0;attach=216633;image)

So in my case the reboot worked for 81,25%! Reboot without keyboard attached no problem at all. Also by leaving the PC on and replugging the hasu+keyboard worked perfectly.

Another step to perfection!

Tomorrow I will take the patched converter to work and test it there.

hasu, can you please take a look at my patch?



Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 04 April 2019, 17:21:05
Great. Thank you for your time.
I know rebooting computer many times is irritating time consuming job :D I would be very helpful for me if you can test with TMK as well. You may get different result.

My previous patch was too ad hoc and crude, I'm working on this and close to release.
I believe I found one of causes of the problem at least and the patch should improve/mitigate in many cases.

This is my current temporary working branch just for reference.
https://github.com/tmk/tmk_keyboard/tree/usb_usb_init_fix


EDIT:
zucca,
what is your keyboard actually, btw?
Title: Re: USB to USB keyboard converter
Post by: zucca on Fri, 05 April 2019, 02:38:09
My pleasure to help on this brilliant project.

I would be very helpful for me if you can test with TMK as well. You may get different result.

I can do it. Can you tell me if the /keymaps/F24/config.h and /keymaps/F24/keymap.c are compatible with TMK FW?
Otherwise, I have to generate another mapping for TMK.

what is your keyboard actually, btw?

As stated before,
at Home: HP KU-0133
at Work:  HP KU-1156

This WE I will have no time for testing, please wait for next week. Moreover what is the best method to test the fix in your opinion?
According to my experiments the best is to leave the converter with the keyboard connected to the PC and reboot over and over again. Do you agree?

Now I am at work, I will test the patched converter through a monitor USB hub when I am rebooting, un/doking my work laptop. So far it failed once when I turned on the PC this morning :'(.
Remember at work it NEVER worked for me with the original QMK TaranVH firmware.
Title: Re: USB to USB keyboard converter
Post by: Hypersphere on Fri, 05 April 2019, 12:37:06
@hasu and @zucca: Looks like you are getting close to a solution. Things are working "good enough" for me at the moment, so I think I will wait for your completed method before trying any intermediate patches.

I do, however, look forward to a solution to this problem, as it is rather inconvenient to unplug/replug the converter in my setup.

Thanks for your dedicated efforts! Much appreciated!
Title: Re: USB to USB keyboard converter
Post by: zucca on Wed, 17 April 2019, 02:16:22
Just a quick update.

I am doing a statistical investigation at work. The patched hasu converter did not started properly the first three times, after that is holding strong and it is now the 7th time that is working properly after a reboot; before it never worked.

I am sorry I could not test the TMK FW patch, I was busy with other projects. During the easter break I will be "unfortunately" on vacation so no time for testing neither, please be patience.

It looks like we are on the right path to solve the issue.  :thumb:

Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 17 April 2019, 03:40:39
Just a quick update.

I am doing a statistical investigation at work. The patched hasu converter did not started properly the first three times, after that is holding strong and it is now the 7th time that is working properly after a reboot; before it never worked.

I am sorry I could not test the TMK FW patch, I was busy with other projects. During the easter break I will be "unfortunately" on vacation so no time for testing neither, please be patience.

It looks like we are on the right path to solve the issue.  :thumb:



I don't know whether the patch is compatible to QMK firmware, it is not perhaps. They may differ lot these days.

Title: Re: USB to USB keyboard converter
Post by: zucca on Wed, 17 April 2019, 04:08:45
I don't know whether the patch is compatible to QMK firmware, it is not perhaps. They may differ lot these days.

Looks like you don't work with QMK at all, but you were able to generate a patch that is so much better also in QMK.
No worries once we have solved the issue in TMK, I will contact TaranHV or some QMK buddy to help us.

The idea to remove the code for saving energy on battery device is promising also for the QMK firmware.
Title: Re: USB to USB keyboard converter
Post by: nevin on Thu, 18 April 2019, 20:27:08
Not the first time being "green" has caused a problem.
Title: Re: USB to USB keyboard converter
Post by: santo on Sun, 28 April 2019, 12:52:49
Great work Hasu!

Just one question:
Is it possible for USB to USB converter to set a timeout for dual role keys after which oneshot key is discarded (like ONESHOT_TIMEOUT in HHKB controller)?


Sent from my iPad using Tapatalk
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 28 April 2019, 19:04:38
Yes, you can configure functions with the converter as with other TMK firmware projects.
ONESHOT_TIMEOUT configuration is available with this covnerter, of course.

The timeout for dual role keys on TMK can be configured with TAPPING_TERM.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/keymap.md#4-tapping



Great work Hasu!

Just one question:
Is it possible for USB to USB converter to set a timeout for dual role keys after which oneshot key is discarded (like ONESHOT_TIMEOUT in HHKB controller)?


Sent from my iPad using Tapatalk

Title: Re: USB to USB keyboard converter
Post by: shiroshiro on Mon, 29 April 2019, 05:48:56
Does this work with 5v version of the pro micro?
Title: Re: USB to USB keyboard converter
Post by: scotland on Wed, 08 May 2019, 03:40:09
I have hasu's USB to USB converter and I'm using it with an Apple aluminium keyboard for remapping certain keys. There is some weird behaviour that I have been living with for a while but hopefully someone can shed some light on it. It is related to pressing keys while others are held down. As a test, I opened notepad in Windows and would start to type and take a note of the behaviour. What I found is split into various Action/Behaviour patterns below. Note than when holding keys this happens very quickly. E.g. if I press and hold C then press and hold D then press B, this all happens very quickly (before Windows would start to repeat a keypress)

============
Action - Scenario 1
============
1) Press C and hold it
2) Press D and hold it
3) Press B and release B while still holding C and D

====================
Editor contents after each action
====================
1) c
2) cd
3) cdcd

I would have expected after releasing B that the contents would be "cdb" but instead of b, it appends "cd" again at the end.
This same behaviour happens if you substitue many of the keys on the keyboard in place of B in action 3. e.g. Space, M, L, K would all cause the same output of "cdcd". This seems to be any of the non-special chars on the ASDFGHJKL row or ZXCVBNM row which will cause this. If, for step 3, I use any of the keys on the QWERTYUIOP row, I do not get the double "cdcd" output - the output works as expected (see scenario 2 below).

============
Action - Scenario 2
============
1) Press C and hold it
2) Press D and hold it
3) Press T and release T while still holding C and D

====================
Editor contents after each action
====================
1) c
2) cd
3) cdt

So this works as expected and works for substituting any key from the QWERTYUIOP row in step 3.


============
Action - Scenario 3
============
1) Press A and hold it
2) Press Z and hold it
3) Press Space and release Space while still holding A and Z

====================
Editor contents after each action
====================
1) a
2) az
3) azaz

Similar weird behaviour to scenario 1.

============
Action - Scenario 4
============
1) Press D and hold it
2) Press C and hold it
3) Press Space and release Space while still holding D and C

====================
Editor contents after each action
====================
1) d
2) c
3) dccd

NOTE: this is slightly different to scenario 1 in that D is pressed before C but after action 3 we end up with "dccd" rather than "dcdc" like you would maybe expect after reading scenario 1.

============
Action - Scenario 5
============
1) Press D and hold it
2) Press E and hold it
3) Press P and release P while still holding D and E

====================
Editor contents after each action
====================
1) d
2) e
3) dede

============
Action - Scenario 6
============
1) Press E and hold it
2) Press D and hold it
3) Press P and release P while still holding E and D

====================
Editor contents after each action
====================
1) e
2) d
3) edde

Does anyone have any idea what is going on here and how to fix it?

Thanks




Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 08 May 2019, 04:17:58
scotland,
It sounds to me like  primary cause is that the keyboard is 2KRO unfortunately. I believe "Apple aluminium keyboard" is consisted of switches on conductive mebrane matrix and 2KRO. With 2KRO keyboard third key may not be registered besides modifier keys baiscally, though, in some key combinations third key can be recognized like the "cdt" scenario.

Though, we may be able to improvement converter firmware for the keyboard. I think you should get just "cd" instead of "cdcd" when you press c, d and t, for example.

You can use 'hid_listen' tool to see debug message from converter. Share debug messages you get when doing the scenario "cdt".
https://github.com/tmk/tmk_keyboard#debugging

And what happens when doing those scenarios without the converter?

Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 08 May 2019, 18:27:22
Hypersphere and zucca,
I have found and fixed some problems on plugin and startup of keyboard. The fixes contribute to stability on both keyboard and PC side.

Could you try this attached binary and let me know your result?


@hasu and @zucca: Looks like you are getting close to a solution. Things are working "good enough" for me at the moment, so I think I will wait for your completed method before trying any intermediate patches.

I do, however, look forward to a solution to this problem, as it is rather inconvenient to unplug/replug the converter in my setup.

Thanks for your dedicated efforts! Much appreciated!

Title: Re: USB to USB keyboard converter
Post by: scotland on Thu, 09 May 2019, 06:20:53
Thanks for the prompt reply. It sounds like you are correct in that WITHOUT the converter plugged in (i.e. the keyboard is connected directly to the laptop) I get the following:

============
Action - Scenario 1
============
1) Press C and hold it
2) Press D and hold it
3) Press B and release B while still holding C and D

====================
Editor contents after each action
====================
1) c
2) cd
3) cd

So the pressing of B is not registered.

The CDT scenario does work for the third key being pressed:

============
Action - Scenario 2
============
1) Press C and hold it
2) Press D and hold it
3) Press T and release T while still holding C and D

====================
Editor contents after each action
====================
1) c
2) cd
3) cdt

============
Action - Scenario 3
============
1) Press C and hold it
2) Press D and hold it
3) Press Space and release Space while still holding C and D

====================
Editor contents after each action
====================
1) c
2) cd
3) cd  (Just "cd" - there will be no space)

If I plug the converter back in and run hid_listen, I get the following output:

============
Action - Scenario 1
============
1) Press C and hold it
2) Press D and hold it
3) Press B and release B while still holding C and D

λ hid_listen
Waiting for device:
Listening:
input 10: 00 00 06 00 00 00 00 00
state:  00 00 06 00 00 00 00 00
input 10: 00 00 06 07 00 00 00 00
state:  00 00 06 07 00 00 00 00
input 10: 00 00 01 01 01 01 01 01
state:  00 00 00 00 00 00 00 00
input 10: 00 00 06 07 00 00 00 00
state:  00 00 06 07 00 00 00 00
input 10: 00 00 06 00 00 00 00 00
state:  00 00 06 00 00 00 00 00
input 10: 00 00 00 00 00 00 00 00
state:  00 00 00 00 00 00 00 00

============
Action - Scenario 2
============
1) Press C and hold it
2) Press D and hold it
3) Press T and release T while still holding C and D

λ hid_listen
Waiting for device:
Listening:
input 10: 00 00 06 00 00 00 00 00
state:  00 00 06 00 00 00 00 00
input 10: 00 00 06 07 00 00 00 00
state:  00 00 06 07 00 00 00 00
input 10: 00 00 06 07 17 00 00 00
state:  00 00 06 07 17 00 00 00
input 10: 00 00 06 07 00 00 00 00
state:  00 00 06 07 00 00 00 00
input 10: 00 00 06 00 00 00 00 00
state:  00 00 06 00 00 00 00 00
input 10: 00 00 00 00 00 00 00 00
state:  00 00 00 00 00 00 00 00

============
Action - Scenario 3
============
1) Press C and hold it
2) Press D and hold it
3) Press Space and release Space while still holding C and D

λ hid_listen
Waiting for device:
Listening:
input 10: 00 00 06 00 00 00 00 00
state:  00 00 06 00 00 00 00 00
input 10: 00 00 06 07 00 00 00 00
state:  00 00 06 07 00 00 00 00
input 10: 00 00 01 01 01 01 01 01
state:  00 00 00 00 00 00 00 00
input 10: 00 00 06 07 00 00 00 00
state:  00 00 06 07 00 00 00 00
input 10: 00 00 06 00 00 00 00 00
state:  00 00 06 00 00 00 00 00
input 10: 00 00 00 00 00 00 00 00
state:  00 00 00 00 00 00 00 00

It is really that 3rd scenario that is a killer for me. The behavior of C, D then Space is actually slightly different depending on how quickly I try to type. If I try that key combination 10 times in a row WIHTOUT the converter, I get this:

"cd cd cd cd cd cd cd cd cd cd "

Now WITH the converter:

"cd cdd cdd cdd cd cd cdd cdd cdd "

Given I use the command line a lot in my job, it's a real pain.

Is this something that could be fixed with a firmware tweak? If so, if you can even give me some pointers I'm happy to try changing the firmware myself.

Thanks

scotland,
It sounds to me like  primary cause is that the keyboard is 2KRO unfortunately. I believe "Apple aluminium keyboard" is consisted of switches on conductive mebrane matrix and 2KRO. With 2KRO keyboard third key may not be registered besides modifier keys baiscally, though, in some key combinations third key can be recognized like the "cdt" scenario.

Though, we may be able to improvement converter firmware for the keyboard. I think you should get just "cd" instead of "cdcd" when you press c, d and t, for example.

You can use 'hid_listen' tool to see debug message from converter. Share debug messages you get when doing the scenario "cdt".
https://github.com/tmk/tmk_keyboard#debugging

And what happens when doing those scenarios without the converter?
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 09 May 2019, 20:55:42
Thank you for the info.
It seems that the keyboard reports Rollover error(0000010101010101) expectedly.
I fixed Rollover error handling code, can you try attached binary?

I almost believe this fix solves the issue.
If you can confirm it I'll update firmware in Keymap Editor in a few next weeks.


EDIT: btw, do you happen to know exact model number of  your keyboard?


============
Action - Scenario 3
============
1) Press C and hold it
2) Press D and hold it
3) Press Space and release Space while still holding C and D

λ hid_listen
Waiting for device:
Listening:
input 10: 00 00 06 00 00 00 00 00
state:  00 00 06 00 00 00 00 00
input 10: 00 00 06 07 00 00 00 00
state:  00 00 06 07 00 00 00 00
input 10: 00 00 01 01 01 01 01 01
state:  00 00 00 00 00 00 00 00
input 10: 00 00 06 07 00 00 00 00
state:  00 00 06 07 00 00 00 00
input 10: 00 00 06 00 00 00 00 00
state:  00 00 06 00 00 00 00 00
input 10: 00 00 00 00 00 00 00 00
state:  00 00 00 00 00 00 00 00

It is really that 3rd scenario that is a killer for me. The behavior of C, D then Space is actually slightly different depending on how quickly I try to type. If I try that key combination 10 times in a row WIHTOUT the converter, I get this:

"cd cd cd cd cd cd cd cd cd cd "

Now WITH the converter:

"cd cdd cdd cdd cd cd cdd cdd cdd "

Given I use the command line a lot in my job, it's a real pain.

Is this something that could be fixed with a firmware tweak? If so, if you can even give me some pointers I'm happy to try changing the firmware myself.

Thanks


Title: Re: USB to USB keyboard converter
Post by: scotland on Fri, 10 May 2019, 04:55:49
I'm working from home today and the keyboard is in the office so I can't test this or get you an exact model number until Monday. Thanks for looking into this. I'll report back as soon as I test it on Monday morning.

Thank you for the info.
It seems that the keyboard reports Rollover error(0000010101010101) expectedly.
I fixed Rollover error handling code, can you try attached binary?

I almost believe this fix solves the issue.
If you can confirm it I'll update firmware in Keymap Editor in a few next weeks.


EDIT: btw, do you happen to know exact model number of  your keyboard?
Title: Re: USB to USB keyboard converter
Post by: scotland on Wed, 15 May 2019, 03:16:29
Hi Hasu,

I flashed the firmware and that has fixed all of the issues! Thank you for the help - you're a life saver.  :D

FYI the exact model of the Apple keyboard is A1243.

Cheers


Thank you for the info.
It seems that the keyboard reports Rollover error(0000010101010101) expectedly.
I fixed Rollover error handling code, can you try attached binary?

I almost believe this fix solves the issue.
If you can confirm it I'll update firmware in Keymap Editor in a few next weeks.


EDIT: btw, do you happen to know exact model number of  your keyboard?
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 15 May 2019, 23:26:13
Thanks for your testing and report.
Great, I'll update prebuilt firmware of Keymap Editor in a few next weeks. Until then you can edit keymap by supplying the attached firmware as "Base Firmware File" for Keymap Editor.

Source code with the fix is available from this branch, not merged to master branch yet.
https://github.com/tmk/tmk_keyboard/tree/usb_usb_rollover_fix


Hi Hasu,

I flashed the firmware and that has fixed all of the issues! Thank you for the help - you're a life saver.  :D

FYI the exact model of the Apple keyboard is A1243.

Cheers


Thank you for the info.
It seems that the keyboard reports Rollover error(0000010101010101) expectedly.
I fixed Rollover error handling code, can you try attached binary?

I almost believe this fix solves the issue.
If you can confirm it I'll update firmware in Keymap Editor in a few next weeks.


EDIT: btw, do you happen to know exact model number of  your keyboard?

Title: Re: USB to USB keyboard converter
Post by: gavogavo on Sat, 18 May 2019, 21:55:07
hi there,

HASU I sent you a PM but wanted to check this thread.. does this mean the problem of needing to unplug/replug has been fixed for sure?

I maybe want to use on a GMMK Compact but need to know there won't be problem of needing to unplug/replug... Also, have you got them in stock ?

Thank you!
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 19 May 2019, 19:01:17
No, not confirmed the fix by real users suffering from the problem yet.
The converter stops working with some of keyboards occasionally(or often) at startup(power up/plug-in), and you need to replug to make the converter start again.

I for one found the problem with my 'Realforce RGB' with current firmware and confirmed that the problem no longer happen with new firmware with the fix.

There is no report about GMMK Compact from users yet, so I'm not sure that the converter work with the keyboard. We can't tell before real test.
Title: Re: USB to USB keyboard converter
Post by: Hypersphere on Sun, 26 May 2019, 11:12:29
Hypersphere and zucca,
I have found and fixed some problems on plugin and startup of keyboard. The fixes contribute to stability on both keyboard and PC side.

Could you try this attached binary and let me know your result?


@hasu and @zucca: Looks like you are getting close to a solution. Things are working "good enough" for me at the moment, so I think I will wait for your completed method before trying any intermediate patches.

I do, however, look forward to a solution to this problem, as it is rather inconvenient to unplug/replug the converter in my setup.

Thanks for your dedicated efforts! Much appreciated!

Hi, I have returned from travel, and I had some time to test the new hex file with the usb-usb converter and my RF R2 TKL keyboard. I regret to say that it did not work. The converter still has to be unplugged and replugged, both after restarting the computer and when using a KM switch to switch between two computers. I have not yet tested the converter with other keyboards, but previously, the problem existed with several very different keyboards plugged into the converter.

EDIT: My setup has a KM switch sharing a keyboard and mouse with 3 computers -- 2 running Linux and 1 running Windows. The KM switch is connected to a USB hub, and the keyboard and mouse are connected to the hub. When I am using the USB-USB converter, it is plugged into the USB hub, and the keyboard is plugged into the converter. Thus, the unplugging/replugging of the USB-USB converter occurs at the USB hub.

To make unplugging/replugging of the converter easier, I tried replacing the USB hub with a different USB hub that has a toggle switch for each USB receptacle. This works, but oddly enough, it does not work as well as unplugging and replugging. I usually need to toggle the switch on the keyboard receptacle 2-3 times to get the USB-USB converter to be reinitialized. Why should this be the case?

In any event, I think I will change my setup so that I will have a switchable USB hub within easy reach. Even if I need to toggle several times the switch to which the USB-USB converter is connected, this seems easier than unplugging/replugging the converter.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 26 May 2019, 17:57:23
Hypersphere,
New firmware doesn't work for you, I'm again at my wits' end here and don't have things to do for this problem at this point unfortunately. Sorry.

Is there anyone have Realforce R2 with this converter here? Any information from other users would be helpful.
Title: Re: USB to USB keyboard converter
Post by: zucca on Tue, 28 May 2019, 13:19:40
Hypersphere and zucca,
I have found and fixed some problems on plugin and startup of keyboard. The fixes contribute to stability on both keyboard and PC side.

Could you try this attached binary and let me know your result?

Sorry guys for some reasons the blog notifications did not work for me anymore.

I'm sorry Hypersphere but for me that .hex works 100%. 25 Reboot tonight, I un-replugged the converter many times and it always worked.
The host keyboard was always recognized, not even an imperfection. No matter what I try and do, it always works!!!  :thumb:

I will take tomorrow the fixed HASU reboot converter to test it at work, where it will be stress tested on a Laptop with docking station.

@Hasu can I find your fix code here below?

This is my current temporary working branch just for reference.
https://github.com/tmk/tmk_keyboard/tree/usb_usb_init_fix

I will try to import it in QMK, since I believe you don't want to or not interested.
Another options could be to import the TaranHV .hex

https://github.com/Zuckme/N-keyboard/tree/master/HASU_USB/F24 (https://github.com/Zuckme/N-keyboard/tree/master/HASU_USB/F24)

in the TMK enviroment.... what do you suggest?

Thank you so much I am now recommending your converter to my friends.

I keep you posted in case I found any problems.

(https://i2.wp.com/www.knysnakeep.org/wp-content/uploads/2013/09/thank-you-keyboard.jpg?resize=500%2C399&ssl=1)
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 28 May 2019, 14:46:17
Thank you for testing the fix, @zucca.
Great to hear that it works on your site. I'll merge it into master branch and update Keymap Editor soon.

Yes, you can find the fix for the replug realted problem in that branch of tmk_keyboard and my own fork of USB_Host_Shield_2.0.
https://github.com/tmk/tmk_keyboard/tree/usb_usb_init_fix
https://github.com/tmk/USB_Host_Shield_2.0/tree/master

I think you want to merge the fix to QMK, not Taran's. I don't know how QMK differs from TMK at this point, but I guess merging the fix is sitll not difficult that much.
Or, why don't you just import QMK functions you need to TMK? :D

Hypersphere and zucca,
I have found and fixed some problems on plugin and startup of keyboard. The fixes contribute to stability on both keyboard and PC side.

Could you try this attached binary and let me know your result?

Sorry guys for some reasons the blog notifications did not work for me anymore.

I'm sorry Hypersphere but for me that .hex works 100%. 25 Reboot tonight, I un-replugged the converter many times and it always worked.
The host keyboard was always recognized, not even an imperfection. No matter what I try and do, it always works!!!  :thumb:

I will take tomorrow the fixed HASU reboot converter to test it at work, where it will be stress tested on a Laptop with docking station.

@Hasu can I find your fix code here below?

This is my current temporary working branch just for reference.
https://github.com/tmk/tmk_keyboard/tree/usb_usb_init_fix

I will try to import it in QMK, since I believe you don't want to or not interested.
Another options could be to import the TaranHV .hex

https://github.com/Zuckme/N-keyboard/tree/master/HASU_USB/F24 (https://github.com/Zuckme/N-keyboard/tree/master/HASU_USB/F24)

in the TMK enviroment.... what do you suggest?

Thank you so much I am now recommending your converter to my friends.

I keep you posted in case I found any problems.

Show Image
(https://i2.wp.com/www.knysnakeep.org/wp-content/uploads/2013/09/thank-you-keyboard.jpg?resize=500%2C399&ssl=1)


Title: Re: USB to USB keyboard converter
Post by: zucca on Tue, 28 May 2019, 15:08:21
I think you want to merge the fix to QMK, not Taran's. I don't know how QMK differs from TMK at this point, but I guess merging the fix is sitll not difficult that much.

Yes into QMK.

Or, why don't you just import QMK functions you need to TMK? :D

Well since I am a beginner with xMK firmware I don't know what would be easier for me. All what I need is this remapping:

https://github.com/Zuckme/N-keyboard/blob/master/HASU_USB/F24/keymap.c (https://github.com/Zuckme/N-keyboard/blob/master/HASU_USB/F24/keymap.c)

very very easy stuff... nothing crazy. The only thing which is black magic for me is this code at the end of that file to trigger the F24 key at every host keyboard key press:

Code: [Select]
//https://docs.qmk.fm/keycode.txt
//shoutout to drashna on the QMK discord for basically writing this for me.... :P

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
    static uint8_t f24_tracker;
    switch (keycode) {
    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(keycode);
        } else {
            unregister_code(keycode);
            f24_tracker--;
            if (!f24_tracker) {
                unregister_code(KC_F24); //this means to send F24 up
            }
            //real key is released HERE
        }
        return false;
        break;
    }
    return true;
}

and I don't know if TMK can do that.

Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 28 May 2019, 16:32:21
That seems to be interesting and useful for TMK users too. I'll add 'hook' function equivalent to that.
Let me have some time, like a week.

Or, why don't you just import QMK functions you need to TMK? :D

Well since I am a beginner with xMK firmware I don't know what would be easier for me. All what I need is this remapping:

https://github.com/Zuckme/N-keyboard/blob/master/HASU_USB/F24/keymap.c (https://github.com/Zuckme/N-keyboard/blob/master/HASU_USB/F24/keymap.c)

very very easy stuff... nothing crazy. The only thing which is black magic for me is this code at the end of that file to trigger the F24 key at every host keyboard key press:

Code: [Select]
//https://docs.qmk.fm/keycode.txt
//shoutout to drashna on the QMK discord for basically writing this for me.... :P

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
    static uint8_t f24_tracker;
    switch (keycode) {
    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(keycode);
        } else {
            unregister_code(keycode);
            f24_tracker--;
            if (!f24_tracker) {
                unregister_code(KC_F24); //this means to send F24 up
            }
            //real key is released HERE
        }
        return false;
        break;
    }
    return true;
}

and I don't know if TMK can do that.



Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 04 June 2019, 19:56:01
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;
}

Title: Re: USB to USB keyboard converter
Post by: zucca on Fri, 07 June 2019, 07:03:16
thank you HASU for your support.
Now I have "unfortunately" some vacation time, so please wait until next week and I will give you some feedback.

Meanwhile, your reboot fix is working solid rock also at my work.  :thumb:
Title: Re: USB to USB keyboard converter
Post by: jayt on Tue, 18 June 2019, 03:01:59
Hello hasu and everyone,

It's just a log. I have built one by myself.
Actually, I bought it from hasu a couple weeks ago and realized the KiCad file is on github. So I have tried to build another one just for fun this time.

Attached is chain of hasu's original and mine. Mine is a little dirty.  ;D

My keyboards are Topre Realforce 91UDK-G and ELECOM TK-FDP098TBK. They both work fine so far.

I'm still confusing which is correct 18p and 10p for C[4-5,10-11], 1k and 2k2 for R6.
Anyway, thank you very much hasu and everyone. I don't have any good useful idea for the LED on the board though.
Title: Re: USB to USB keyboard converter
Post by: zucca on Wed, 19 June 2019, 10:27:42
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.

Thanks hasu, it works better than perfect. I just did a 5 Minute check before starting another travel.
I will try to build some .hex with the F23 and F22 hook functions.

I tried to contact TeranVH in many ways but no luck. I wish he know that you provided a solution to everything.

 :thumb:
Title: Re: USB to USB keyboard converter
Post by: senkwich on Wed, 19 June 2019, 14:26:29
Just wanted to double-check that I understand the state of this awesome converter!

I own two Kinesis Advantage and one Kinesis Advantage 2. From what I've read, this does not work with the Kinesis Advantage 2 at all, right? But it sounds like the original Kinesis Advantage does work with this converter, but you cannot use the other USB ports on the original Kinesis Advantage.

Additionally, media keys and whatnot will pass through directly and work based on the keyboard's configuration. You can't modify them with this converter.

I've got some parts to modify my Kinesis Advantage 1/2, but would love to have a plug-and-play converter like this instead.
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 19 June 2019, 18:28:43
@zucca, Great. I don't think TeranVH suffers from the problem you had, so he is not interested in this fix probably.

@senkwich, I think the converter sitll doesn't work with Kinesis Advantage 2 unless they update firmware and change order of USB intefaces. The converter expects that the first interface is keyboard but it is not on the keyboard. (It has also same problem on Apple Magic keyboard.)
This is converter firmware limitation and I have had plan to fix the limitation but didn't finish it yet, mainly because I don't have keyboard like that for test.

I can't remember if I have heard from users about 'Kinesis Advantage'.
Title: Re: USB to USB keyboard converter
Post by: senkwich on Wed, 19 June 2019, 20:55:09
@senkwich, I think the converter sitll doesn't work with Kinesis Advantage 2 unless they update firmware and change order of USB intefaces. The converter expects that the first interface is keyboard but it is not on the keyboard. (It has also same problem on Apple Magic keyboard.)
This is converter firmware limitation and I have had plan to fix the limitation but didn't finish it yet, mainly because I don't have keyboard like that for test.

I can't remember if I have heard from users about 'Kinesis Advantage'.
I just ordered a couple from 1upkeyboards, so I'd be willing to be a tester to help figure this out and/or pitch in some code myself at https://github.com/tmk/tmk_keyboard/tree/master/converter/usb_usb

My availability will most likely open up to dive in around August. :)
Title: Re: USB to USB keyboard converter
Post by: deadtree123 on Wed, 26 June 2019, 01:23:53
hey just wanted to pop in this thread and say thanks. I got the hasu usb controller last week, works great.  works perfectly with all layers I programmed into it. very very very very happy with it. :thumb: :thumb: :thumb:
Title: Re: USB to USB keyboard converter
Post by: zucca on Thu, 27 June 2019, 17:44:48
Well, time to give back something to the community.

I analyzed the HASU's code for the F24 hook, and I adapted it to the TaranVH .ahk integration by removing the modifier keys:

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,  NO,
    ESC,      F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PCMM,         VOLD,VOLU,MUTE,
    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, JYEN,BSPC,     INS, HOME,PGUP,    INT6,PSLS,PAST,PMNS,
    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,     BSLS,     DEL, END, PGDN,    P7,  P8,  P9,  PPLS,
    F20, A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     NUHS,ENT,                         P4,  P5,  P6,  PCMM,
    INT2,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     RO,  INT3,          UP,           P1,  P2,  P3,  PENT,
    LANG2,LANG1,INT1,MHEN,         SPC,        HENK,KANA,LANG4,LANG3,INT4,INT5,     LEFT,DOWN,RGHT,    P0,       PDOT,PEQL
    ),
    UNIMAP(
              TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
    TRNS,     TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,          TRNS,TRNS,TRNS,         TRNS,TRNS,TRNS,
    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,TRNS,TRNS,    TRNS,TRNS,TRNS,TRNS,
    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,     TRNS,TRNS,TRNS,    TRNS,TRNS,TRNS,TRNS,
    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,TRNS,                        TRNS,TRNS,TRNS,TRNS,
    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,END, PGDN,DOWN,     TRNS,TRNS,          TRNS,         TRNS,TRNS,TRNS,TRNS,
    TRNS,TRNS,TRNS,TRNS,          TRNS,          TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,TRNS,TRNS,     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;
}

Please note that the F24 key is replaced with NO, the rest are obvious changes.
It seems you need to write there the key from this list:
https://github.com/tmk/tmk_keyboard/wiki/Keycode (https://github.com/tmk/tmk_keyboard/wiki/Keycode)
without the "KC_" prefix.

For the reference here the F23 hook:

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,  NO, F24,
    ESC,      F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PCMM,         VOLD,VOLU,MUTE,
    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, JYEN,BSPC,     INS, HOME,PGUP,    INT6,PSLS,PAST,PMNS,
    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,     BSLS,     DEL, END, PGDN,    P7,  P8,  P9,  PPLS,
    F20, A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     NUHS,ENT,                         P4,  P5,  P6,  PCMM,
    INT2,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     RO,  INT3,          UP,           P1,  P2,  P3,  PENT,
    LANG2,LANG1,INT1,MHEN,         SPC,        HENK,KANA,LANG4,LANG3,INT4,INT5,     LEFT,DOWN,RGHT,    P0,       PDOT,PEQL
    ),
    UNIMAP(
              TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
    TRNS,     TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,          TRNS,TRNS,TRNS,         TRNS,TRNS,TRNS,
    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,TRNS,TRNS,    TRNS,TRNS,TRNS,TRNS,
    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,     TRNS,TRNS,TRNS,    TRNS,TRNS,TRNS,TRNS,
    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,TRNS,                        TRNS,TRNS,TRNS,TRNS,
    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,END, PGDN,DOWN,     TRNS,TRNS,          TRNS,         TRNS,TRNS,TRNS,TRNS,
    TRNS,TRNS,TRNS,TRNS,          TRNS,          TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,TRNS,TRNS,     TRNS,     TRNS,TRNS
    ),
};


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

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

also here the F23 was replaced with NO.

@zucca, Great. I don't think TeranVH suffers from the problem you had, so he is not interested in this fix probably.

I am not so sure, in the Youtube video he stated the need to plug first the USB-USB converter and then the keyboard after the PC is started up. Moreover also here:
https://github.com/TaranVH/2nd-keyboard/issues/45#issuecomment-455648812 (https://github.com/TaranVH/2nd-keyboard/issues/45#issuecomment-455648812)
he wrote:
Quote
Just unplug and re-plug a normal keyboard 10 times!

Anyway I posted this also in the LTT forum:
https://linustechtips.com/main/topic/1026955-can-your-keyboard-do-this/?do=findComment&comment=12603756 (https://linustechtips.com/main/topic/1026955-can-your-keyboard-do-this/?do=findComment&comment=12603756)

I can't do more.

Finally a little typo correction:

You can build with `make -f Maefile.unimap` in comand line. Or just use attached HEX file.

I think you meant:

Code: [Select]
make -f Makefile.unimap
Thanks again HASU, I hope to deal with you in the future again. You are a real gentleman.

PS: In the attachments I share the F24, F23, F22 hook compatible with the TaranVH .ahk 
Title: Re: USB to USB keyboard converter
Post by: AdrianMan on Thu, 04 July 2019, 08:33:59
I would like to confirm compatibility with my new Realforce R2TL-US3-IV/AHBZ32 . Works great and the default FN key still works as intended for built in combos (ex FN+ F11 Caps/Ctrl swap)

Cheers and thanks for the work Hasu !

Title: Re: USB to USB keyboard converter
Post by: mblsha on Sat, 06 July 2019, 09:56:47
Just received my converter from 1UP Keyboards and it seems to work fine with Kinesis Advantage2, which is reported here as unsupported: was able to do some basic customizations through the web editor, media keys don't work as expected.

Very excited to finally do some heavy customizations!
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 06 July 2019, 16:43:51
Just received my converter from 1UP Keyboards and it seems to work fine with Kinesis Advantage2, which is reported here as unsupported: was able to do some basic customizations through the web editor, media keys don't work as expected.

Very excited to finally do some heavy customizations!

Thanks for reporting and glad to hear that!
Converter firmware has been fixed some bugs and evolved gradually since its incompatiblity reported in 2016, and Kinesis firmware updates since then may involve this perhaps.

Updated compatibilty list in first post.
Title: Re: USB to USB keyboard converter
Post by: mblsha on Sat, 20 July 2019, 11:11:22
Tried to plug my Planck EZ with QMK firmware into the USB-USB converter and it doesn't work. What configuration options should I check?

I tried disabling NKRO but it didn't help (tried both the config options, and the `keymap_config.nkro = !keymap_config.nkro` approach at runtime).

I want to try using this keyboard with USB pedals, and on Mac it needs to be seen as a single USB device, USB-USB converter should help with that.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 20 July 2019, 18:53:56
No configuration for the converter basically, except for keymapping.

'USB descriptor' would be helpful for debug if your keyboard doesn't work.
Refer this for how to get 'USB descriptor'. https://github.com/tmk/tmk_keyboard/wiki/USB-Descriptor

And do you have link to explanation about "keymap_config.nkro" config?

Did you try this?
https://github.com/qmk/qmk_firmware/blob/421125211741993ba874068dadf4ab371d4d13de/docs/faq_debug.md#nkro-doesnt-work

Which USB pedals are you using and do they work with the converter?


Tried to plug my Planck EZ with QMK firmware into the USB-USB converter and it doesn't work. What configuration options should I check?

I tried disabling NKRO but it didn't help (tried both the config options, and the `keymap_config.nkro = !keymap_config.nkro` approach at runtime).

I want to try using this keyboard with USB pedals, and on Mac it needs to be seen as a single USB device, USB-USB converter should help with that.

Title: Re: USB to USB keyboard converter
Post by: mblsha on Sun, 21 July 2019, 05:32:21
'USB descriptor' would be helpful for debug if your keyboard doesn't work.

Product ID:   0x6060
Vendor ID:   0xfeed
Version:   0.00
Serial Number:   0
Manufacturer:   OLKB

And do you have link to explanation about "keymap_config.nkro" config?

Code is similar to this, but I mapped it to a key (including the eeconfig_read_keymap() call):
https://github.com/tmk/tmk_keyboard/blob/cf6df9db5fa6123b418ca29455d467e4455c0ebd/tmk_core/common/bootmagic.c#L86-L89

Did you try this?
https://github.com/qmk/qmk_firmware/blob/421125211741993ba874068dadf4ab371d4d13de/docs/faq_debug.md#nkro-doesnt-work

I tried this, but I wasn't sure I was hitting the key combinations correctly, so I just created my custom key handler and used the same code it's internally using. Hopefully I haven't missed anything.

Which USB pedals are you using and do they work with the converter?

The ones I currently have are plugged directly to the Kinesis Advantage2 keyboard and can be remapped via its onboard keyswapping facilities, they should work fine as long as the keyboard is fine as well. But I'm  thinking on getting the Kinesis Savant Elite2 pedals in order to use them with the Planck.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 21 July 2019, 07:58:57
'USB descriptor' would be helpful for debug if your keyboard doesn't work.

Product ID:   0x6060
Vendor ID:   0xfeed
Version:   0.00
Serial Number:   0
Manufacturer:   OLKB

More detailed USB descriptor would be helpful, you need tool like 'lsusb' to get descriptor.
https://github.com/tmk/tmk_keyboard/wiki/USB-Descriptor


Quote
And do you have link to explanation about "keymap_config.nkro" config?

Code is similar to this, but I mapped it to a key (including the eeconfig_read_keymap() call):
https://github.com/tmk/tmk_keyboard/blob/cf6df9db5fa6123b418ca29455d467e4455c0ebd/tmk_core/common/bootmagic.c#L86-L89

The converter doesn't support NKRO from the beginning so you don't have to disable NKRO on the converter.
Instead, you want to disable NKRO on QMK firmware of your keyboard if keyboard doesn't switches from NKRO to 6KRO mode automatically.

Does the keyboard works with UEFI/BIOS interface screen normally? If so it seems to swich the modes properly.


Quote
Did you try this?
https://github.com/qmk/qmk_firmware/blob/421125211741993ba874068dadf4ab371d4d13de/docs/faq_debug.md#nkro-doesnt-work

I tried this, but I wasn't sure I was hitting the key combinations correctly, so I just created my custom key handler and used the same code it's internally using. Hopefully I haven't missed anything.

Just try holding all keys on your text editor in order like: asdfghj
If the keyboard is in 6KRO mode 'j'(7th key) is not registered on computer.


Quote
Which USB pedals are you using and do they work with the converter?

The ones I currently have are plugged directly to the Kinesis Advantage2 keyboard and can be remapped via its onboard keyswapping facilities, they should work fine as long as the keyboard is fine as well. But I'm  thinking on getting the Kinesis Savant Elite2 pedals in order to use them with the Planck.

Ah, I see.

Title: Re: USB to USB keyboard converter
Post by: mblsha on Sun, 21 July 2019, 09:24:39
More detailed USB descriptor would be helpful, you need tool like 'lsusb' to get descriptor.
https://github.com/tmk/tmk_keyboard/wiki/USB-Descriptor

I'm on a Mac and lsusb doesn't show much info. Here's a screenshot of IORegistryExplorer, hope that helps:
https://imgur.com/a/8cv5W8d

And full output of the mac version of lsusb:

        Planck:

          Product ID: 0x6060
          Vendor ID: 0xfeed
          Version: 0.00
          Serial Number: 0
          Speed: Up to 12 Mb/sec
          Manufacturer: OLKB
          Location ID: 0x14300000 / 9
          Current Available (mA): 500
          Current Required (mA): 500
          Extra Operating Current (mA): 0

Does the keyboard works with UEFI/BIOS interface screen normally? If so it seems to swich the modes properly.

Verified: I can boot to BIOS using this keyboard on an old laptop.

Just try holding all keys on your text editor in order like: asdfghj
If the keyboard is in 6KRO mode 'j'(7th key) is not registered on computer.

Verified: the custom key with keymap_config.nkro works: it detects only up to 6 keypresses.
Title: Re: USB to USB keyboard converter
Post by: mblsha on Sun, 21 July 2019, 09:51:45
Was able to run USB Descriptor Dumper on a VM with Windows:
https://pastebin.com/Qv9vgvPz
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 22 July 2019, 06:36:12
Thanks for the USB descripter.
I couldn't find any clue there unfortunately, though. And NKRO/6KRO switching doesn't seem to be the cause in that case.

Could you show output on debug console when the keyboard is plugged then?
Use hid_listen to see debug prints from the converter.
https://github.com/tmk/tmk_keyboard/wiki#debug-console
Title: Re: USB to USB keyboard converter
Post by: mblsha on Mon, 22 July 2019, 13:48:32
Not sure whether I should try any Magic commands (they don't seem to work, as the COMMAND_ENABLED is commented out in the Makefile).

// plugging the Planck EZ
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
host.Task: 7159
usb_state: 90
speed: full
// pressing the keys do not result in any output

// unplugging
usb_state: 12

// plugging the Kinesis Advantage2
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
host.Task: 3583
usb_state: 90
speed: full
input 1: 00 00 1D 00 00 00 00 00
state:  00 00 1D 00 00 00 00 00
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 24 July 2019, 07:35:15
Thanks for testing.

Not sure whether I should try any Magic commands (they don't seem to work, as the COMMAND_ENABLED is commented out in the Makefile).

// plugging the Planck EZ
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
host.Task: 7159
usb_state: 90
speed: full
// pressing the keys do not result in any output


hmm, the converter seems to initialize and recogize the keyboard properly,  I can't see why it doesn't register any key unfortunately :(

Did you try the latest firmware on the converter yet? You can get it from Keyboard Editor.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb

With the latest firmware console shows version string like below when it starts up.

Code: [Select]
TMK:8449ad38/LUFA


Planck EZ uses STM32F3 mcu and QMK/Chibios firmware and I don't own and haven't tried any similar keyboard like that so far. I'm missing something imporant to be supported in the converter firmware, perhaps.
Then, I'll have to find keyboard with similar mcu and test QMK/Chibios on it with the converter when I get time.
Title: Re: USB to USB keyboard converter
Post by: mblsha on Thu, 25 July 2019, 01:32:13
Did you try the latest firmware on the converter yet? You can get it from Keyboard Editor.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb

I thought that I built the last version from source, but it was a couple of weeks out of date. Here's the output:

Code: [Select]
TMK:8449ad38/LUFA

usb_state: 12
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
host.Task: 7163
usb_state: 90
speed: full

USB configured.

Keyboard start.

Still doesn't work though. Will try to help if there's anything else I could do.
Title: Re: USB to USB keyboard converter
Post by: Harima on Mon, 12 August 2019, 17:52:10
Hi hasu, I'm trying out a new keyboard (Asus Strix Tactic Pro) that has macro buttons that are configurable via the software. The keyboard report for all of the macro keys as default are:

input 1:  00 00 00 00 00 00 00 00
state:  00 00 00 00 00 00 00 00

but if I bind them to a bind-able key it will report that keycode correctly.

Can I set these blank keys to something else? I'm not sure how I would set it up via keymap_common.h. Could I make them F13-24 or something? The keyboard software won't let me bind them to F13-24
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 12 August 2019, 18:56:13
Hi hasu, I'm trying out a new keyboard (Asus Strix Tactic Pro) that has macro buttons that are configurable via the software. The keyboard report for all of the macro keys as default are:

input 1:  00 00 00 00 00 00 00 00
state:  00 00 00 00 00 00 00 00

but if I bind them to a bind-able key it will report that keycode correctly.

Can I set these blank keys to something else? I'm not sure how I would set it up via keymap_common.h. Could I make them F13-24 or something? The keyboard software won't let me bind them to F13-24

The converter can handle key if you see vlaue other than '00' in 'input 1' line when it is depressed.
The value is exact HID usage and corespond to index of array in keymap_common.h. You can change KEYMAP_ALL() macro as you want to use it in keymap.c
https://github.com/tmk/tmk_keyboard/blob/master/converter/usb_usb/keymap_common.h#L80-L111

Title: Re: USB to USB keyboard converter
Post by: Harima on Mon, 12 August 2019, 19:31:28
Good to know. Just a few moments ago I figured out how to trick the software to accepting all the keycodes  :p
Title: Re: USB to USB keyboard converter
Post by: Harima on Tue, 13 August 2019, 03:37:46
I set KC_HENK (89) on my JIS layout keyboard as Space (2C) and I noticed I've been missing spaces, but I don't know if its from the keyboard or the converter

Code: [Select]
input 1:  00 00 17 00 00 00 00 00
state:  00 00 17 00 00 00 00 00
keyboard_report: 00 00 00 00 17 00 00 00
input 1:  00 00 00 00 00 00 00 00
state:  00 00 00 00 00 00 00 00
input 1:  00 00 00 00 00 00 00 00
keyboard_report: 00 00 00 00 00 00 00 00
state:  00 00 00 00 00 00 00 00
input 1:  00 00 00 00 00 00 00 00
state:  00 00 00 00 00 00 00 00
input 1:  00 00 0C 00 00 00 00 00
state:  00 00 0C 00 00 00 00 00
keyboard_report: 00 00 0C 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_report: 00 00 00 00 00 00 00 00

I had hid_listen up while I was typing and this was supposed to be t(space)i but my KC_HENK (89) Space key just showed up as 00
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 13 August 2019, 05:04:33
What is your "JIS layout keyboard" exactly? manufacturer, model name  and pic of the key would be kind of useful.
And your keymap would be uselful to debug. Share your keymap editor URL or keymap source.


Can you get space correctly on computer when the key is pressed solely?
And the missing space happens only when the key is typed with other keys like 't(space)i'?
Title: Re: USB to USB keyboard converter
Post by: Harima on Tue, 13 August 2019, 10:30:05
What is your "JIS layout keyboard" exactly? manufacturer, model name  and pic of the key would be kind of useful.
And your keymap would be uselful to debug. Share your keymap editor URL or keymap source.

ASUS Strix Tactic Pro

entry in keymap_common.h
Code: [Select]
/*             ,---.   ,---------------. ,---------------. ,---------------. ,-----------.
 *             |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
 *             `---'   `---------------' `---------------' `---------------' `-----------'
 * ,-------.   ,-----------------------------------------------------------. ,-----------. ,---------------.
 * |F13|F18|   |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  ^|JPY|Bsp| |Ins|Hom|PgU| |NmL|  /|  *|  -|
 * |-------|   |-----------------------------------------------------------| |-----------| |---------------|
 * |F14|F19|   |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  @|  [| Retn| |Del|End|PgD| |  7|  8|  9|  +|
 * |-------|   |------------------------------------------------------`    | `-----------' |-----------|   |
 * |F15|F20|   |CapsL |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  :|  ]|    |               |  4|  5|  6|   |
 * |-------|   |-----------------------------------------------------------|     ,---.     |---------------|
 * |F16|F21|   |Shft    |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /| RO|Shift |     |Up |     |  1|  2|  3|Ent|
 * |-------|   |-----------------------------------------------------------| ,-----------. |-----------|   |
 * |F17|F22|   |Ctl|Gui|Alt|MHEN|      Space      |HENK|KNA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| |      0|  .|   |
 * `-------'   `-----------------------------------------------------------' `-----------' `---------------'
 *                               ,-----------.
 *                               |F23|F24|Exe|
 *                               `-----------'
 */
#define KEYMAP_STP( \
            K68,K69,K6A,K6B,K6C,K6D,K6E,K6F,K70,K71,K72,K73,K74,                                           \
    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,                            \
    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K89,K2A,  K49,K4A,K4B,  K53,K54,K55,K56,          \
    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K28,  K4C,K4D,K4E,  K5F,K60,K61,K57,          \
    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,K32,                        K5C,K5D,K5E,              \
    KE1,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,        K87,KE5,      K52,      K59,K5A,K5B,K58,          \
    KE0,KE3,KE2,K8B,    K2C,        K8A,K88,KE6,KE7,K65,KE4,      K50,K51,K4F,  K62,    K63               \
) KEYMAP_ALL( \
            K68,K69,K6A,K6B,K6C,K6D,K6E,K6F,K70,K71,K72,K73,                                              \
    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,  NO, NO, NO, NO,  NO,      \
    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K89,K2A,  K49,K4A,K4B,  K53,K54,K55,K56, NO, NO,  \
    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K32,  K4C,K4D,K4E,  K5F,K60,K61,K57, NO, NO,  \
    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,    K32,K28,                K5C,K5D,K5E,NO,  NO, NO,  \
    KE1,NO, K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,    K87,KE5,      K52,      K59,K5A,K5B,NO,  K74, NO, \
    KE0,KE3,KE2,K8B,NO,     K2C,    NO, K8A,K88,KE6,KE7,K65,KE4,  K50,K51,K4F,  K62,    K63,K58, NO, NO   \
)

keymap.c
Code: [Select]
#include "action_layer.h "
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* 0: Chat Layout */
    KEYMAP_STP(
          FN9,FN10,FN11,FN12,FN13,      FN0,NUBS,NUHS,BSLS,M,      LALT, FN0, P0,                                                          \
    ESC,  F1,  F2,  F3,  F4,   F5,  F6,  F7,  F8,    F9,  F10,  F11, F12,          PSCR,SLCK,BRK,                                          \
    NUBS, 1,   2,   3,   4,   5,   6,   7,   8,   9,    0, MINS,  EQL, JPY, BSPC,  INS, HOME,PGUP,    NLCK,PSLS,PAST,PMNS,                 \
    TAB,  Q,   W,   E,   R,   T,   Y,   U,   I,   O,    P, LBRC, RBRC, ENT,        DEL, END, PGDN,    P7,  P8,  P9,  PPLS,                 \
    LSFT, A,   S,   D,   F,   G,   H,   J,   K,   L, SCLN, QUOT, NUHS,                                P4,  P5,  P6,                        \
    LSFT, Z,   X,   C,   V,   B,   N,   M,           COMM, DOT,  SLSH, BSLS,RSFT,        UP,          P1,  P2,  P3,  PENT,                 \
    LCTL,LGUI,LALT,SPC,  LALT,          SPC,KANA,RALT,           RGUI, APP, RCTL,  LEFT,DOWN,RGHT,    P0,       PDOT),                     \
    /* 1: FN1 */
    KEYMAP_STP(
          TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,                                                    \
    TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,              TRNS, TRNS, TRNS,                           \
    TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,  TRNS, TRNS, TRNS,   TRNS, TRNS, TRNS, TRNS, \
    TRNS, ESC,  P8, P9, P0, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,              TRNS, TRNS, TRNS,   TRNS, TRNS, TRNS, TRNS, \
    TRNS, P4, P2, P6, PAST, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,       TRNS,                                  TRNS, TRNS, TRNS,       \
    TRNS, TRNS, TRNS, PDOT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,       TRNS, TRNS,             TRNS,          TRNS, TRNS, TRNS, TRNS, \
    TRNS, BSLS, TRNS, TRNS,       TRNS,             TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,        TRNS, TRNS, TRNS,   TRNS, TRNS),               
};

Quote
Can you get space correctly on computer when the key is pressed solely?
And the missing space happens only when the key is typed with other keys like 't(space)i'?

Code: [Select]
input 1:  00 00 8A 00 00 00 00 00
state:  00 00 8A 00 00 00 00 00
keyboard_report: 00 00 2C 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_report: 00 00 00 00 00 00 00 00

This is what it normally looks like
Missing space does happen when typed with other keys. I can be typing normally and the space just doesn't come out, even though I'm 100% positive I pressed it
Space as Space works fine through the converter
Update: I remapped HENK to LCTRL, typed "a," held the new CTRL and pressed "a" twice. The result was: Select all, typed "a." LCTRL was released even though I was holding it. Same thing happened when remapping MHEN to LCTRL. It did not happen when I binded Space to LCTRL. Hmm.
Update 2: I've now tried it with the bottom row set as LCTRL. Only MHEN, HENK, and KANA result in: Select all, type "a".

USB Descriptor
More
Connection Status Device connected
Current Configuration 1
Speed Full (12 Mbit/s)
Device Address 21
Number Of Open Pipes 3

Device Descriptor ASUS Strix Tactic Pro Gaming Keyboard
Offset Field Size Value Description
0 bLength 1 12h 
1 bDescriptorType 1 01h Device
2 bcdUSB 2 0200h USB Spec 2.0
4 bDeviceClass 1 00h Class info in Ifc Descriptors
5 bDeviceSubClass 1 00h 
6 bDeviceProtocol 1 00h 
7 bMaxPacketSize0 1 40h 64 bytes
8 idVendor 2 195Dh Itron Technology iONE
10 idProduct 2 2039h 
12 bcdDevice 2 0045h 0.45
14 iManufacturer 1 01h "ASUS"
15 iProduct 1 02h "ASUS Strix Tactic Pro Gaming Keyboard"
16 iSerialNumber 1 00h 
17 bNumConfigurations 1 01h 

Configuration Descriptor 1 Bus Powered, 100 mA
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 02h Configuration
2 wTotalLength 2 0054h 
4 bNumInterfaces 1 03h 
5 bConfigurationValue 1 01h 
6 iConfiguration 1 00h 
7 bmAttributes 1 A0h Bus Powered, Remote Wakeup
 4..0: Reserved  ...00000   
 5: Remote Wakeup  ..1.....  Yes
 6: Self Powered  .0......  No, Bus Powered
 7: Reserved (set to one)
(bus-powered for 1.0)  1.......   
8 bMaxPower 1 32h 100 mA

Interface Descriptor 0/0 HID, 1 Endpoint
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 04h Interface
2 bInterfaceNumber 1 00h 
3 bAlternateSetting 1 00h 
4 bNumEndpoints 1 01h 
5 bInterfaceClass 1 03h HID
6 bInterfaceSubClass 1 01h Boot Interface
7 bInterfaceProtocol 1 01h Keyboard
8 iInterface 1 00h 

HID Descriptor
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 21h HID
2 bcdHID 2 0111h 1.11
4 bCountryCode 1 00h 
5 bNumDescriptors 1 01h 
6 bDescriptorType 1 22h Report
7 wDescriptorLength 2 0041h 65 bytes

Endpoint Descriptor 81 1 In, Interrupt, 1 ms
Offset Field Size Value Description
0 bLength 1 07h 
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 81h 1 In
3 bmAttributes 1 03h Interrupt
 1..0: Transfer Type  ......11  Interrupt
 7..2: Reserved  000000..   
4 wMaxPacketSize 2 0040h 64 bytes
6 bInterval 1 01h 1 ms

Interface Descriptor 1/0 HID, 1 Endpoint
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 04h Interface
2 bInterfaceNumber 1 01h 
3 bAlternateSetting 1 00h 
4 bNumEndpoints 1 01h 
5 bInterfaceClass 1 03h HID
6 bInterfaceSubClass 1 01h Boot Interface
7 bInterfaceProtocol 1 02h Mouse
8 iInterface 1 00h 

HID Descriptor
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 21h HID
2 bcdHID 2 0111h 1.11
4 bCountryCode 1 00h 
5 bNumDescriptors 1 01h 
6 bDescriptorType 1 22h Report
7 wDescriptorLength 2 00FBh 251 bytes

Endpoint Descriptor 82 2 In, Interrupt, 1 ms
Offset Field Size Value Description
0 bLength 1 07h 
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 82h 2 In
3 bmAttributes 1 03h Interrupt
 1..0: Transfer Type  ......11  Interrupt
 7..2: Reserved  000000..   
4 wMaxPacketSize 2 0040h 64 bytes
6 bInterval 1 01h 1 ms

Interface Descriptor 2/0 HID, 1 Endpoint
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 04h Interface
2 bInterfaceNumber 1 02h 
3 bAlternateSetting 1 00h 
4 bNumEndpoints 1 01h 
5 bInterfaceClass 1 03h HID
6 bInterfaceSubClass 1 00h 
7 bInterfaceProtocol 1 00h 
8 iInterface 1 00h 

HID Descriptor
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 21h HID
2 bcdHID 2 0111h 1.11
4 bCountryCode 1 00h 
5 bNumDescriptors 1 01h 
6 bDescriptorType 1 22h Report
7 wDescriptorLength 2 0041h 65 bytes

Endpoint Descriptor 83 3 In, Interrupt, 1 ms
Offset Field Size Value Description
0 bLength 1 07h 
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 83h 3 In
3 bmAttributes 1 03h Interrupt
 1..0: Transfer Type  ......11  Interrupt
 7..2: Reserved  000000..   
4 wMaxPacketSize 2 0040h 64 bytes
6 bInterval 1 01h 1 ms

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 
    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 Size (8) 75 08 
    Report Count (1) 95 01 
    Input (Cnst,Ary,Abs) 81 01 
    Usage Page (LEDs) 05 08 
    Report Size (1) 75 01 
    Report Count (5) 95 05 
    Usage Minimum (Num Lock) 19 01 
    Usage Maximum (Kana) 29 05 
    Output (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 02 
    Report Size (3) 75 03 
    Report Count (1) 95 01 
    Output (Cnst,Ary,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 01 
    Usage Page (Keyboard/Keypad) 05 07 
    Usage Minimum (Undefined) 19 00 
    Usage Maximum 2A FF 00 
    Logical Minimum (0) 15 00 
    Logical Maximum (255) 26 FF 00 
    Report Size (8) 75 08 
    Report Count (6) 95 06 
    Input (Data,Ary,Abs) 81 00 
End Collection C0 

Interface 1 HID Report Descriptor Mouse
Item Tag (Value) Raw Data
Usage Page (Generic Desktop) 05 01 
Usage (Mouse) 09 02 
Collection (Application) A1 01 
    Report ID (1) 85 01 
    Usage (Pointer) 09 01 
    Collection (Physical) A1 00 
        Usage Page (Button) 05 09 
        Usage Minimum (Button 1) 19 01 
        Usage Maximum (Button 5) 29 05 
        Logical Minimum (0) 15 00 
        Logical Maximum (1) 25 01 
        Report Size (1) 75 01 
        Report Count (5) 95 05 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
        Report Size (1) 75 01 
        Report Count (3) 95 03 
        Input (Cnst,Ary,Abs) 81 01 
        Usage Page (Generic Desktop) 05 01 
        Usage (X) 09 30 
        Usage (Y) 09 31 
        Logical Minimum (-32767) 16 01 80 
        Logical Maximum (32767) 26 FF 7F 
        Report Size (16) 75 10 
        Report Count (2) 95 02 
        Input (Data,Var,Rel,NWrp,Lin,Pref,NNul,Bit) 81 06 
        Usage (Wheel) 09 38 
        Logical Minimum (-127) 15 81 
        Logical Maximum (127) 25 7F 
        Report Size (8) 75 08 
        Report Count (1) 95 01 
        Input (Data,Var,Rel,NWrp,Lin,Pref,NNul,Bit) 81 06 
        Usage Page (Consumer Devices) 05 0C 
        Usage (AC Pan) 0A 38 02 
        Report Count (1) 95 01 
        Input (Data,Var,Rel,NWrp,Lin,Pref,NNul,Bit) 81 06 
    End Collection C0 
End Collection C0 
Usage Page (Generic Desktop) 05 01 
Usage (System Control) 09 80 
Collection (Application) A1 01 
    Report ID (2) 85 02 
    Usage Minimum (System Power Down) 19 81 
    Usage Maximum (System Wake Up) 29 83 
    Logical Minimum (0) 15 00 
    Logical Maximum (1) 25 01 
    Report Size (1) 75 01 
    Report Count (3) 95 03 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
    Report Size (5) 75 05 
    Report Count (1) 95 01 
    Input (Cnst,Ary,Abs) 81 01 
End Collection C0 
Usage Page (Consumer Devices) 05 0C 
Usage (Consumer Control) 09 01 
Collection (Application) A1 01 
    Report ID (3) 85 03 
    Usage Minimum (Undefined) 19 00 
    Usage Maximum 2A FF 7F 
    Logical Minimum (0) 15 00 
    Logical Maximum (32767) 26 FF 7F 
    Report Size (16) 75 10 
    Report Count (3) 95 03 
    Input (Data,Ary,Abs) 81 00 
    Report Size (8) 75 08 
    Report Count (1) 95 01 
    Input (Cnst,Ary,Abs) 81 01 
End Collection C0 
Usage Page (Vendor-Defined 1) 06 00 FF 
Usage (Vendor-Defined 1) 09 01 
Collection (Application) A1 01 
    Report ID (6) 85 06 
    Logical Minimum (0) 15 00 
    Logical Maximum (255) 26 FF 00 
    Usage (Vendor-Defined 48) 09 30 
    Report Count (3) 95 03 
    Report Size (8) 75 08 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
End Collection C0 
Usage Page (Vendor-Defined 2) 06 01 FF 
Usage (Vendor-Defined 1) 09 01 
Collection (Application) A1 01 
    Report ID (7) 85 07 
    Logical Minimum (0) 15 00 
    Logical Maximum (255) 26 FF 00 
    Usage (Vendor-Defined 32) 09 20 
    Report Size (8) 75 08 
    Report Count (7) 95 07 
    Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02 
End Collection C0 
Usage Page (Generic Desktop) 05 01 
Usage (Keyboard) 09 06 
Collection (Application) A1 01 
    Report ID (8) 85 08 
    Usage Page (Keyboard/Keypad) 05 07 
    Report Size (8) 75 08 
    Report Count (1) 95 01 
    Input (Cnst,Ary,Abs) 81 01 
    Usage Page (Keyboard/Keypad) 05 07 
    Usage Minimum (Undefined) 19 00 
    Usage Maximum 2A FF 00 
    Logical Minimum (0) 15 00 
    Logical Maximum (255) 26 FF 00 
    Report Size (8) 75 08 
    Report Count (6) 95 06 
    Input (Data,Ary,Abs) 81 00 
End Collection C0 
Usage Page (Generic Desktop) 05 01 
Usage (Keyboard) 09 06 
Collection (Application) A1 01 
    Report ID (9) 85 09 
    Report Count (112) 95 70 
    Report Size (1) 75 01 
    Logical Minimum (0) 15 00 
    Logical Maximum (1) 25 01 
    Usage Page (Keyboard/Keypad) 05 07 
    Usage Minimum (Keyboard Left Control) 19 E0 
    Usage Maximum (Keyboard Right GUI) 29 E7 
    Usage Minimum (Undefined) 19 00 
    Usage Maximum (Keypad =) 29 67 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
    Report Count (8) 95 08 
    Report Size (1) 75 01 
    Input (Cnst,Ary,Abs) 81 01 
End Collection C0 

Interface 2 HID Report Descriptor Vendor-Defined 65280
Item Tag (Value) Raw Data
Usage Page (Vendor-Defined 1) 06 00 FF 
Usage (Vendor-Defined 65280) 0A 00 FF 
Collection (Application) A1 01 
    Report ID (1) 85 01 
    Logical Minimum (0) 15 00 
    Logical Maximum (255) 26 FF 00 
    Usage (Vendor-Defined 48) 09 30 
    Report Size (8) 75 08 
    Report Count (511) 96 FF 01 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
    Usage (Vendor-Defined 49) 09 31 
    Report Size (8) 75 08 
    Report Count (8) 95 08 
    Output (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 02 
End Collection C0 
Usage Page (Vendor-Defined 2) 06 01 FF 
Usage (Vendor-Defined 65280) 0A 00 FF 
Collection (Application) A1 01 
    Report ID (2) 85 02 
    Logical Minimum (0) 15 00 
    Logical Maximum (255) 26 FF 00 
    Usage (Vendor-Defined 48) 09 30 
    Report Size (8) 75 08 
    Report Count (7) 95 07 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
    Usage (Vendor-Defined 49) 09 31 
    Report Size (8) 75 08 
    Report Count (7) 95 07 
    Output (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 02 
End Collection C0 
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 13 August 2019, 12:00:40
Thanks for the pic, debug log and descriptors.

Hmm, it sounds to me like keyboard firmware bug or intentional design at this point.
Your keymap code looks good but I didn't compile it to test.

Download firmware from link below and try it. You will get 'b' when the Henkan(変換) key is depressed.
Let me know whether you miss 'b' during typing.

I tested this firmware with HHKB pro JP which is my only JIS keyboard in hand, and I got 'tbi' every time when I type t, Henkan and i keys. Converter firmware seems to work for Henkan key correctly.

Manufacturer of the keyboard may have new keyboard firmware to fix bugs, check their support web pages.


http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb#456C4oOW4Kmg6biL5oKGcOOOiNeA5rWM4YaA7LCD5oCG6KyB7aOw1oDimKPkrKvmq7HssoLpoJXog4PooKDguILTouKAg+GEuuWiqu6IpOysi8K615HmkKLkoo/is7zipIjqnYLplIrjoIjliaHktoXkiJXjoZHuhZ/ouKHjorLsvYPoqo7jtozgo6Pmvp3unJzjsbPvjKLhlqbmiqPij5PiiaPijaPikKPimKDnjKHujKfuhaLhhaPqhaLqhaPthaXmjaHmkKHmk6Hmh6Hmn6PsiJPsjqPsiqDmgbfinaPmj4Tij4Tuj4Huj4fumKLhmKPqmKLqmKPtmKLmmKPmlKDimKTumKHumKXugbLuiJLujqLuiqLuj5LuiaLujaLukKLuk6Luh6Lun6XuiJXujqXuiqXuj5XuiaXuhpPpl6Til6Tul6Hul6fui4DhiIrsiozul4Ptk7jIhOmIgeGsk+6ioOGHvNCqxIftj6zinrHsorDqiaEn7rCj06DvuJ7ItOW9gOafh+GhjO+js9af4Zqh64+o7rOS3Lzooo/kpJDtg4Tgs5LhroTkg4jppIjvqKPnrp3ivqftmabjj4juspHknKPiqZPpp4jiq6zmqq3kvYDtj4HjkZrnvZzlg5HkvY/mrrHvoKvcoOyOkOuCmNO65Y2D6qKs7ZGA546a6rWi6a2k7Z2S44aZ6Imt7Zqz5pa57bup55Ga6Ya26IGH6o+T5K6R74u96bqR5a6k47CY5paG4o+h7JGQ5pi84aqP7Jmd6Keo7Im77ZKb5LeH5Y+J7amG5pCy6a+N6KiL7aen54Ww64ij4rKX5I+p6qu/6pq+5aiv7Z2r6ruc742u65aY5rGW6a6d6r2H5ra17a+u55yr7peh7420556Y4L2h766l7ru075iz7bW27LqH5K++76Oq65q65LGv646T7Ieq7pWy47+d6LyP4Y+j76u076a/472v4ryx6beC74a766C847qP5L6T7K+s75u467G+6r2f6a+N4oCL7pCA
Title: Re: USB to USB keyboard converter
Post by: Harima on Tue, 13 August 2019, 12:04:37
Thanks, I'll try it out. Check out my edit to the post above

Update: It happens with your firmware as well. At first, I was just doing B(Henkan), Space and it seems normal. But as soon as I started typing the string "asdfb" in succession, b failed and I made sure that each press was depressed all the way. It also appeared again on the hid_listen. It might be a keyboard firmware bug

Update 2: I can confirm that it is the keyboard's firmware. I connected it without the converter and tried to record macros on my Logitech mouse's software and confirmed that Muhenkan, Henkan, and Katakana/Hiragana keys when held release after pressing any other key. I will try to contact the manufacturer. Thanks
Title: Re: USB to USB keyboard converter
Post by: GreyGnome on Thu, 15 August 2019, 21:44:02
Hi, I just got my USB to USB converter and I can't seem to talk to it. Here's what happens when I run dfu-programmer in debug mode. This is on my Lenovo 430s running Fedora 28 Linux. I notice that dfu-programmer hasthe proper chip_id and vendor_id. What can I do next? Thanks.

[schwager@rodin usb_usb]$ sudo dfu-programmer atmega32u4 read --debug 9
     target: atmega32u4
    chip_id: 0x2ff4
  vendor_id: 0x03eb
    command: read
      quiet: false
      debug: 9
device_type: AVR
------ command specific below ------

0%                            100%  Reading 0x7000 bytes...
[ X  ERROR
Memory read error, use debug for more info.
[schwager@rodin usb_usb]$ dmesg | tail
[52398.591346] usb 1-1.2: Product: ATm32U4DFU
[52398.591348] usb 1-1.2: Manufacturer: ATMEL
[52398.591349] usb 1-1.2: SerialNumber: 1.0.0
[52402.363932] usb 1-1.2: USB disconnect, device number 11
[52405.318225] usb 1-1.2: new full-speed USB device number 12 using ehci-pci
[52405.399738] usb 1-1.2: New USB device found, idVendor=03eb, idProduct=2ff4, bcdDevice= 0.00
[52405.399743] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[52405.399746] usb 1-1.2: Product: ATm32U4DFU
[52405.399748] usb 1-1.2: Manufacturer: ATMEL
[52405.399750] usb 1-1.2: SerialNumber: 1.0.0

Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 15 August 2019, 22:06:10
as first post says, you can use commands like below to program converter.

Code: [Select]
$ dfu-programmer atmega32u4 erase --force
$ dfu-programmer atmega32u4 flash <your_firmware.hex>
$ dfu-programmer atmega32u4 reset

Also refer to this wiki entry.
https://github.com/tmk/tmk_keyboard/wiki#flash-firmware


With the command  'dfu-programmer atmega32u4 read --debug 9' I also get same error message. I think ATmega32u4 bootloader doesn't support the 'read' command probably, and I don't use the command. Note that you don't need the command to program the converter. You can get more detailed info with '--debug 999', though.
Title: Re: USB to USB keyboard converter
Post by: Harima on Fri, 16 August 2019, 11:55:25
A keyboard that I previously thought didn't work with the converter actually works. But only when it's connected to a hub, but not when connected directly for some reason. DSI Left Handed Keyboard

More
Connection Status Device connected
Current Configuration 1
Speed Low (1.5 Mbit/s)
Device Address 11
Number Of Open Pipes 2

Device Descriptor
Offset Field Size Value Description
0 bLength 1 12h 
1 bDescriptorType 1 01h Device
2 bcdUSB 2 0200h USB Spec 2.0
4 bDeviceClass 1 00h Class info in Ifc Descriptors
5 bDeviceSubClass 1 00h 
6 bDeviceProtocol 1 00h 
7 bMaxPacketSize0 1 08h 8 bytes
8 idVendor 2 04F3h Elan Microelectronics Corp.
10 idProduct 2 0103h 
12 bcdDevice 2 0107h 1.07
14 iManufacturer 1 00h 
15 iProduct 1 00h 
16 iSerialNumber 1 00h 
17 bNumConfigurations 1 01h 

Configuration Descriptor 1 Bus Powered, 100 mA
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 02h Configuration
2 wTotalLength 2 003Bh 
4 bNumInterfaces 1 02h 
5 bConfigurationValue 1 01h 
6 iConfiguration 1 00h 
7 bmAttributes 1 A0h Bus Powered, Remote Wakeup
 4..0: Reserved  ...00000   
 5: Remote Wakeup  ..1.....  Yes
 6: Self Powered  .0......  No, Bus Powered
 7: Reserved (set to one)
(bus-powered for 1.0)  1.......   
8 bMaxPower 1 32h 100 mA

Interface Descriptor 0/0 HID, 1 Endpoint
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 04h Interface
2 bInterfaceNumber 1 00h 
3 bAlternateSetting 1 00h 
4 bNumEndpoints 1 01h 
5 bInterfaceClass 1 03h HID
6 bInterfaceSubClass 1 01h Boot Interface
7 bInterfaceProtocol 1 01h Keyboard
8 iInterface 1 00h 

HID Descriptor
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 21h HID
2 bcdHID 2 0111h 1.11
4 bCountryCode 1 00h 
5 bNumDescriptors 1 01h 
6 bDescriptorType 1 22h Report
7 wDescriptorLength 2 0036h 54 bytes

Endpoint Descriptor 81 1 In, Interrupt, 10 ms
Offset Field Size Value Description
0 bLength 1 07h 
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 81h 1 In
3 bmAttributes 1 03h Interrupt
 1..0: Transfer Type  ......11  Interrupt
 7..2: Reserved  000000..   
4 wMaxPacketSize 2 0008h 8 bytes
6 bInterval 1 0Ah 10 ms

Interface Descriptor 1/0 HID, 1 Endpoint
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 04h Interface
2 bInterfaceNumber 1 01h 
3 bAlternateSetting 1 00h 
4 bNumEndpoints 1 01h 
5 bInterfaceClass 1 03h HID
6 bInterfaceSubClass 1 00h 
7 bInterfaceProtocol 1 00h 
8 iInterface 1 00h 

HID Descriptor
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 21h HID
2 bcdHID 2 0111h 1.11
4 bCountryCode 1 00h 
5 bNumDescriptors 1 01h 
6 bDescriptorType 1 22h Report
7 wDescriptorLength 2 0034h 52 bytes

Endpoint Descriptor 82 2 In, Interrupt, 10 ms
Offset Field Size Value Description
0 bLength 1 07h 
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 82h 2 In
3 bmAttributes 1 03h Interrupt
 1..0: Transfer Type  ......11  Interrupt
 7..2: Reserved  000000..   
4 wMaxPacketSize 2 0003h 3 bytes
6 bInterval 1 0Ah 10 ms

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 
    Usage Page (LEDs) 05 08 
    Usage Minimum (Num Lock) 19 01 
    Usage Maximum (Scroll Lock) 29 03 
    Logical Minimum (0) 15 00 
    Logical Maximum (1) 25 01 
    Report Size (1) 75 01 
    Report Count (3) 95 03 
    Output (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 02 
    Report Count (5) 95 05 
    Output (Cnst,Ary,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 01 
    Usage Page (Keyboard/Keypad) 05 07 
    Usage Minimum (Keyboard Left Control) 19 E0 
    Usage Maximum (Keyboard Right GUI) 29 E7 
    Report Count (8) 95 08 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
    Report Size (8) 75 08 
    Report Count (1) 95 01 
    Input (Cnst,Ary,Abs) 81 01 
    Usage Minimum (Undefined) 19 00 
    Usage Maximum (Keyboard LANG2) 29 91 
    Logical Maximum (255) 26 FF 00 
    Report Count (6) 95 06 
    Input (Data,Ary,Abs) 81 00 
End Collection C0 

Interface 1 HID Report Descriptor Consumer Control
Item Tag (Value) Raw Data
Usage Page (Consumer Devices) 05 0C 
Usage (Consumer Control) 09 01 
Collection (Application) A1 01 
    Report ID (1) 85 01 
    Usage Minimum (Undefined) 19 00 
    Usage Maximum (AC Format) 2A 3C 02 
    Logical Minimum (0) 15 00 
    Logical Maximum (572) 26 3C 02 
    Report Count (1) 95 01 
    Report Size (16) 75 10 
    Input (Data,Ary,Abs) 81 00 
End Collection C0 
Usage Page (Generic Desktop) 05 01 
Usage (System Control) 09 80 
Collection (Application) A1 01 
    Report ID (2) 85 02 
    Usage Minimum (System Power Down) 19 81 
    Usage Maximum (System Wake Up) 29 83 
    Logical Minimum (0) 15 00 
    Logical Maximum (1) 25 01 
    Report Size (1) 75 01 
    Report Count (3) 95 03 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
    Report Count (5) 95 05 
    Input (Cnst,Ary,Abs) 81 01 
End Collection C0 
Title: Re: USB to USB keyboard converter
Post by: GreyGnome on Fri, 16 August 2019, 17:24:21
as first post says, you can use commands like below to program converter.

Code: [Select]
$ dfu-programmer atmega32u4 erase --force
$ dfu-programmer atmega32u4 flash <your_firmware.hex>
$ dfu-programmer atmega32u4 reset

OK, it looks like "sudo" was the key. As root, I'm able to do it. Thanks!

Now I have two questions:


Thanks!
Title: Re: USB to USB keyboard converter
Post by: Harima on Fri, 16 August 2019, 17:39:27
My Koolertron/Smartyao SMKD72 keyboard/numpad (https://smile.amazon.com/gp/product/B076LYKPX4/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1 (https://smile.amazon.com/gp/product/B076LYKPX4/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1)) isn't working with the converter, but it works without the converter on a PS4 where it only accepts 6KRO.

Windows 8.1
Default keymap

- Debug outputs from 'hid_listen' command
Code: [Select]
Waiting for new device:...............
Listening:


TMK:8449ad38/LUFA

usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51

USB configured.

Keyboard start.
host.Task: 2337
usb_state: 90
speed: full

USB Descriptor:
More
Connection Status Device connected
Current Configuration 1
Speed Full (12 Mbit/s)
Device Address 28
Number Of Open Pipes 2

Device Descriptor Thumb Keyboard
Offset Field Size Value Description
0 bLength 1 12h 
1 bDescriptorType 1 01h Device
2 bcdUSB 2 0200h USB Spec 2.0
4 bDeviceClass 1 00h Class info in Ifc Descriptors
5 bDeviceSubClass 1 00h 
6 bDeviceProtocol 1 00h 
7 bMaxPacketSize0 1 08h 8 bytes
8 idVendor 2 04B4h Cypress Semiconductor Corp.
10 idProduct 2 0818h 
12 bcdDevice 2 6010h 60.10
14 iManufacturer 1 01h "LingYao ShangHai"
15 iProduct 1 02h "Thumb Keyboard"
16 iSerialNumber 1 03h "081820131130"
17 bNumConfigurations 1 01h 

Configuration Descriptor 1 Bus Powered, 100 mA
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 02h Configuration
2 wTotalLength 2 003Bh 
4 bNumInterfaces 1 02h 
5 bConfigurationValue 1 01h 
6 iConfiguration 1 00h 
7 bmAttributes 1 80h Bus Powered
 4..0: Reserved  ...00000   
 5: Remote Wakeup  ..0.....  No
 6: Self Powered  .0......  No, Bus Powered
 7: Reserved (set to one)
(bus-powered for 1.0)  1.......   
8 bMaxPower 1 32h 100 mA

Interface Descriptor 0/0 HID, 1 Endpoint
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 04h Interface
2 bInterfaceNumber 1 00h 
3 bAlternateSetting 1 00h 
4 bNumEndpoints 1 01h 
5 bInterfaceClass 1 03h HID
6 bInterfaceSubClass 1 01h Boot Interface
7 bInterfaceProtocol 1 01h Keyboard
8 iInterface 1 04h "Keyboard "

HID Descriptor
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 21h HID
2 bcdHID 2 0111h 1.11
4 bCountryCode 1 21h US
5 bNumDescriptors 1 01h 
6 bDescriptorType 1 22h Report
7 wDescriptorLength 2 003Fh 63 bytes

Endpoint Descriptor 81 1 In, Interrupt, 10 ms
Offset Field Size Value Description
0 bLength 1 07h 
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 81h 1 In
3 bmAttributes 1 03h Interrupt
 1..0: Transfer Type  ......11  Interrupt
 7..2: Reserved  000000..   
4 wMaxPacketSize 2 0012h 18 bytes
6 bInterval 1 0Ah 10 ms

Interface Descriptor 1/0 HID, 1 Endpoint
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 04h Interface
2 bInterfaceNumber 1 01h 
3 bAlternateSetting 1 00h 
4 bNumEndpoints 1 01h 
5 bInterfaceClass 1 03h HID
6 bInterfaceSubClass 1 01h Boot Interface
7 bInterfaceProtocol 1 02h Mouse
8 iInterface 1 05h "Mouse"

HID Descriptor
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 21h HID
2 bcdHID 2 0111h 1.11
4 bCountryCode 1 21h US
5 bNumDescriptors 1 01h 
6 bDescriptorType 1 22h Report
7 wDescriptorLength 2 0032h 50 bytes

Endpoint Descriptor 82 2 In, Interrupt, 2 ms
Offset Field Size Value Description
0 bLength 1 07h 
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 82h 2 In
3 bmAttributes 1 03h Interrupt
 1..0: Transfer Type  ......11  Interrupt
 7..2: Reserved  000000..   
4 wMaxPacketSize 2 0008h 8 bytes
6 bInterval 1 02h 2 ms

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 
    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 (1) 95 01 
    Report Size (5) 75 05 
    Output (Cnst,Ary,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 01 
    Report Count (16) 95 10 
    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 

Interface 1 HID Report Descriptor Mouse
Item Tag (Value) Raw Data
Usage Page (Generic Desktop) 05 01 
Usage (Mouse) 09 02 
Collection (Application) A1 01 
    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,Ary,Abs) 81 01 
        Usage Page (Generic Desktop) 05 01 
        Usage (X) 09 30 
        Usage (Y) 09 31 
        Logical Minimum (-127) 15 81 
        Logical Maximum (127) 25 7F 
        Report Size (8) 75 08 
        Report Count (2) 95 02 
        Input (Data,Var,Rel,NWrp,Lin,Pref,NNul,Bit) 81 06 
    End Collection C0 
End Collection C0 


Edit: Was mashing on keys to get a response, it did but its weird, it only shows sometimes I don't know what causes it
Code: [Select]
input 1: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 00
state:  00 00 00 00 00 00 00 00
input 1: 00 00 0E 00 54 00 00 00 00 00 00 00 00 00 00 00 12 00
state:  00 00 0E 54 00 00 00 00
input 1: 00 00 60 5F 00 00 00 00 00 00 00 00 00 00 00 00 12 00
state:  00 00 60 5F 00 00 00 00
input 1: 00 00 60 00 00 00 00 00 00 00 00 00 00 00 00 00 12 00
state:  00 00 60 00 00 00 00 00
input 1: 00 00 00 0C 0B 00 00 00 00 00 00 00 00 00 00 00 12 00
state:  00 00 0C 0B 00 00 00 00
input 1: 00 00 10 11 1D 1C 14 13 19 18 17 15 00 5B 00 00 12 00
state:  00 00 10 11 1D 1C 14 13
input 1: 00 00 50 63 00 1D 1C 18 00 00 00 00 00 00 00 00 12 00
state:  00 00 50 63 1D 1C 18 00
input 1: 00 00 00 5B 00 00 00 00 00 00 00 00 00 00 00 00 12 00
state:  00 00 5B 00 00 00 00 00
input 1: 00 00 00 63 1A 18 00 00 00 00 00 00 00 00 00 00 12 00
state:  00 00 63 1A 18 00 00 00
input 1: 00 00 0B 05 04 00 00 00 00 00 00 00 00 00 00 00 12 00
state:  00 00 0B 05 04 00 00 00
input 1: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 00
state:  00 00 00 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 00
state:  00 00 00 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 00
state:  00 00 00 00 00 00 00 00
input 1: 00 00 5E 5D 00 5A 00 00 00 00 00 00 00 00 00 00 12 00
state:  00 00 5E 5D 5A 00 00 00
input 1: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 00
state:  00 00 00 00 00 00 00 00
input 1: 00 00 1B 1C 19 18 00 00 00 00 00 00 00 00 00 00 12 00
state:  00 00 1B 1C 19 18 00 00

According to aquakeytest it's 16KRO
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 16 August 2019, 21:50:50
Thanks for reporting.
According to its descriptor it looks normal keyboard(6KRO) and the converter should support it.
There may be a glitch somewehre in current converter firmware.

Aren't there something interesting in hid_listen log when connecting it with or without hub ?
How did you connect the hub, between converter and keyboard or between computer and covnerter?


A keyboard that I previously thought didn't work with the converter actually works. But only when it's connected to a hub, but not when connected directly for some reason. DSI Left Handed Keyboard

More
Connection Status Device connected
Current Configuration 1
Speed Low (1.5 Mbit/s)
Device Address 11
Number Of Open Pipes 2

Device Descriptor
Offset Field Size Value Description
0 bLength 1 12h 
1 bDescriptorType 1 01h Device
2 bcdUSB 2 0200h USB Spec 2.0
4 bDeviceClass 1 00h Class info in Ifc Descriptors
5 bDeviceSubClass 1 00h 
6 bDeviceProtocol 1 00h 
7 bMaxPacketSize0 1 08h 8 bytes
8 idVendor 2 04F3h Elan Microelectronics Corp.
10 idProduct 2 0103h 
12 bcdDevice 2 0107h 1.07
14 iManufacturer 1 00h 
15 iProduct 1 00h 
16 iSerialNumber 1 00h 
17 bNumConfigurations 1 01h 

Configuration Descriptor 1 Bus Powered, 100 mA
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 02h Configuration
2 wTotalLength 2 003Bh 
4 bNumInterfaces 1 02h 
5 bConfigurationValue 1 01h 
6 iConfiguration 1 00h 
7 bmAttributes 1 A0h Bus Powered, Remote Wakeup
 4..0: Reserved  ...00000   
 5: Remote Wakeup  ..1.....  Yes
 6: Self Powered  .0......  No, Bus Powered
 7: Reserved (set to one)
(bus-powered for 1.0)  1.......   
8 bMaxPower 1 32h 100 mA

Interface Descriptor 0/0 HID, 1 Endpoint
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 04h Interface
2 bInterfaceNumber 1 00h 
3 bAlternateSetting 1 00h 
4 bNumEndpoints 1 01h 
5 bInterfaceClass 1 03h HID
6 bInterfaceSubClass 1 01h Boot Interface
7 bInterfaceProtocol 1 01h Keyboard
8 iInterface 1 00h 

HID Descriptor
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 21h HID
2 bcdHID 2 0111h 1.11
4 bCountryCode 1 00h 
5 bNumDescriptors 1 01h 
6 bDescriptorType 1 22h Report
7 wDescriptorLength 2 0036h 54 bytes

Endpoint Descriptor 81 1 In, Interrupt, 10 ms
Offset Field Size Value Description
0 bLength 1 07h 
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 81h 1 In
3 bmAttributes 1 03h Interrupt
 1..0: Transfer Type  ......11  Interrupt
 7..2: Reserved  000000..   
4 wMaxPacketSize 2 0008h 8 bytes
6 bInterval 1 0Ah 10 ms

Interface Descriptor 1/0 HID, 1 Endpoint
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 04h Interface
2 bInterfaceNumber 1 01h 
3 bAlternateSetting 1 00h 
4 bNumEndpoints 1 01h 
5 bInterfaceClass 1 03h HID
6 bInterfaceSubClass 1 00h 
7 bInterfaceProtocol 1 00h 
8 iInterface 1 00h 

HID Descriptor
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 21h HID
2 bcdHID 2 0111h 1.11
4 bCountryCode 1 00h 
5 bNumDescriptors 1 01h 
6 bDescriptorType 1 22h Report
7 wDescriptorLength 2 0034h 52 bytes

Endpoint Descriptor 82 2 In, Interrupt, 10 ms
Offset Field Size Value Description
0 bLength 1 07h 
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 82h 2 In
3 bmAttributes 1 03h Interrupt
 1..0: Transfer Type  ......11  Interrupt
 7..2: Reserved  000000..   
4 wMaxPacketSize 2 0003h 3 bytes
6 bInterval 1 0Ah 10 ms

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 
    Usage Page (LEDs) 05 08 
    Usage Minimum (Num Lock) 19 01 
    Usage Maximum (Scroll Lock) 29 03 
    Logical Minimum (0) 15 00 
    Logical Maximum (1) 25 01 
    Report Size (1) 75 01 
    Report Count (3) 95 03 
    Output (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 02 
    Report Count (5) 95 05 
    Output (Cnst,Ary,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 01 
    Usage Page (Keyboard/Keypad) 05 07 
    Usage Minimum (Keyboard Left Control) 19 E0 
    Usage Maximum (Keyboard Right GUI) 29 E7 
    Report Count (8) 95 08 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
    Report Size (8) 75 08 
    Report Count (1) 95 01 
    Input (Cnst,Ary,Abs) 81 01 
    Usage Minimum (Undefined) 19 00 
    Usage Maximum (Keyboard LANG2) 29 91 
    Logical Maximum (255) 26 FF 00 
    Report Count (6) 95 06 
    Input (Data,Ary,Abs) 81 00 
End Collection C0 

Interface 1 HID Report Descriptor Consumer Control
Item Tag (Value) Raw Data
Usage Page (Consumer Devices) 05 0C 
Usage (Consumer Control) 09 01 
Collection (Application) A1 01 
    Report ID (1) 85 01 
    Usage Minimum (Undefined) 19 00 
    Usage Maximum (AC Format) 2A 3C 02 
    Logical Minimum (0) 15 00 
    Logical Maximum (572) 26 3C 02 
    Report Count (1) 95 01 
    Report Size (16) 75 10 
    Input (Data,Ary,Abs) 81 00 
End Collection C0 
Usage Page (Generic Desktop) 05 01 
Usage (System Control) 09 80 
Collection (Application) A1 01 
    Report ID (2) 85 02 
    Usage Minimum (System Power Down) 19 81 
    Usage Maximum (System Wake Up) 29 83 
    Logical Minimum (0) 15 00 
    Logical Maximum (1) 25 01 
    Report Size (1) 75 01 
    Report Count (3) 95 03 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
    Report Count (5) 95 05 
    Input (Cnst,Ary,Abs) 81 01 
End Collection C0 

Title: Re: USB to USB keyboard converter
Post by: Harima on Fri, 16 August 2019, 22:16:44
Thanks for reporting.
According to its descriptor it looks normal keyboard(6KRO) and the converter should support it.
There may be a glitch somewehre in current converter firmware.

Aren't there something interesting in hid_listen log when connecting it with or without hub ?
How did you connect the hub, between converter and keyboard or between computer and covnerter?


A keyboard that I previously thought didn't work with the converter actually works. But only when it's connected to a hub, but not when connected directly for some reason. DSI Left Handed Keyboard

More
Connection Status Device connected
Current Configuration 1
Speed Low (1.5 Mbit/s)
Device Address 11
Number Of Open Pipes 2

Device Descriptor
Offset Field Size Value Description
0 bLength 1 12h 
1 bDescriptorType 1 01h Device
2 bcdUSB 2 0200h USB Spec 2.0
4 bDeviceClass 1 00h Class info in Ifc Descriptors
5 bDeviceSubClass 1 00h 
6 bDeviceProtocol 1 00h 
7 bMaxPacketSize0 1 08h 8 bytes
8 idVendor 2 04F3h Elan Microelectronics Corp.
10 idProduct 2 0103h 
12 bcdDevice 2 0107h 1.07
14 iManufacturer 1 00h 
15 iProduct 1 00h 
16 iSerialNumber 1 00h 
17 bNumConfigurations 1 01h 

Configuration Descriptor 1 Bus Powered, 100 mA
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 02h Configuration
2 wTotalLength 2 003Bh 
4 bNumInterfaces 1 02h 
5 bConfigurationValue 1 01h 
6 iConfiguration 1 00h 
7 bmAttributes 1 A0h Bus Powered, Remote Wakeup
 4..0: Reserved  ...00000   
 5: Remote Wakeup  ..1.....  Yes
 6: Self Powered  .0......  No, Bus Powered
 7: Reserved (set to one)
(bus-powered for 1.0)  1.......   
8 bMaxPower 1 32h 100 mA

Interface Descriptor 0/0 HID, 1 Endpoint
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 04h Interface
2 bInterfaceNumber 1 00h 
3 bAlternateSetting 1 00h 
4 bNumEndpoints 1 01h 
5 bInterfaceClass 1 03h HID
6 bInterfaceSubClass 1 01h Boot Interface
7 bInterfaceProtocol 1 01h Keyboard
8 iInterface 1 00h 

HID Descriptor
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 21h HID
2 bcdHID 2 0111h 1.11
4 bCountryCode 1 00h 
5 bNumDescriptors 1 01h 
6 bDescriptorType 1 22h Report
7 wDescriptorLength 2 0036h 54 bytes

Endpoint Descriptor 81 1 In, Interrupt, 10 ms
Offset Field Size Value Description
0 bLength 1 07h 
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 81h 1 In
3 bmAttributes 1 03h Interrupt
 1..0: Transfer Type  ......11  Interrupt
 7..2: Reserved  000000..   
4 wMaxPacketSize 2 0008h 8 bytes
6 bInterval 1 0Ah 10 ms

Interface Descriptor 1/0 HID, 1 Endpoint
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 04h Interface
2 bInterfaceNumber 1 01h 
3 bAlternateSetting 1 00h 
4 bNumEndpoints 1 01h 
5 bInterfaceClass 1 03h HID
6 bInterfaceSubClass 1 00h 
7 bInterfaceProtocol 1 00h 
8 iInterface 1 00h 

HID Descriptor
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 21h HID
2 bcdHID 2 0111h 1.11
4 bCountryCode 1 00h 
5 bNumDescriptors 1 01h 
6 bDescriptorType 1 22h Report
7 wDescriptorLength 2 0034h 52 bytes

Endpoint Descriptor 82 2 In, Interrupt, 10 ms
Offset Field Size Value Description
0 bLength 1 07h 
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 82h 2 In
3 bmAttributes 1 03h Interrupt
 1..0: Transfer Type  ......11  Interrupt
 7..2: Reserved  000000..   
4 wMaxPacketSize 2 0003h 3 bytes
6 bInterval 1 0Ah 10 ms

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 
    Usage Page (LEDs) 05 08 
    Usage Minimum (Num Lock) 19 01 
    Usage Maximum (Scroll Lock) 29 03 
    Logical Minimum (0) 15 00 
    Logical Maximum (1) 25 01 
    Report Size (1) 75 01 
    Report Count (3) 95 03 
    Output (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 02 
    Report Count (5) 95 05 
    Output (Cnst,Ary,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 01 
    Usage Page (Keyboard/Keypad) 05 07 
    Usage Minimum (Keyboard Left Control) 19 E0 
    Usage Maximum (Keyboard Right GUI) 29 E7 
    Report Count (8) 95 08 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
    Report Size (8) 75 08 
    Report Count (1) 95 01 
    Input (Cnst,Ary,Abs) 81 01 
    Usage Minimum (Undefined) 19 00 
    Usage Maximum (Keyboard LANG2) 29 91 
    Logical Maximum (255) 26 FF 00 
    Report Count (6) 95 06 
    Input (Data,Ary,Abs) 81 00 
End Collection C0 

Interface 1 HID Report Descriptor Consumer Control
Item Tag (Value) Raw Data
Usage Page (Consumer Devices) 05 0C 
Usage (Consumer Control) 09 01 
Collection (Application) A1 01 
    Report ID (1) 85 01 
    Usage Minimum (Undefined) 19 00 
    Usage Maximum (AC Format) 2A 3C 02 
    Logical Minimum (0) 15 00 
    Logical Maximum (572) 26 3C 02 
    Report Count (1) 95 01 
    Report Size (16) 75 10 
    Input (Data,Ary,Abs) 81 00 
End Collection C0 
Usage Page (Generic Desktop) 05 01 
Usage (System Control) 09 80 
Collection (Application) A1 01 
    Report ID (2) 85 02 
    Usage Minimum (System Power Down) 19 81 
    Usage Maximum (System Wake Up) 29 83 
    Logical Minimum (0) 15 00 
    Logical Maximum (1) 25 01 
    Report Size (1) 75 01 
    Report Count (3) 95 03 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
    Report Count (5) 95 05 
    Input (Cnst,Ary,Abs) 81 01 
End Collection C0 

Turns out my copy of the repository is outdated, it works connected straight to the converter with the latest firmware.
But I was able to make it even work on my older firmware by disconnecting and reconnecting the DSI keyboard to the converter after it was connected. Sorry about that! Updating now

Any clues to why my Koolertron isn't working?
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 16 August 2019, 23:02:51
Great.
I changed source code repo drastically a few months ago, espeically for USB_Host_Shield_2.0 submodule. You may have to remove the submodule and reinit carefully by hand to update it, or just clone repo from scratch and init the submodule. Sorry for incovenience.

You can get firmware built from the semi-latest source with fixes from Keymap Editor. Try it first when you are in trouble with the converter.

If you didn't try firmware download from Keymap Editor yet, test it with the Koolertron.

Turns out my copy of the repository is outdated, it works connected straight to the converter with the latest firmware.
But I was able to make it even work on my older firmware by disconnecting and reconnecting the DSI keyboard to the converter after it was connected. Sorry about that! Updating now

Any clues to why my Koolertron isn't working?

Title: Re: USB to USB keyboard converter
Post by: Harima on Fri, 16 August 2019, 23:15:29
Code: [Select]
TMK:229693e6+/LUFA

usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51

USB configured.

Keyboard start.
host.Task: 2336
usb_state: 90
speed: full

This is the hid_listen I get using the Koolertron with the latest firmware

Great.
I changed source code repo drastically a few months ago, espeically for USB_Host_Shield_2.0 submodule. You may have to remove the submodule and reinit carefully by hand to update it, or just clone repo from scratch and init the submodule. Sorry for incovenience.

You can get firmware built from the semi-latest source with fixes from Keymap Editor. Try it first when you are in trouble with the converter.

If you didn't try firmware download from Keymap Editor yet, test it with the Koolertron.

Turns out my copy of the repository is outdated, it works connected straight to the converter with the latest firmware.
But I was able to make it even work on my older firmware by disconnecting and reconnecting the DSI keyboard to the converter after it was connected. Sorry about that! Updating now

Any clues to why my Koolertron isn't working?
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 17 August 2019, 07:14:51
Hmm, that log looks to me normal for converter startup.

I think it is still worth trying firmware downloaded from Keyboard Editor.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb


Code: [Select]
TMK:229693e6+/LUFA

usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51

USB configured.

Keyboard start.
host.Task: 2336
usb_state: 90
speed: full

This is the hid_listen I get using the Koolertron with the latest firmware

Title: Re: USB to USB keyboard converter
Post by: Harima on Sat, 17 August 2019, 11:24:49
I get the exact same hid_listen from Keymap Editor. I have to press a key really fast to get a response from hid_listen and it looks like this:

Code: [Select]
input 1: 00 00 62 00 00 00 00 00 00 00 00 00 00 00 00 00 12 00
state:  00 00 62 00 00 00 00 00


Probably not useful, but this is hid_listen when connected to soarer's converter
Code: [Select]
Listening:
wEE

remaining: 0022
22@0008 remaps
layerdefs: 00
max_layer: 00
total_macros: 00
alloc ok.


Keyboard ID: 0000
Code Set: 1
Mode: PC/XT
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 18 August 2019, 07:25:29
The converter seems to fail to request the keyboard to use 6KRO instead of 16KRO as your this previous post.
But I can't find any concrete clue on this at the moment.


I get the exact same hid_listen from Keymap Editor. I have to press a key really fast to get a response from hid_listen and it looks like this:

Code: [Select]
input 1: 00 00 62 00 00 00 00 00 00 00 00 00 00 00 00 00 12 00
state:  00 00 62 00 00 00 00 00

Title: Re: USB to USB keyboard converter
Post by: Harima on Mon, 19 August 2019, 22:13:13
Works: Vortex Core

Descriptor
More
Connection Status Device connected
Current Configuration 1
Speed Full (12 Mbit/s)
Device Address 11
Number Of Open Pipes 4

Device Descriptor USB-HID Keyboard
Offset Field Size Value Description
0 bLength 1 12h 
1 bDescriptorType 1 01h Device
2 bcdUSB 2 0110h USB Spec 1.1
4 bDeviceClass 1 00h Class info in Ifc Descriptors
5 bDeviceSubClass 1 00h 
6 bDeviceProtocol 1 00h 
7 bMaxPacketSize0 1 40h 64 bytes
8 idVendor 2 04D9h Holtek Semiconductor, Inc.
10 idProduct 2 0175h 
12 bcdDevice 2 1103h 11.03
14 iManufacturer 1 00h 
15 iProduct 1 01h "USB-HID Keyboard"
16 iSerialNumber 1 00h 
17 bNumConfigurations 1 01h 

Configuration Descriptor 1 Bus Powered, 100 mA
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 02h Configuration
2 wTotalLength 2 005Bh 
4 bNumInterfaces 1 03h 
5 bConfigurationValue 1 01h 
6 iConfiguration 1 00h 
7 bmAttributes 1 A0h Bus Powered, Remote Wakeup
 4..0: Reserved  ...00000   
 5: Remote Wakeup  ..1.....  Yes
 6: Self Powered  .0......  No, Bus Powered
 7: Reserved (set to one)
(bus-powered for 1.0)  1.......   
8 bMaxPower 1 32h 100 mA

Interface Descriptor 0/0 HID, 1 Endpoint
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 04h Interface
2 bInterfaceNumber 1 00h 
3 bAlternateSetting 1 00h 
4 bNumEndpoints 1 01h 
5 bInterfaceClass 1 03h HID
6 bInterfaceSubClass 1 01h Boot Interface
7 bInterfaceProtocol 1 01h Keyboard
8 iInterface 1 00h 

HID Descriptor
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 21h HID
2 bcdHID 2 0111h 1.11
4 bCountryCode 1 00h 
5 bNumDescriptors 1 01h 
6 bDescriptorType 1 22h Report
7 wDescriptorLength 2 0040h 64 bytes

Endpoint Descriptor 81 1 In, Interrupt, 1 ms
Offset Field Size Value Description
0 bLength 1 07h 
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 81h 1 In
3 bmAttributes 1 03h Interrupt
 1..0: Transfer Type  ......11  Interrupt
 7..2: Reserved  000000..   
4 wMaxPacketSize 2 0008h 8 bytes
6 bInterval 1 01h 1 ms

Interface Descriptor 1/0 HID, 2 Endpoints
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 04h Interface
2 bInterfaceNumber 1 01h 
3 bAlternateSetting 1 00h 
4 bNumEndpoints 1 02h 
5 bInterfaceClass 1 03h HID
6 bInterfaceSubClass 1 00h 
7 bInterfaceProtocol 1 00h 
8 iInterface 1 00h 

HID Descriptor
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 21h HID
2 bcdHID 2 0111h 1.11
4 bCountryCode 1 00h 
5 bNumDescriptors 1 01h 
6 bDescriptorType 1 22h Report
7 wDescriptorLength 2 0022h 34 bytes

Endpoint Descriptor 83 3 In, Interrupt, 1 ms
Offset Field Size Value Description
0 bLength 1 07h 
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 83h 3 In
3 bmAttributes 1 03h Interrupt
 1..0: Transfer Type  ......11  Interrupt
 7..2: Reserved  000000..   
4 wMaxPacketSize 2 0040h 64 bytes
6 bInterval 1 01h 1 ms

Endpoint Descriptor 04 4 Out, Interrupt, 1 ms
Offset Field Size Value Description
0 bLength 1 07h 
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 04h 4 Out
3 bmAttributes 1 03h Interrupt
 1..0: Transfer Type  ......11  Interrupt
 7..2: Reserved  000000..   
4 wMaxPacketSize 2 0040h 64 bytes
6 bInterval 1 01h 1 ms

Interface Descriptor 2/0 HID, 1 Endpoint
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 04h Interface
2 bInterfaceNumber 1 02h 
3 bAlternateSetting 1 00h 
4 bNumEndpoints 1 01h 
5 bInterfaceClass 1 03h HID
6 bInterfaceSubClass 1 00h 
7 bInterfaceProtocol 1 00h 
8 iInterface 1 00h 

HID Descriptor
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 21h HID
2 bcdHID 2 0111h 1.11
4 bCountryCode 1 00h 
5 bNumDescriptors 1 01h 
6 bDescriptorType 1 22h Report
7 wDescriptorLength 2 0086h 134 bytes

Endpoint Descriptor 82 2 In, Interrupt, 1 ms
Offset Field Size Value Description
0 bLength 1 07h 
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 82h 2 In
3 bmAttributes 1 03h Interrupt
 1..0: Transfer Type  ......11  Interrupt
 7..2: Reserved  000000..   
4 wMaxPacketSize 2 0040h 64 bytes
6 bInterval 1 01h 1 ms

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 
    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,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 03 
    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 (1) 95 01 
    Report Size (5) 75 05 
    Output (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 03 
    Report Count (6) 95 06 
    Report Size (8) 75 08 
    Logical Minimum (0) 15 00 
    Logical Maximum (164) 26 A4 00 
    Usage Page (Keyboard/Keypad) 05 07 
    Usage Minimum (Undefined) 19 00 
    Usage Maximum (Keyboard ExSel) 29 A4 
    Input (Data,Ary,Abs) 81 00 
End Collection C0 

Interface 1 HID Report Descriptor Vendor-Defined 1
Item Tag (Value) Raw Data
Usage Page (Vendor-Defined 1) 06 00 FF 
Usage (Vendor-Defined 1) 09 01 
Collection (Application) A1 01 
    Usage (Vendor-Defined 2) 09 02 
    Logical Minimum (0) 15 00 
    Logical Maximum (255) 26 FF 00 
    Report Size (8) 75 08 
    Report Count (64) 95 40 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
    Usage (Vendor-Defined 3) 09 03 
    Logical Minimum (0) 15 00 
    Logical Maximum (255) 26 FF 00 
    Report Size (8) 75 08 
    Report Count (64) 95 40 
    Output (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 02 
End Collection C0 

Interface 2 HID Report Descriptor System Control
Item Tag (Value) Raw Data
Usage Page (Generic Desktop) 05 01 
Usage (System Control) 09 80 
Collection (Application) A1 01 
    Report ID (1) 85 01 
    Usage Minimum (System Power Down) 19 81 
    Usage Maximum (System Wake Up) 29 83 
    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,Ary,Abs) 81 01 
End Collection C0 
Usage Page (Consumer Devices) 05 0C 
Usage (Consumer Control) 09 01 
Collection (Application) A1 01 
    Report ID (2) 85 02 
    Logical Minimum (0) 15 00 
    Logical Maximum (1) 25 01 
    Report Count (18) 95 12 
    Report Size (1) 75 01 
    Usage (AL Consumer Control Configuration) 0A 83 01 
    Usage (AL Email Reader) 0A 8A 01 
    Usage (AL Calculator) 0A 92 01 
    Usage (AL Local Machine Browser) 0A 94 01 
    Usage (Play/Pause) 09 CD 
    Usage (Stop) 09 B7 
    Usage (Scan Previous Track) 09 B6 
    Usage (Scan Next Track) 09 B5 
    Usage (Mute) 09 E2 
    Usage (Volume Decrement) 09 EA 
    Usage (Volume Increment) 09 E9 
    Usage (AC Search) 0A 21 02 
    Usage (AC Home) 0A 23 02 
    Usage (AC Back) 0A 24 02 
    Usage (AC Forward) 0A 25 02 
    Usage (AC Stop) 0A 26 02 
    Usage (AC Refresh) 0A 27 02 
    Usage (AC Bookmarks) 0A 2A 02 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
    Report Count (1) 95 01 
    Report Size (14) 75 0E 
    Input (Cnst,Ary,Abs) 81 01 
End Collection C0 
Usage Page (Generic Desktop) 05 01 
Usage (Keyboard) 09 06 
Collection (Application) A1 01 
    Report ID (4) 85 04 
    Usage Page (Keyboard/Keypad) 05 07 
    Report Count (1) 95 01 
    Report Size (8) 75 08 
    Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 03 
    Report Count (232) 95 E8 
    Report Size (1) 75 01 
    Logical Minimum (0) 15 00 
    Logical Maximum (1) 25 01 
    Usage Page (Keyboard/Keypad) 05 07 
    Usage Minimum (Undefined) 19 00 
    Usage Maximum (Keyboard Right GUI) 29 E7 
    Input (Data,Ary,Abs) 81 00 
End Collection C0 
Title: Re: USB to USB keyboard converter
Post by: belch85` on Fri, 06 September 2019, 01:09:19
Forgive me if this has been covered, I can't find any solutions elsewhere.

I bought one of these https://amzn.to/2zSpdF5 and a HASU USB > USB Converter, and have been learning basic re-mapping via the TMK Keymap Editor GUI, loading the hex file with FLIP - loving it!

BUT notice the 4x silver buttons to the left of that keyboard?  The bottom two send "b" and "m" which are easily re-mapped using the editor, but the top two are "programmable" keys.  The keyboard doesn't require any software for this macro function - the M1 key for example can be programmed by pressing Fn + M1 to start recording, then a key (or combination), then Fn + M1 to stop recording.

That functionality works with the keyboard plugged directly into PC, but as soon as I put the HASU in between, those keys are completely dead.  I've tried re-recording the macro with simple ASCII keys.

I confirmed that the keyboard doesn't lose the macro when unplugged (to put the HASU in) by leaving it unplugged for over an hour, once plugged back into the PC it remembers what key was recorded.

I tried using the The HID Listen Program debug console (with the keyboard plugged into the HASU) to see what HASU is receiving when I press the M1 key - nothing at all for the M1 key in the log, all others work.

I found some comments about EXTRAKEY_ENABLE in other forums - not sure if that's related, and I'm also not compiling my own so that's a big leap away from where I'm at.

Any clues?
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 07 September 2019, 20:06:47
Hi,
First, I believe EXTRAKEY_ENABLE is not related.
If you don't see anything on hid_listen when pressing M1, the keyboard may use its own unusual method for the key.

Can you sheare USB descriptors of the keyboard?
https://github.com/tmk/tmk_keyboard/wiki/USB-Descriptor



Forgive me if this has been covered, I can't find any solutions elsewhere.

I bought one of these https://amzn.to/2zSpdF5 and a HASU USB > USB Converter, and have been learning basic re-mapping via the TMK Keymap Editor GUI, loading the hex file with FLIP - loving it!

BUT notice the 4x silver buttons to the left of that keyboard?  The bottom two send "b" and "m" which are easily re-mapped using the editor, but the top two are "programmable" keys.  The keyboard doesn't require any software for this macro function - the M1 key for example can be programmed by pressing Fn + M1 to start recording, then a key (or combination), then Fn + M1 to stop recording.

That functionality works with the keyboard plugged directly into PC, but as soon as I put the HASU in between, those keys are completely dead.  I've tried re-recording the macro with simple ASCII keys.

I confirmed that the keyboard doesn't lose the macro when unplugged (to put the HASU in) by leaving it unplugged for over an hour, once plugged back into the PC it remembers what key was recorded.

I tried using the The HID Listen Program debug console (with the keyboard plugged into the HASU) to see what HASU is receiving when I press the M1 key - nothing at all for the M1 key in the log, all others work.

I found some comments about EXTRAKEY_ENABLE in other forums - not sure if that's related, and I'm also not compiling my own so that's a big leap away from where I'm at.

Any clues?

Title: Re: USB to USB keyboard converter
Post by: JohnRMA on Fri, 13 September 2019, 10:36:38
Hello.

 I am working on an exhibit that needs to have a wireless keyboard for users/an employee to enter names/scores, as well as another keyboard for maintenance/troubleshooting. The user keyboard needs to only have the letter/number keys and backspace/space/enter enabled, and other keys like the windows key/ctrl/alt/media keys/etc... and key combinations disabled.

 The wireless keyboard that is currently picked is https://www.amazon.ca/IOGEAR-GKB635W-Wireless-Smart-Keyboard/dp/B07934KKTS . It also has trackball/scroll wheel built in, but disabling that isn't as important.

 Would the USB to USB converter plugged into the Keyboard dongle be expected to work in this case?

 Thank you.
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 13 September 2019, 19:11:00
I think keyboard part works with the converter and you can disable the keys in keymap.

Hello.

 I am working on an exhibit that needs to have a wireless keyboard for users/an employee to enter names/scores, as well as another keyboard for maintenance/troubleshooting. The user keyboard needs to only have the letter/number keys and backspace/space/enter enabled, and other keys like the windows key/ctrl/alt/media keys/etc... and key combinations disabled.

 The wireless keyboard that is currently picked is https://www.amazon.ca/IOGEAR-GKB635W-Wireless-Smart-Keyboard/dp/B07934KKTS . It also has trackball/scroll wheel built in, but disabling that isn't as important.

 Would the USB to USB converter plugged into the Keyboard dongle be expected to work in this case?

 Thank you.

Title: Re: USB to USB keyboard converter
Post by: JohnRMA on Mon, 16 September 2019, 08:52:05
 Thanks for the reply. The keyboard shows up as both a keyboard and a mouse in the device manager, if it is plugged in through the USB-USB Converter, will it still show up like that? Or will the trackball not work?
Title: Re: USB to USB keyboard converter
Post by: Microdoted on Tue, 17 September 2019, 03:19:23
question/issue issue im hoping someone can help me with. and i apologize beforehand, as im sure this has been asked/answered, but after 2 days of searching i gave up and decided to ask.

i have a windows workstation with an ikbc mf108 (108key ansi) and picked up one of your usb to usb convertors (didnt want to try dealing with making my own). what is the proper way to deal with the 4 media keys above numpad? should i include them in a keymap? ignore them and just use the standard ansi layout? i understand that i will most likely not be able to have the converter see them as per your first post, but im not getting any keypress passed through to the system when using it no matter what keymap i use. (all work fine when not using the adaptor though). they are sending in volume_up, volume_down, etc which should pass through the adaptor, but isnt.

if someone can point me in the right direction to figure this out, i would be extremely grateful!

tried both of these so far (everything else works exactly as inteded with the exception of those 4 keys):
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
   
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
   
Title: Re: USB to USB keyboard converter
Post by: Microdoted on Wed, 18 September 2019, 02:26:22
ive done another day of troublshooting (and learning)... finally got debug working, and am getting this in the terminal for those media keys:

input 1:  00 00 00 00 00 00 00 00
state:  00 00 00 00 00 00 00 00
input 1:  00 00 00 00 00 00 00 00
state:  00 00 00 00 00 00 00 00

Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 24 September 2019, 01:28:34
Default frmware doesn't recognize any media key and doesn't pass through any key which not recognized.
Media keys usually are sent out of different endpoint from one for normal keys. You have to define custom parser code to interpret intput from the media key endpoint. The code is specific to the keyboard and you can know how the media key should be interpreted by reading USB HID report descriptor of it.

See this for how to get descriptor and search on the net.
https://github.com/tmk/tmk_keyboard/wiki/HID-Report-Descriptor
Title: Re: USB to USB keyboard converter
Post by: Harima on Wed, 25 September 2019, 01:37:07
Vortex Tab 90M works
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 25 September 2019, 03:46:20
Thanks for your report, Harima.
Updated compatibility list in the first post.
Title: Re: USB to USB keyboard converter
Post by: JohnRMA on Wed, 25 September 2019, 11:37:53
I've tried using this keyboard  https://www.amazon.ca/IOGEAR-GKB635W-Wireless-Smart-Keyboard/dp/B07934KKTS with the USB converter, however it doesn't seem to work.

I updated the firmware from http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb with Flip, and the converter itself shows up in the device manager. But no key strokes on the keyboard go through to the pc. It does work with other wired USB Keyboards we have.

 This is the descriptor from the non-working keyboard.

Code: [Select]
Information for device Smart Control (VID=0x1357 PID=0x1000):

Connection Information:
------------------------------
Device current bus speed: FullSpeed
Device supports USB 1.1 specification
Device supports USB 2.0 specification
Device address: 0x001F
Current configuration value: 0x01
Number of open pipes: 3

Device Descriptor:
------------------------------
0x12 bLength
0x01 bDescriptorType
0x0110 bcdUSB
0x00 bDeviceClass     
0x00 bDeviceSubClass   
0x00 bDeviceProtocol   
0x20 bMaxPacketSize0   (32 bytes)
0x1357 idVendor
0x1000 idProduct
0x0100 bcdDevice
0x01 iManufacturer   "HL 0000 00 00 00 01"
0x02 iProduct   "Smart Control"
0x00 iSerialNumber
0x01 bNumConfigurations

Configuration Descriptor:
------------------------------
0x09 bLength
0x02 bDescriptorType
0x0054 wTotalLength   (84 bytes)
0x03 bNumInterfaces
0x01 bConfigurationValue
0x00 iConfiguration
0xA0 bmAttributes   (Bus-powered Device, Remote-Wakeup)
0x64 bMaxPower      (200 mA)

Interface Descriptor:
------------------------------
0x09 bLength
0x04 bDescriptorType
0x00 bInterfaceNumber
0x00 bAlternateSetting
0x01 bNumEndPoints
0x03 bInterfaceClass      (Human Interface Device Class)
0x00 bInterfaceSubClass   
0x01 bInterfaceProtocol   
0x00 iInterface

HID Descriptor:
------------------------------
0x09 bLength
0x21 bDescriptorType
0x0101 bcdHID
0x00 bCountryCode
0x01 bNumDescriptors
0x22 bDescriptorType   (Report descriptor)
0x0041 bDescriptorLength

Endpoint Descriptor:
------------------------------
0x07 bLength
0x05 bDescriptorType
0x81 bEndpointAddress  (IN endpoint 1)
0x03 bmAttributes      (Transfer: Interrupt / Synch: None / Usage: Data)
0x0020 wMaxPacketSize    (1 x 32 bytes)
0x08 bInterval         (8 frames)

Interface Descriptor:
------------------------------
0x09 bLength
0x04 bDescriptorType
0x01 bInterfaceNumber
0x00 bAlternateSetting
0x01 bNumEndPoints
0x03 bInterfaceClass      (Human Interface Device Class)
0x00 bInterfaceSubClass   
0x02 bInterfaceProtocol   
0x00 iInterface

HID Descriptor:
------------------------------
0x09 bLength
0x21 bDescriptorType
0x0101 bcdHID
0x00 bCountryCode
0x01 bNumDescriptors
0x22 bDescriptorType   (Report descriptor)
0x0071 bDescriptorLength

Endpoint Descriptor:
------------------------------
0x07 bLength
0x05 bDescriptorType
0x82 bEndpointAddress  (IN endpoint 2)
0x03 bmAttributes      (Transfer: Interrupt / Synch: None / Usage: Data)
0x0020 wMaxPacketSize    (1 x 32 bytes)
0x08 bInterval         (8 frames)

Interface Descriptor:
------------------------------
0x09 bLength
0x04 bDescriptorType
0x02 bInterfaceNumber
0x00 bAlternateSetting
0x01 bNumEndPoints
0x03 bInterfaceClass      (Human Interface Device Class)
0x00 bInterfaceSubClass   
0x00 bInterfaceProtocol   
0x00 iInterface

HID Descriptor:
------------------------------
0x09 bLength
0x21 bDescriptorType
0x0101 bcdHID
0x00 bCountryCode
0x01 bNumDescriptors
0x22 bDescriptorType   (Report descriptor)
0x0044 bDescriptorLength

Endpoint Descriptor:
------------------------------
0x07 bLength
0x05 bDescriptorType
0x83 bEndpointAddress  (IN endpoint 3)
0x03 bmAttributes      (Transfer: Interrupt / Synch: None / Usage: Data)
0x0020 wMaxPacketSize    (1 x 32 bytes)
0x08 bInterval         (8 frames)

Microsoft OS Descriptor is not available. Error code: 0x0000001F

String Descriptor Table
--------------------------------
Index  LANGID  String
0x00   0x0000  0x0409
0x01   0x0409  "HL 0000 00 00 00 01"
0x02   0x0409  "Smart Control"

------------------------------

Connection path for device:
USB xHCI Compliant Host Controller
Root Hub
Generic USB Hub
Smart Control (VID=0x1357 PID=0x1000) Port: 4

Running on: Windows 10 or greater (Build Version 18362)

Brought to you by TDD v2.12.0, Aug  2 2019, 16:35:05
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 25 September 2019, 18:48:09
JohnRMA, Thanks for the descriptor. I'll update the first post.

The keyboard seems to support only NKRO mode without boot mode(6KRO), it will always send keys in NKRO report that the converter can't recognize. This is the first time I have ever seen keyboard like that iirc.
I think it has problem with some of legacy BIOS and UEFI or it may use some unclear trick for those purpose.

Could you check whether it can work with UEFI/BIOS?
Title: Re: USB to USB keyboard converter
Post by: JohnRMA on Thu, 26 September 2019, 13:37:01
Thanks for the response. The keyboard works on the UEFI of my PC, but as you expected, it does not work in the BIOS of another, older PC. 
 I will look into getting a different keyboard. In your experience, most wireless keyboards do work?
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 26 September 2019, 19:44:56
Thanks for testing.
I'm surprised by the fact that there is keyboard that doesn't support boot mode in the market and the manufacturer decided on dropping backward compatibility for legacy systems. And modern UEFI supports NKRO keyboard natively. Really good to know.

I don't have any experience with wireless keyboards but user reported Logitech Unifying keyboard worked with the coverter once.
https://geekhack.org/index.php?topic=69169.msg2682579#msg2682579


Thanks for the response. The keyboard works on the UEFI of my PC, but as you expected, it does not work in the BIOS of another, older PC. 
 I will look into getting a different keyboard. In your experience, most wireless keyboards do work?

Title: Re: USB to USB keyboard converter
Post by: JohnRMA on Tue, 01 October 2019, 12:59:27
 Ok, we tested it with a Logitech K330 and K360 (both with unifying receiver) and they both worked fine. So we'll use one of them. Thanks for all your help.
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 01 October 2019, 16:46:54
Thanks for the testing. Updated the list in the first post.

Ok, we tested it with a Logitech K330 and K360 (both with unifying receiver) and they both worked fine. So we'll use one of them. Thanks for all your help.

Title: Re: USB to USB keyboard converter
Post by: jaux on Wed, 09 October 2019, 11:55:50
Just got my GMK Uniqey C70 today and I'm very happy to report that it works well with the converter  :thumb:
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 09 October 2019, 18:47:17
Updated the list, thanks!

Just got my GMK Uniqey C70 today and I'm very happy to report that it works well with the converter  :thumb:

Title: Re: USB to USB keyboard converter
Post by: Harima on Mon, 14 October 2019, 03:12:01
Hasu, what do you use for the plastic casing around the converter? I'm interested in doing the same thing to a teensy.
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 14 October 2019, 03:41:22
I'm not sure about what you are asking but guessing you are talking about CAD software?
As first post says, the case was designed by Gouty not me, I didn't try it yet and know little. He used Autodesk Fusion 360 according to README. https://github.com/tmk/USB2USB_Converter/tree/master/3D%20Printed%20Case

I didn't try any plastic casing for the covnerter yet, except for heat shrink wrap.


.... Ah, wait ... You are referring the heat-shrink tube perhaps? If so I use transparent Sumitube A20C for this.


Hasu, what do you use for the plastic casing around the converter? I'm interested in doing the same thing to a teensy.
Title: Re: USB to USB keyboard converter
Post by: Harima on Mon, 14 October 2019, 14:00:43
I didn't try any plastic casing for the covnerter yet, except for heat shrink wrap.


.... Ah, wait ... You are referring the heat-shrink tube perhaps? If so I use transparent Sumitube A20C for this.


Hasu, what do you use for the plastic casing around the converter? I'm interested in doing the same thing to a teensy.

This is it. Thanks!
Title: Re: USB to USB keyboard converter
Post by: riangle on Tue, 12 November 2019, 15:31:04
Before I buy a controller I have a few questions:

Will this work on the newer Realforce PFU?
When the original post mentions that you cannot program the fn key. I am assuming this means you can still change another key (the win key for example) to have the same function as the Fn key. Is this true?
I recall reading something about media keys not being supported. Is this only applicable to dedicated media keys? What about adding Play/pause/volume to keys on the Fn layer?
Is it possible/difficult to return the board to it's default settings? Is this as simple as unplugging the device?

Thank you for considering tackling my litany of questions. My area of work is not in this field and I am a relative newbie.
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 12 November 2019, 17:27:01
Before I buy a controller I have a few questions:

Will this work on the newer Realforce PFU?

Some user reported it works with the converter.
I think PFU Realforce R2 is one of variants and identical to Topre R2.

Quote
When the original post mentions that you cannot program the fn key. I am assuming this means you can still change another key (the win key for example) to have the same function as the Fn key. Is this true?
True. You can use Win key to change keymap layers.

Quote
I recall reading something about media keys not being supported. Is this only applicable to dedicated media keys? What about adding Play/pause/volume to keys on the Fn layer?
Yes, you can send those media keys by key remapping on the converter, for example you can assign them with Win+cursor keys.
The converter doesn't recognize(and pass through) the media keys from the keyboard, computer recevies nothing when pressing original Realforce's Fn+cursor keys.

Quote
Is it possible/difficult to return the board to it's default settings? Is this as simple as unplugging the device?
The converter nerver change anything of the keyboard logically and physically, so the keyboard remains default setting when without the converter.
Title: Re: USB to USB keyboard converter
Post by: riangle on Tue, 12 November 2019, 18:32:15
Thank you for the quick response!

I'll almost certainly being grabbing a converter before Xmas. I'm far too used to old fn layers to do without them if I can help it. Very happy to be able to hold old habits while moving over to topre!
Title: Re: USB to USB keyboard converter
Post by: zucca on Fri, 29 November 2019, 15:52:52
Hey Hasu,

it looks like we helped somebody else:

https://linustechtips.com/main/topic/1026955-can-your-keyboard-do-this/?do=findComment&comment=12958510 (https://linustechtips.com/main/topic/1026955-can-your-keyboard-do-this/?do=findComment&comment=12958510)

 :thumb: