geekhack

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

Title: TMK USB to USB keyboard converter
Post by: hasu on Mon, 23 February 2015, 21:20:44
With this converter you can change keymap and use functions TMK firmware offers on your USB keyboard.

You can support this project by getting TMK USB-USB converter (https://geekhack.org/index.php?topic=109514.0) from me.



Troubleshoot
You have trouble or question? Post infos like below when you can ask in this thread.


Debug output
Use hid_listen (https://github.com/tmk/tmk_keyboard/wiki#hid_listen) command to see its debug outputs. Post its outputs.
Try debug firmware (https://raw.githubusercontent.com/tmk/tmk_keyboard/master/converter/usb_usb/binary/usb_usb_debug.hex) for detailed debug log, instead of default firmware.

Keyboard model name
URL of the product page would be helpful to check its specifications and manuals

OS name
Windows/Mac/Linux

USB Descriptor
If your problem is specific to your keyboard,
use TMK USB Descriptor Dumper (https://github.com/tmk/tmk_keyboard/wiki/USB:-Descriptor#usb-descriptor-dumper) to get keyboard's USB Descriptor data.
Flash Dumper firmware (https://raw.githubusercontent.com/tmk/tmk_keyboard/master/converter/usb_desc_dump/binary/usb_desc_dump.hex) onto your converter and then plug keyboard. Use hid_listen (https://github.com/tmk/tmk_keyboard/wiki#hid_listen) to get Descritpor data. Post all of outputs on hid_listen.

Also try these.
Cable and Hub
Use short and good-quality USB cable,  or plug the converter into computer directly or externally powered USB Hub.
With longer cable USB power voltage drops more at the converter and keyboard, this can cause problem especially when plug-in the devices or computer is powered up.
https://geekhack.org/index.php?topic=69169.msg3100547#msg3100547


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

1. TMK USB to USB converter
This small board is almost equivalent to USB Host Shield plus Leonardo. This is an assmebled converter and no soldering job is needed.
You can order here (https://geekhack.org/index.php?topic=109514.0) to support my project.
(https://i.imgur.com/Fi0uVGph.jpg?1) (https://geekhack.org/index.php?topic=109514.0)

More
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
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
Just plug USB Host Shield onto Arduino Leonardo, they are not small as TMK converter but work well with default firmware.
More
a. USB Host Shield:
https://create.arduino.cc/projecthub/products/arduino-usb-host-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)
https://www.sparkfun.com/products/9947

Clones(or fake) may have compatiblity issues with the library and TMK. Not recommended.
- 74HC125 vs 74AHC125 https://www.printed-droid.com/kb/usb-host-shield-repair/
- People have had problems with clones. 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)
- Fake doesn't work at all. https://github.com/felis/USB_Host_Shield_2.0/issues/744#issuecomment-1284358537 (https://github.com/felis/USB_Host_Shield_2.0/issues/744#issuecomment-1284358537)

b. Arduino Leonardo:
https://docs.arduino.cc/hardware/leonardo


3. Mini USB Host Shield 2.0 + Pro Micro
Not supported by me but this should work too. Firmware may require small fix.
https://geekhack.org/index.php?topic=80421.0




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)

The firmware depneds heavily on USB Host Shield 2.0 library (https://github.com/felis/USB_Host_Shield_2.0).

Build
You can compile firmware from source code. See TMK documentation for the detail.

https://github.com/tmk/tmk_keyboard/wiki#build-firmware

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) (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb)

Start here: Default plain layout (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb)
Or SpaceFn layout (https://geekhack.org/index.php?topic=51069.0) example on Keymap Editor (https://bit.ly/3licBwS).



Limitation



Incompatible Keyboards
The converter doesn't work with:

Some of incompatible keyboards listed here may work with the latest firmware probably, please try and report if you have any.
As of 2020-12 the converter firmware received a few bug fixes on its USB stack which improved its keyboard compatibility greatly.
 
Use this firmware (https://raw.githubusercontent.com/tmk/tmk_keyboard/master/converter/usb_usb/binary/usb_usb_debug.hex) to get detailed debug outputs on hid_listen (https://github.com/tmk/tmk_keyboard/wiki#hid_listen) if your keyboard doesn't work. And post its outputs here.



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 would be really appreciated. Please post your result in this thread.


Issues
ConnectPro KVM switch
The converter doesn't work on its DDM port of ConnectPro KVM switch. Workaround is disabling debug console. (2021-10-05)
https://geekhack.org/index.php?topic=69169.msg3085929#msg3085929
https://github.com/tmk/tmk_keyboard/issues/707
Fixed(2021-10-24)

UGREEN's usb 2.0 KVM switch
The covnerter doesn't work on Macbook pro after long sleep when connected through the KVM.
No workaround as of 2021-09.
https://github.com/tmk/tmk_keyboard/issues/703


Update
2024-03 Fix for Unicomp Mini M #773 (https://github.com/tmk/tmk_keyboard/issues/773)
2023-12 Fix startup for Poker X (https://github.com/tmk/tmk_keyboard/issues/770)
2023-12 Add suspend and remote wakeup (https://github.com/tmk/tmk_keyboard/issues/769) support(power saving)
2023-02 Ducky One 2 Mini support
2023-01 Apple Magic keyboard(A1644/A1843) support
2022-10 Update description for Ducky One 2 Mini
2022-10 Fix for HHKB Hybrid (https://github.com/tmk/tmk_keyboard/issues/738#issuecomment-1286391561)
2022/05 Fix for Anne Pro2 (https://github.com/tmk/tmk_keyboard/issues/738)
2021/10 Update firmware (https://geekhack.org/index.php?topic=69169.750)
    - Fix for ConnectPro UD-12+ KVM #707 (https://github.com/tmk/tmk_keyboard/issues/707)
    - UHS2: 500ms delay (https://geekhack.org/index.php?topic=69169.msg3073431) for bus reset for Matrix Vita
    - UHS2: Improve plugin detection in busprobe()
2020/12 Fix STALL error (https://github.com/tmk/USB_Host_Shield_2.0/issues/4)
2020/11  Fix TAP_KEY (https://github.com/tmk/tmk_keyboard/commit/02664fe72adc15eee327a557577917880dfa202b)
2020/11  Add Mechanical Locking Key support (https://github.com/tmk/tmk_keyboard/commit/df164fecc93dd09e0965a8889063e60c7c3fd259)
2020/11  Fix TOGGLE error (https://github.com/tmk/USB_Host_Shield_2.0/issues/2) and HUBPRE bit (https://github.com/tmk/tmk_keyboard/issues/658).
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 compatibility 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:
Title: Re: USB to USB keyboard converter
Post by: Harima on Sun, 15 December 2019, 23:42:49
Hi hasu,

For this https://smile.amazon.com/iKKEGOL-Control-Customized-Keyboard-Multimedia/dp/B07553KW32/ref=cm_cr_arp_d_product_top?ie=UTF8 (https://smile.amazon.com/iKKEGOL-Control-Customized-Keyboard-Multimedia/dp/B07553KW32/ref=cm_cr_arp_d_product_top?ie=UTF8) footpedal, when I connect it to the converter and check hid listen it always has ctrl pressed

Code: [Select]
Listening:


TMK:229693e6+/LUFA

usb_state: 20

USB configured.

Keyboard start.
usb_state: 40
usb_state: 50
usb_state: 51
host.Task: 2341
usb_state: 90
speed: full
input 1: 01 00 00 04 00 00 00 00 00
state:  01 00 04 00 00 00 00 00
input 1: 01 00 00 00 00 00 00 00 00
state:  01 00 00 00 00 00 00 00
input 1: 01 00 00 05 00 00 00 00 00
state:  01 00 05 00 00 00 00 00
input 1: 01 00 00 00 00 00 00 00 00
state:  01 00 00 00 00 00 00 00

usb lyzer:
Code: [Select]
Connection Status Device connected
Current Configuration 1
Speed Full (12 Mbit/s)
Device Address 30
Number Of Open Pipes 3

Device Descriptor
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 08h 8 bytes
8 idVendor 2 413Dh 
10 idProduct 2 2107h 
12 bcdDevice 2 0000h 0.00
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 0042h 
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 0104h 260 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 0010h 16 bytes
6 bInterval 1 0Ah 10 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 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 0110h 1.10
4 bCountryCode 1 00h 
5 bNumDescriptors 1 01h 
6 bDescriptorType 1 22h Report
7 wDescriptorLength 2 0029h 41 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 0008h 8 bytes
6 bInterval 1 0Ah 10 ms

Endpoint Descriptor 02 2 Out, Interrupt, 10 ms
Offset Field Size Value Description
0 bLength 1 07h 
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 02h 2 Out
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 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 

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 1) 09 01 
    Logical Minimum (0) 15 00 
    Logical Maximum (255) 26 FF 00 
    Report Size (8) 75 08 
    Report Count (8) 95 08 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02 
    Usage (Vendor-Defined 1) 09 01 
    Report Count (8) 95 08 
    Output (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 02 
    Usage Page (Consumer Devices) 05 0C 
    Usage (Undefined) 09 00 
    Logical Minimum (-128) 15 80 
    Logical Maximum (127) 25 7F 
    Report Size (8) 75 08 
    Report Count (8) 95 08 
    Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02 
End Collection C0 

Although there are options to bind a key with a modifier, without a modifier it will always have left ctrl depressed on startup and I cannot press left ctrl.
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 16 December 2019, 00:50:06
Hmm, the device sends keys in report protocol, not boot protocol.
It declares that it supports boot protocol in the descriptors but the converter seems to fail to request it for some reason. To look into or debug USB communication like this requires real device on site, it is difficult to know what happens between the keyboard and the converter only with the debug prints unfortunately.

The '01' first byte of the report indicates Report ID(1) but the converter recognizes it as modifier status(Left Control) incorrectly. If you connect the device only to the converter you can remap Left Control key as 'NO' to ignore the first byte, perhaps.

Also, when you have time could you try attached firmware and post debug prints? This will display a bit more detailed infos.
[attachmini=1]

EDIT: Updated firmware. Use this one below.
[attachmini=2]


Hi hasu,

For this https://smile.amazon.com/iKKEGOL-Control-Customized-Keyboard-Multimedia/dp/B07553KW32/ref=cm_cr_arp_d_product_top?ie=UTF8 (https://smile.amazon.com/iKKEGOL-Control-Customized-Keyboard-Multimedia/dp/B07553KW32/ref=cm_cr_arp_d_product_top?ie=UTF8) footpedal, when I connect it to the converter and check hid listen it always has ctrl pressed


Although there are options to bind a key with a modifier, without a modifier it will always have left ctrl depressed on startup and I cannot press left ctrl.

Title: Re: USB to USB keyboard converter
Post by: Harima on Tue, 17 December 2019, 21:05:58
Sorry I'm late, I tried that firmware but I get

Code: [Select]
Waiting for device:.........
so I tried making one myself but I think I'm doing something wrong.

"NO" to left control is a temporary solution but then I lose left control haha
Title: Re: USB to USB keyboard converter
Post by: D.L. on Thu, 19 December 2019, 15:50:31
Just got one of these converters from 1-Up; it does not appear to work with the Logitech G810 Orion Spectrum keyboard. I've tried it on three separate computers (two Win 10 PCs and one Mac) and in no case does the keyboard go through it's boot sequence where the backlights flash on. The converter definitely works, I'm using it right now with another keyboard.
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 19 December 2019, 17:04:19
Thanks for you report. I updated the incompatibility list in first post.
Btw, what's your 'another keyboard'?

Just got one of these converters from 1-Up; it does not appear to work with the Logitech G810 Orion Spectrum keyboard. I've tried it on three separate computers (two Win 10 PCs and one Mac) and in no case does the keyboard go through it's boot sequence where the backlights flash on. The converter definitely works, I'm using it right now with another keyboard.


Title: Re: USB to USB keyboard converter
Post by: D.L. on Thu, 19 December 2019, 18:29:54
Thanks for you report. I updated the incompatibility list in first post.
Btw, what's your 'another keyboard'?


Matias Quiet Pro for Mac:
https://matias.ca/quietpro/mac/

I'm not sure I've configured it correctly, it has a native Mac layout and my brain was going through contortions to figure out which keys should be remapped to do what I want it to do, but I have the bare minimum function I wanted up and running (Caps Lock to CTRL; no admin access on my work computer).
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 02 February 2020, 19:56:27
Updated keyboard lists in the first post.

MK Fission is added to 'Incompatible Keyboards',
Logitech K120 and HHKB Professional Classic(PD-KB401W) are added to 'Compatible Keyboards'.
Title: Re: USB to USB keyboard converter
Post by: thr0wy on Sun, 09 February 2020, 20:18:16
I made the pro micro + usb host shield version and flashed with qmk. Works perfectly on GK64, GH60, Kbpardise v60 and Vortex pok3r.
Thank you for this handy little tool.  :thumb:
Title: Re: USB to USB keyboard converter
Post by: riangle on Thu, 27 February 2020, 08:17:46
Hey Hasu,

I followed your direction and am now using your USB-USB converter with my Realforce PFU. It works great when it works, but there is an issue I'm not able to figure out on my own.

Sometimes (I've only noticed this when I plug in other peripheral devices) the converter stops working. I've noticed this specifically after plugging in a new mouse. Model o -. It flat out stops working and needs something in the area of 5ish minutes of unplugging/plugging in and hitting the button on the converter for everything to work again. If I'm in the middle of something I just lay it aside. Any idea what a solution to this could be? It's happened a handful of times, though I can't say it's consistently when I plug in a new peripheral device as I rarely do so.

Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 28 February 2020, 14:18:54
Hey Hasu,

I followed your direction and am now using your USB-USB converter with my Realforce PFU. It works great when it works, but there is an issue I'm not able to figure out on my own.

Sometimes (I've only noticed this when I plug in other peripheral devices) the converter stops working. I've noticed this specifically after plugging in a new mouse. Model o -. It flat out stops working and needs something in the area of 5ish minutes of unplugging/plugging in and hitting the button on the converter for everything to work again. If I'm in the middle of something I just lay it aside. Any idea what a solution to this could be? It's happened a handful of times, though I can't say it's consistently when I plug in a new peripheral device as I rarely do so.



No idea.
You may see useful debug info with hid_listen tool. Leave the tool running all the time and check its console when the problem happens.
https://github.com/tmk/tmk_keyboard/wiki#debug-console

BTW, the button is used to program the converter firmware, the converter stops working and turns itself into flash mode when you press the button. To make the converter working again you have to replug it or program it with proper firmware using flashing tool.
Title: Re: USB to USB keyboard converter
Post by: etops on Sat, 25 April 2020, 07:31:12
Hi Hasu,

I've been using usb-to-usb converter with my CM STORM (Coolermaster Novatouch TKL) for almost two years with no issues.

But I recently bought NuType F1 from kickstarter and I does not work. I flashed latest firmware today, again no luck. Keyboards powers up, all leds work, keyboard's own functions like led brightness via its fn shortcus works. But keypresses don't register.

hid_listen does report no keypress.

here is usb device tree view of the directly connected keyboard:

https://pastebin.com/fTWMypTS

If you could please take a look at this i'd be happy.

Thanks in advance..
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 25 April 2020, 08:31:23
etoops,
Thank you for the report. I updated incompatibility list in first post.

I didn't find clue in its USB descriptors unfortunately.
Can you post hid_listen output? It is still useful to know how the converter initialize perhaps.

Do you see whether the keyboard work with UEFI/BIOS interface of PC?
Title: Re: USB to USB keyboard converter
Post by: etops on Sat, 25 April 2020, 09:18:18
Thank you for the fast reply!

I didn't find clue in its USB descriptors unfortunately.
Can you post hid_listen output? It is still useful to know how the converter initialize perhaps.

Here is after I connect the keyboard to adapter:

Code: [Select]
Waiting for new device:.........
Listening:
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
host.Task: 2156
usb_state: 90
speed: full

on previous run, host.Task was 2157. now 2156, then 2157 again. These are the only thing that is printed. After that no key press registers.

Do you see whether the keyboard work with UEFI/BIOS interface of PC?

it works both on my 10+ year old legacy bios and 2 year old UEFI..
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 25 April 2020, 09:54:55
Thanks for the info
It seems the converter works accoriding to the log but it fails somewhere.

Didn't you see "TMK:b813d62a+/LUFA" line like below with hid_listen? In that case you are using old version firmware perhaps. Try the latest one downloaded from Keymap Editor.

Quote
Listening:


TMK:b813d62a+/LUFA

usb_state: 12

USB configured.

Keyboard start.
Title: Re: USB to USB keyboard converter
Post by: etops on Sat, 25 April 2020, 11:43:55
There are no additional lines, just the ones I pasted here..

Actually I uploaded my config to the editor changed a config and back then re-downloaded and flashed just to update firmware before my initial post. Now
to double check I did it again. Output is still the same. Tried running as admin, and tried on other PC as well, same results.

I am open to suggestions, I could send my firmware, or flash one if you send?

P.S: I have two usb-to-usb adapters. Both are up-to-date and results are the same.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 25 April 2020, 11:55:56
Are you sure it is my tmk keymap editor, not qmk? Check  first post for it's url.
Title: Re: USB to USB keyboard converter
Post by: etops on Sat, 25 April 2020, 12:24:02
Yes definitely,

I am using this link, and I had no problems for two years with my main keyboards:

http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb)
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 25 April 2020, 20:18:38
Thanks for the confirmation.

Then can you try attached firmware and post hid_listen output?
It may show helpful info.

[attachurl=1]
Title: Re: USB to USB keyboard converter
Post by: etops on Sat, 25 April 2020, 21:00:57
Here my attempts;

First, third and fourth try:

Code: [Select]
Waiting for new device:......
Listening:


TMK:94c5fefa+/LUFA

[C]usb[S]_state: 12
[W][R][W][R][W][c]
USB configured.

Keyboard start.
[I0]0[I1]0[R][W][R][W][c][L0]usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
bNumEP:01
D1
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
bNumEP:01
D1
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
bNumEP:01
D1
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
bNumEP:01
D1
host.Task: 2134
usb_state: 90
speed: full

And the second try: (there was a different line before attaching the keyboard)
Code: [Select]
Waiting for device:.....
Listening:


TMK:94c5fefa+/LUFA

[C]usb[S]_state: 12
[W][R][W][R][W][c]
USB configured.

Keyboard start.
[I0]0[I1]0[L0]usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
bNumEP:01
D1
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
bNumEP:01
D1
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
bNumEP:01
D1
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
bNumEP:01
D1
host.Task: 2134
usb_state: 90
speed: full

Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 25 April 2020, 23:22:49
Thanks.
It seems to fail to handle USB Descriptors somehow.

Attached new debug firmware  it will show more detail info on parsing Descriptors.

That diffrence doesn't matter and it is trivial timing thing. One log will be enough.

[attachurl=1]
Title: Re: USB to USB keyboard converter
Post by: etops on Sun, 26 April 2020, 01:27:40
Allright, here it is:

Code: [Select]
Waiting for device:....
Listening:


TMK:94c5fefa+/LUFA

[C]usb[S]_state: 12
[W][R][W][R][W][c]
USB configured.

Keyboard start.
[I0]0[I1]0[L0]usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
bNumEP:01
Cnf:00
bIfaceNum:00
bNumIface:00

Interface:00
PROTOCOL SET HID_BOOT rcode:00
SET_IDLE rcode:00
RPIPE rcode:00
BM configured
host.Task: 2317
usb_state: 90
speed: full
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 27 April 2020, 10:36:22
etops,

I couldn't find any clear clue so far.

Can you try this when you have time?

[attachurl=1]
Title: Re: USB to USB keyboard converter
Post by: etops on Mon, 27 April 2020, 13:29:36
Of course! here is the new output:

Code: [Select]
Waiting for device:.......
Listening:


TMK:e0236e64+/LUFA

[C]usb[S]_state: 12
[W][R][W][R][W][c]
USB configured.

Keyboard start.
[I0]0[R][W][R][W][c][I1]0[R][W][R][W][c][L0]usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
[gC]Cl:003B
bNumEP:01
Cnf:00
bIfaceNum:00
bNumIface:00

Interface:00
PROTOCOL SET HID_BOOT rcode:00
SET_IDLE rcode:00
RPIPE rcode:00
BM configured
host.Task: 2317
usb_state: 90
speed: full
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 28 April 2020, 10:39:59
etops,
Thanks for your patience.

It seems to get some error on transfer of USB Descriptor from the keyboard.
Hope this shows something useful.

[attachurl=1]
Title: Re: USB to USB keyboard converter
Post by: etops on Tue, 28 April 2020, 11:59:00
No worries I am happy to help!

By the way, the previous flash might be unsuccessful, i am sorry if that's the case.

Just to be sure I flashed previous firmware again. Here is the previous firmware's output:

Code: [Select]
Waiting for device:......
Listening:


TMK:e0236e64+/LUFA

[C]usb[S]_state: 12
[W][R][W][R][W][c]
USB configured.

Keyboard start.
[I0]0[R][W][R][W][c][I1]0[R][W][R][W][c][L0][S][W][R][W][R][W][c][I0]0[R][W][R][W][c][I1]0[R][W][R][W][c][L0]usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
[gC]Cl:003B
bNumEP:01
Cnf:00
bIfaceNum:00
bNumIface:00

Interface:00
PROTOCOL SET HID_BOOT rcode:00
SET_IDLE rcode:00
RPIPE rcode:00
BM configured
host.Task: 2317
usb_state: 90
speed: full

And now this is the latest firmware's output:
Code: [Select]
Waiting for device:...
Listening:


TMK:2e5e6a69+/LUFA

usb_state: 12

USB configured.

Keyboard start.
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
[gC]Cl:003B
crIN:05
bNumEP:01
Cnf:00
bIfaceNum:00
bNumIface:00

Interface:00
PROTOCOL SET HID_BOOT rcode:00
SET_IDLE rcode:00
RPIPE rcode:00
BM configured
host.Task: 2318
usb_state: 90
speed: full
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 29 April 2020, 22:36:47
It fails with STALL error when getting USB Descriptor. I think the STALL is exceptional there and the converter doesn't expect it at all but it occurs in fact.

Quote
crIN:05

 I changed code to retry five times when it fails with the error.

[attachurl=1]
Title: Re: USB to USB keyboard converter
Post by: etops on Thu, 30 April 2020, 04:56:39
Hi hasu,

here is the output:


Code: [Select]
Waiting for device:.....
Listening:


TMK:2e5e6a69+/LUFA

usb_state: 12

USB configured.

Keyboard start.
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
[gC]Cl:003B
crIN:05
crIN:05
crIN:05
crIN:05
crIN:05
bNumEP:01
Cnf:00
bIfaceNum:00
bNumIface:00

Interface:00
PROTOCOL SET HID_BOOT rcode:00
SET_IDLE rcode:00
RPIPE rcode:00
BM configured
host.Task: 2320
usb_state: 90
speed: full
Title: Re: USB to USB keyboard converter
Post by: JimDetroit on Fri, 01 May 2020, 18:59:49
Hi Hasu,

I would like to report a non-working keyboard with the USB-to-USB converter, purchased from 1up. I've been using the converter with many different keyboards, and this particular one doesn't work with it: the Rosewill RK-9200BR. I tested the converter with a programming of the latest firmware from the website, to make sure the latest updates don't now allow it to work with the keyboard.

Here is what "sudo lsusb -v -d 1130:7979" reports:

Bus 002 Device 065: ID 1130:7979 Tenx Technology, Inc.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x1130 Tenx Technology, Inc.
  idProduct          0x7979
  bcdDevice            1.07
  iManufacturer           1 CYKB16
  iProduct                2 USB Keyboard
  iSerial                 0
  bNumConfigurations      1

What happens when I connect this keyboard through the converter is that the three indicator lights (NUMLOCK, CAPS, SCROLL) all stay on for several seconds, then go out. After that, I can use the FN key to turn on the LED's on the board, but no keys register with the Linux system. I'm typing on this keyboard now, but without the converter in line, just plugging it directly into a USB socket.

I also have a miscellaneous question: I noticed one of these adapters I bought from 1up (I have 3 of them) originally had a red LED on the circuit board light up when plugged into USB (a power light). After programming new firmware, the LED no longer lights. Is there an easy way to get that light to turn on again for a power indication? Maybe in the TMK C code somewhere?

Thanks for a great product!
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 02 May 2020, 01:31:00
Thanks for the report.

Can you post full list of 'lsusb -v' output for future reference?

As for the LED I use it for debug and didn't decide how to use it for release firmware.
But I'll fix that somewhat some later.

Hi Hasu,

I would like to report a non-working keyboard with the USB-to-USB converter, purchased from 1up. I've been using the converter with many different keyboards, and this particular one doesn't work with it: the Rosewill RK-9200BR. I tested the converter with a programming of the latest firmware from the website, to make sure the latest updates don't now allow it to work with the keyboard.

Here is what "sudo lsusb -v -d 1130:7979" reports:

Bus 002 Device 065: ID 1130:7979 Tenx Technology, Inc.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x1130 Tenx Technology, Inc.
  idProduct          0x7979
  bcdDevice            1.07
  iManufacturer           1 CYKB16
  iProduct                2 USB Keyboard
  iSerial                 0
  bNumConfigurations      1

What happens when I connect this keyboard through the converter is that the three indicator lights (NUMLOCK, CAPS, SCROLL) all stay on for several seconds, then go out. After that, I can use the FN key to turn on the LED's on the board, but no keys register with the Linux system. I'm typing on this keyboard now, but without the converter in line, just plugging it directly into a USB socket.

I also have a miscellaneous question: I noticed one of these adapters I bought from 1up (I have 3 of them) originally had a red LED on the circuit board light up when plugged into USB (a power light). After programming new firmware, the LED no longer lights. Is there an easy way to get that light to turn on again for a power indication? Maybe in the TMK C code somewhere?

Thanks for a great product!


Title: Re: USB to USB keyboard converter
Post by: JimDetroit on Sat, 02 May 2020, 08:08:43
Thanks for your reply, Hasu. Here is the full output of "lsusb -v" for the Rosewill RK-9200BR keyboard:

Code: [Select]
Bus 002 Device 065: ID 1130:7979 Tenx Technology, Inc.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x1130 Tenx Technology, Inc.
  idProduct          0x7979
  bcdDevice            1.07
  iManufacturer           1 CYKB16
  iProduct                2 USB Keyboard
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           59
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              500mA
    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           33 US
          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               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode           33 US
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     115
         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
Device Status:     0x0000
  (Bus Powered)

Thanks for the report.

Can you post full list of 'lsusb -v' output for future reference?

As for the LED I use it for debug and didn't decide how to use it for release firmware.
But I'll fix that somewhat some later.

Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 02 May 2020, 08:59:31
JimDetroit,
Thanks for the descriptors.

Can you try this firmware for debug and post 'hid_listen' output when you have time?

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

You can download 'hid_listen' tool here.
https://www.pjrc.com/teensy/hid_listen.html
Title: Re: USB to USB keyboard converter
Post by: JimDetroit on Sat, 02 May 2020, 11:09:05
Hasu,

Here is the output of hid_listen, with the debug firmware installed on the USB-USB controller, for the Rosewill RK-9200BR keyboard:. At the end, where there is a line of "T"s, I was typing "QWERTY".

Code: [Select]
Waiting for device:...
Listening:
 20
usb_state: 40
usb_state: 50
usb_state: 51
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
[gC]Cl:003B
[pC][pI3][pI2][pI1][pI0][pI][pH][pE1][pE0][xE1][xE0][xE++][xE][pE][pI3][pI2][pI1][pH][pE1][pE0][pE]bNumEP:02
Cnf:01
bIfaceNum:00
bNumIface:00

Interface:00
PROTOCOL SET HID_BOOT rcode:00
SET_IDLE rcode:00
RPIPE rcode:00
BM configured
host.Task: 2330
usb_state: 90
speed: full

USB configured.

Keyboard start.
TTTTTTTTTTTTTTT^C
Title: Re: USB to USB keyboard converter
Post by: online on Sat, 02 May 2020, 20:03:03
32u4 don't have enough memory for layers and functions that I need. would it work if I replace the ic with AT90USB1286? (of cause I'll have to redesign the PCB with the same pins config)
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 02 May 2020, 22:29:33
JimDetroit,
Thanks for the log. It seems to work as expected and I couldn't find any clue there unfrotunately.


32u4 don't have enough memory for layers and functions that I need. would it work if I replace the ic with AT90USB1286? (of cause I'll have to redesign the PCB with the same pins config)

I think so. You just need some code tweak for your pin configurations.

Title: Re: USB to USB keyboard converter
Post by: JimDetroit on Sat, 02 May 2020, 22:38:28
Thanks, Hasu. Please let me know if you think of any other tests to run and I can do them for you and report the results.

JimDetroit,
Thanks for the log. It seems to work as expected and I couldn't find any clue there unfrotunately.
Title: Re: USB to USB keyboard converter
Post by: online on Mon, 04 May 2020, 07:53:18
32u4 don't have enough memory for layers and functions that I need. would it work if I replace the ic with AT90USB1286? (of cause I'll have to redesign the PCB with the same pins config)

I think so. You just need some code tweak for your pin configurations.
Thanks. That's good to know, will report back once I've tried it.

Other question. I want to reduce the firmware size by reducing the virtual matrix row/col count, I know which exact keys I need / I don't need.
any hint of how should I do this? is there an example of it?
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 06 May 2020, 02:31:31
32u4 don't have enough memory for layers and functions that I need. would it work if I replace the ic with AT90USB1286? (of cause I'll have to redesign the PCB with the same pins config)

I think so. You just need some code tweak for your pin configurations.
Thanks. That's good to know, will report back once I've tried it.

Other question. I want to reduce the firmware size by reducing the virtual matrix row/col count, I know which exact keys I need / I don't need.
any hint of how should I do this? is there an example of it?

I can't explain it  in minutes and don't have any example at this point.

Anyway, I think  you don't need to hassle on code tweaking once you have vast flash on AT90USB1286.
Title: Re: USB to USB keyboard converter
Post by: netbike on Thu, 23 July 2020, 11:46:23
Hi Hasu,

Add one to your compatible keybaord list : Filco Majestouch 2 104
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 23 July 2020, 20:09:06
Thank you. Updated the list in the first post.

Hi Hasu,

Add one to your compatible keybaord list : Filco Majestouch 2 104

Title: Re: USB to USB keyboard converter
Post by: dannyrb on Tue, 22 September 2020, 09:00:41
Ah! I was happy to learn of the Hasu USB to USB Converter, and then sad to learn that it's out of stock. Is anyone aware of when they'll be available again, or other places I might be able to pick one up?

Edit: I found a separate thread that indicated pre-orders could be made via e-mail. I've gone ahead and reached out that way. Thanks for your continued work and support here ^_^
Title: Re: USB to USB keyboard converter
Post by: daniel123 on Tue, 29 September 2020, 15:51:51
Hi Hasu,

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

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

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

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

Thanks a lot  :thumb:


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

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


#define AC_FN0 ACTION_LAYER_MOMENTARY(1)

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


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

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

Title: Re: USB to USB keyboard converter
Post by: ByteCrash on Sat, 17 October 2020, 10:47:41
Tried the USB-to-USB converter with the Razer Huntsman Mini. No luck :(

If I had to guess: it didn't power on any lights, so I would be curious if it was a power / current draw issue. I attempted using a powered USB hub as well as directly connecting to the USB port on my computer but it didn't power on either time. The converter works without issue with other, non-powered / backlit keyboards though.
Title: Re: USB to USB keyboard converter
Post by: nevin on Sat, 17 October 2020, 12:56:42
Is it one you built (teensy/promicro) or one you bought (hasu's)?
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 17 October 2020, 18:05:32
And can you provide these info for the Razer?
- Debug outputs from 'hid_listen' command. https://github.com/tmk/tmk_keyboard/wiki#debug-console
- '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

What is the other keyobard that works without issue, btw?

Tried the USB-to-USB converter with the Razer Huntsman Mini. No luck :(

If I had to guess: it didn't power on any lights, so I would be curious if it was a power / current draw issue. I attempted using a powered USB hub as well as directly connecting to the USB port on my computer but it didn't power on either time. The converter works without issue with other, non-powered / backlit keyboards though.

Title: Re: USB to USB keyboard converter
Post by: garyngzb on Wed, 21 October 2020, 09:40:51
Just received the converter!
It works well on my Logitech Unifying receiver, but not on my other keyboard.

The keyboard is some off-brand mechanical keyboard that I bought a few years back, below is some information about it - hopefully it helps in debugging what's going wrong (or maybe the keyboard is just poorly-made?)

I flashed the debug firmware downloaded from https://geekhack.org/index.php?topic=69169.msg2896191#msg2896191 (https://geekhack.org/index.php?topic=69169.msg2896191#msg2896191)

hid_listen output:

Code: [Select]
Waiting for new device:..
Listening:


TMK:2e5e6a69+/LUFA

usb_state: 12

USB configured.

Keyboard start.
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
[gC]Cl:0042
[pC][pI3][pI2][pI1][pI0][pI][pH][pE1][pE0][xE1][xE0][xE++][xE][pE][pI3][pI2][pI1][pI0][pH][pE1][pE0][pE][pE1][pE1][pE0][pE]bNumEP:02
Cnf:01
bIfaceNum:00
bNumIface:00

Interface:00
PROTOCOL SET HID_BOOT rcode:00
SET_IDLE rcode:00
RPIPE rcode:00
BM configured
host.Task: 2324
usb_state: 90
speed: full
TTTTTTTTTTTTTTTTT

The "TTTTT" appears when I press the keys on the keyboard.

USB descriptor (obtained via USB Device Tree Viewer):
Code: [Select]

    =========================== USB Port1 ===========================

Connection Status        : 0x01 (Device is connected)
Port Chain               : 2-1
Properties               : 0x01
 IsUserConnectable       : yes
 PortIsDebugCapable      : no
 PortHasMultiCompanions  : no
 PortConnectorIsTypeC    : no
ConnectionIndex          : 1
CompanionIndex           : 0
 CompanionHubSymLnk      : USB#ROOT_HUB30#4&e6886c1&0&0#{f18a0e88-c30c-11d0-8815-00a0c906bed8}
 CompanionPortNumber     : 16
 -> CompanionPortChain   : 2-16

      ======================== USB Device ========================

        +++++++++++++++++ Device Information ++++++++++++++++++
Device Description       : USB Composite Device
Device Path              : \\?\USB#VID_04B4&PID_3000#5&267524fb&0&1#{a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
Kernel Name              : \Device\USBPDO-12
Device ID                : USB\VID_04B4&PID_3000\5&267524FB&0&1
Hardware IDs             : USB\VID_04B4&PID_3000&REV_0108 USB\VID_04B4&PID_3000
Driver KeyName           : {36fc9e60-c465-11cf-8056-444553540000}\0021 (GUID_DEVCLASS_USB)
Driver                   : \SystemRoot\System32\drivers\usbccgp.sys (Version: 10.0.19041.488  Date: 2020-09-11)
Driver Inf               : C:\WINDOWS\inf\usb.inf
Legacy BusType           : PNPBus
Class                    : USB
Class GUID               : {36fc9e60-c465-11cf-8056-444553540000} (GUID_DEVCLASS_USB)
Service                  : usbccgp
Enumerator               : USB
Location Info            : Port_#0001.Hub_#0003
Location IDs             : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(1), ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HS01)
Container ID             : {8786439f-1333-11eb-9d48-80a589787414}
Manufacturer Info        : (Standard USB Host Controller)
Capabilities             : 0x84 (Removable, SurpriseRemovalOK)
Status                   : 0x0180600A (DN_DRIVER_LOADED, DN_STARTED, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
Problem Code             : 0
Address                  : 1
HcDisableSelectiveSuspend: 0
EnableSelectiveSuspend   : 0
SelectiveSuspendEnabled  : 0
EnhancedPowerMgmtEnabled : 0
IdleInWorkingState       : 0
WakeFromSleepState       : 0
Power State              : D0 (supported: D0, D1, D2, D3, wake from D0, wake from D1, wake from D2)
 Child Device 1          : USB Input Device
  Device ID              : USB\VID_04B4&PID_3000&MI_00\6&B3E4605&2&0000
  Class                  : HIDClass
  Driver KeyName         : {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0065 (GUID_DEVCLASS_HIDCLASS)
  Service                : HidUsb
   Child Device 1        : HID Keyboard Device
    Device Path 1        : \\?\HID#VID_04B4&PID_3000&MI_00#7&8b173b8&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} (GUID_DEVINTERFACE_KEYBOARD)
    Device Path 2        : \\?\HID#VID_04B4&PID_3000&MI_00#7&8b173b8&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd (GUID_DEVINTERFACE_HID)
    Kernel Name          : \Device\000004db
    Device ID            : HID\VID_04B4&PID_3000&MI_00\7&8B173B8&0&0000
    Class                : Keyboard
    Driver KeyName       : {4d36e96b-e325-11ce-bfc1-08002be10318}\0011 (GUID_DEVCLASS_KEYBOARD)
    Service              : kbdhid
 Child Device 2          : USB Input Device
  Device ID              : USB\VID_04B4&PID_3000&MI_01\6&B3E4605&2&0001
  Class                  : HIDClass
  Driver KeyName         : {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0066 (GUID_DEVCLASS_HIDCLASS)
  Service                : HidUsb
   Child Device 1        : HID-compliant system controller
    Device Path 1        : \\?\HID#VID_04B4&PID_3000&MI_01&Col02#7&311c2181&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} (GUID_DEVINTERFACE_HID)
    Device Path 2        : \\?\HID#VID_04B4&PID_3000&MI_01&Col02#7&311c2181&0&0001#{4afa3d53-74a7-11d0-be5e-00a0c9062857} (GUID_DEVICE_SYS_BUTTON)
    Kernel Name          : \Device\000004dd
    Device ID            : HID\VID_04B4&PID_3000&MI_01&COL02\7&311C2181&0&0001
    Class                : HIDClass
    Driver KeyName       : {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0067 (GUID_DEVCLASS_HIDCLASS)
   Child Device 2        : HID-compliant consumer control device
    Device Path          : \\?\HID#VID_04B4&PID_3000&MI_01&Col03#7&311c2181&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} (GUID_DEVINTERFACE_HID)
    Kernel Name          : \Device\000004de
    Device ID            : HID\VID_04B4&PID_3000&MI_01&COL03\7&311C2181&0&0002
    Class                : HIDClass
    Driver KeyName       : {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0068 (GUID_DEVCLASS_HIDCLASS)
   Child Device 3        : HID-compliant vendor-defined device
    Device Path          : \\?\HID#VID_04B4&PID_3000&MI_01&Col04#7&311c2181&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} (GUID_DEVINTERFACE_HID)
    Kernel Name          : \Device\000004df
    Device ID            : HID\VID_04B4&PID_3000&MI_01&COL04\7&311C2181&0&0003
    Class                : HIDClass
    Driver KeyName       : {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0069 (GUID_DEVCLASS_HIDCLASS)
   Child Device 4        : HID-compliant mouse
    Device Path 1        : \\?\HID#VID_04B4&PID_3000&MI_01&Col01#7&311c2181&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} (GUID_DEVINTERFACE_MOUSE)
    Device Path 2        : \\?\HID#VID_04B4&PID_3000&MI_01&Col01#7&311c2181&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} (GUID_DEVINTERFACE_HID)
    Kernel Name          : \Device\000004dc
    Device ID            : HID\VID_04B4&PID_3000&MI_01&COL01\7&311C2181&0&0000
    Class                : Mouse
    Driver KeyName       : {4d36e96f-e325-11ce-bfc1-08002be10318}\0009 (GUID_DEVCLASS_MOUSE)
    Service              : mouhid
   Child Device 5        : HID Keyboard Device
    Device Path 1        : \\?\HID#VID_04B4&PID_3000&MI_01&Col05#7&311c2181&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd (GUID_DEVINTERFACE_HID)
    Device Path 2        : \\?\HID#VID_04B4&PID_3000&MI_01&Col05#7&311c2181&0&0004#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} (GUID_DEVINTERFACE_KEYBOARD)
    Kernel Name          : \Device\000004e0
    Device ID            : HID\VID_04B4&PID_3000&MI_01&COL05\7&311C2181&0&0004
    Class                : Keyboard
    Driver KeyName       : {4d36e96b-e325-11ce-bfc1-08002be10318}\0012 (GUID_DEVCLASS_KEYBOARD)
    Service              : kbdhid

        +++++++++++++++++ Registry USB Flags +++++++++++++++++
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\04B430000108
 osvc                    : REG_BINARY 00 00
 NewInterfaceUsage       : REG_DWORD 00000000 (0)

        ---------------- Connection Information ---------------
Connection Index         : 0x01 (1)
Connection Status        : 0x01 (DeviceConnected)
Current Config Value     : 0x01
Device Address           : 0x19 (25)
Is Hub                   : 0x00 (no)
Device Bus Speed         : 0x01 (Full-Speed)
Number Of Open Pipes     : 0x03 (3 pipes to data endpoints)
Pipe[0]                  : EndpointID=1  Direction=IN   ScheduleOffset=0  Type=Interrupt
Pipe[1]                  : EndpointID=2  Direction=IN   ScheduleOffset=0  Type=Interrupt
Pipe[2]                  : EndpointID=3  Direction=OUT  ScheduleOffset=0  Type=Interrupt
Data (HexDump)           : 01 00 00 00 12 01 00 02 00 00 00 08 B4 04 00 30   ...............0
                           08 01 00 00 00 01 01 01 00 19 00 03 00 00 00 01   ................
                           00 00 00 07 05 81 03 08 00 01 00 00 00 00 07 05   ................
                           82 03 40 00 01 00 00 00 00 07 05 03 03 40 00 01   ..@..........@..
                           00 00 00 00                                       ....

        --------------- Connection Information V2 -------------
Connection Index         : 0x01 (1)
Length                   : 0x10 (16 bytes)
SupportedUsbProtocols    : 0x03
 Usb110                  : 1 (yes)
 Usb200                  : 1 (yes)
 Usb300                  : 0 (no)
 ReservedMBZ             : 0x00
Flags                    : 0x00
 DevIsOpAtSsOrHigher     : 0 (Is not operating at SuperSpeed or higher)
 DevIsSsCapOrHigher      : 0 (Is not SuperSpeed capable or higher)
 DevIsOpAtSsPlusOrHigher : 0 (Is not operating at SuperSpeedPlus or higher)
 DevIsSsPlusCapOrHigher  : 0 (Is not SuperSpeedPlus capable or higher)
 ReservedMBZ             : 0x00
Data (HexDump)           : 01 00 00 00 10 00 00 00 03 00 00 00 00 00 00 00   ................

    ---------------------- Device Descriptor ----------------------
bLength                  : 0x12 (18 bytes)
bDescriptorType          : 0x01 (Device Descriptor)
bcdUSB                   : 0x200 (USB Version 2.00) -> wrong, device is Full-Speed only
bDeviceClass             : 0x00 (defined by the interface descriptors)
bDeviceSubClass          : 0x00
bDeviceProtocol          : 0x00
bMaxPacketSize0          : 0x08 (8 bytes)
idVendor                 : 0x04B4 (Cypress Semiconductor)
idProduct                : 0x3000
bcdDevice                : 0x0108
iManufacturer            : 0x00 (No String Descriptor)
iProduct                 : 0x00 (No String Descriptor)
iSerialNumber            : 0x00 (No String Descriptor)
bNumConfigurations       : 0x01 (1 Configuration)
Data (HexDump)           : 12 01 00 02 00 00 00 08 B4 04 00 30 08 01 00 00   ...........0....
                           00 01                                             ..

    ------------------ Configuration Descriptor -------------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x02 (Configuration Descriptor)
wTotalLength             : 0x0042 (66 bytes)
bNumInterfaces           : 0x02 (2 Interfaces)
bConfigurationValue      : 0x01 (Configuration 1)
iConfiguration           : 0x02 (String Descriptor 2)
 Language 0x0409         : "Game_Keyboard"
bmAttributes             : 0xA0
 D7: Reserved, set 1     : 0x01
 D6: Self Powered        : 0x00 (no)
 D5: Remote Wakeup       : 0x01 (yes)
 D4..0: Reserved, set 0  : 0x00
MaxPower                 : 0x32 (100 mA)
Data (HexDump)           : 09 02 42 00 02 01 02 A0 32 09 04 00 00 01 03 01   ..B.....2.......
                           01 02 09 21 11 01 21 01 22 3F 00 07 05 81 03 08   ...!..!."?......
                           00 01 09 04 01 00 02 03 01 02 04 09 21 11 01 21   ............!..!
                           01 22 B0 00 07 05 82 03 40 00 01 07 05 03 03 40   ."......@......@
                           00 01                                             ..

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x00
bAlternateSetting        : 0x00
bNumEndpoints            : 0x01 (1 Endpoint)
bInterfaceClass          : 0x03 (HID - Human Interface Device)
bInterfaceSubClass       : 0x01 (Boot Interface)
bInterfaceProtocol       : 0x01 (Keyboard)
iInterface               : 0x02 (String Descriptor 2)
 Language 0x0409         : "Game_Keyboard"
Data (HexDump)           : 09 04 00 00 01 03 01 01 02                        .........

        ------------------- HID Descriptor --------------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x21 (HID Descriptor)
bcdHID                   : 0x0111 (HID Version 1.11)
bCountryCode             : 0x21 (33 = US)
bNumDescriptors          : 0x01
Data (HexDump)           : 09 21 11 01 21 01 22 3F 00                        .!..!."?.
Descriptor 1:
bDescriptorType          : 0x22 (Class=Report)
wDescriptorLength        : 0x003F (63 bytes)
Error reading descriptor : ERROR_INVALID_PARAMETER

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x81 (Direction=IN EndpointID=1)
bmAttributes             : 0x03 (TransferType=Interrupt)
wMaxPacketSize           : 0x0008 (8 bytes)
bInterval                : 0x01 (1 ms)
Data (HexDump)           : 07 05 81 03 08 00 01                              .......

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x01
bAlternateSetting        : 0x00
bNumEndpoints            : 0x02 (2 Endpoints)
bInterfaceClass          : 0x03 (HID - Human Interface Device)
bInterfaceSubClass       : 0x01 (Boot Interface)
bInterfaceProtocol       : 0x02 (Mouse)
iInterface               : 0x04 (String Descriptor 4)
 Language 0x0409         : "Function_Device"
Data (HexDump)           : 09 04 01 00 02 03 01 02 04                        .........

        ------------------- HID Descriptor --------------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x21 (HID Descriptor)
bcdHID                   : 0x0111 (HID Version 1.11)
bCountryCode             : 0x21 (33 = US)
bNumDescriptors          : 0x01
Data (HexDump)           : 09 21 11 01 21 01 22 B0 00                        .!..!."..
Descriptor 1:
bDescriptorType          : 0x22 (Class=Report)
wDescriptorLength        : 0x00B0 (176 bytes)
Error reading descriptor : ERROR_INVALID_PARAMETER

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x82 (Direction=IN EndpointID=2)
bmAttributes             : 0x03 (TransferType=Interrupt)
wMaxPacketSize           : 0x0040 (64 bytes)
bInterval                : 0x01 (1 ms)
Data (HexDump)           : 07 05 82 03 40 00 01                              ....@..

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x03 (Direction=OUT EndpointID=3)
bmAttributes             : 0x03 (TransferType=Interrupt)
wMaxPacketSize           : 0x0040 (64 bytes)
bInterval                : 0x01 (1 ms)
Data (HexDump)           : 07 05 03 03 40 00 01                              ....@..

    ----------------- Device Qualifier Descriptor -----------------
Error                    : ERROR_GEN_FAILURE

      -------------------- String Descriptors -------------------
             ------ String Descriptor 0 ------
bLength                  : 0x04 (4 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language ID[0]           : 0x0409 (English - United States)
Data (HexDump)           : 04 03 09 04                                       ....
             ------ String Descriptor 2 ------
bLength                  : 0x1C (28 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "Game_Keyboard"
Data (HexDump)           : 1C 03 47 00 61 00 6D 00 65 00 5F 00 4B 00 65 00   ..G.a.m.e._.K.e.
                           79 00 62 00 6F 00 61 00 72 00 64 00               y.b.o.a.r.d.
             ------ String Descriptor 4 ------
bLength                  : 0x20 (32 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "Function_Device"
Data (HexDump)           : 20 03 46 00 75 00 6E 00 63 00 74 00 69 00 6F 00    .F.u.n.c.t.i.o.
                           6E 00 5F 00 44 00 65 00 76 00 69 00 63 00 65 00   n._.D.e.v.i.c.e.


Thanks!
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 28 October 2020, 08:20:13
garyngzb, Thank you for the report.

I'm still not sure what the 'TTT' error indicates unfortunately. But my wild guess is toggle error...
Can you try attached firmware when you have time? Its hid_listen output would be helpful.

usb_usb_debug.hex (https://raw.githubusercontent.com/tmk/tmk_keyboard/master/converter/usb_usb/binary/usb_usb_debug.hex)
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 05 November 2020, 10:54:53
[New Firmware]
Updated firmware and fixed some (https://github.com/tmk/tmk_keyboard/issues/657) issues (https://github.com/tmk/tmk_keyboard/issues/658).

I hope this solves or mitigates some of the incompatibile keyboards list.
Let me know your result with new firmware especially if you had problem before.

You can dowload it from Keymap Editor or here (https://github.com/tmk/tmk_keyboard/blob/master/converter/usb_usb/binary/usb_usb_unimap.hex).

Try this firmware for debug (https://raw.githubusercontent.com/tmk/tmk_keyboard/master/converter/usb_usb/binary/usb_usb_debug.hex) and hid_listen (https://www.pjrc.com/teensy/hid_listen.html) tools to see debug outputs and post it if you still have problem.

Thanks
Title: Re: USB to USB keyboard converter
Post by: haydoselefantes on Thu, 05 November 2020, 13:49:26
Love my new FC980C controller, it's turning my new 980C into an endgame board.

I've been trying to use the keymap editor (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?fc980c) to make my Caps Lock key work as regular caps lock when tapped and momentary layer switch when held.  I set it as "ACTION_LAYER_TAP_KEY" for Caps Lock and Layer 1.

With this, when I just tap Caps Lock, it seems to have no effect.  Weirdly, when I double tap Caps Lock, it does turn on Caps Lock (and then a single tap will turn off Caps Lock).  Holding Caps Lock always works as expected and gives me Layer 1. 

It's no big deal, I use caps lock so infrequently that I don't mind having to double tap (obviously, I could put caps lock somewhere on layer 1 too).  But, I'm just confused why it doesn't work.  Is Caps Lock special with "ACTION_LAYER_TAP_KEY" or something?

Happy to move this to the FC980C thread (https://geekhack.org/index.php?topic=90681.0), but I wasn't sure I should resurrect that one.  FWIW, I actually had this same experience with Caps Lock and ACTION_LAYER_TAP_KEY on the USB-USB converter with my 87U.
Title: Re: USB to USB keyboard converter
Post by: nevin on Thu, 05 November 2020, 13:57:41
i've run into the double tap caps lock as well. think it's how it functions in the firmware or could be a setting with locking caps lock.... haven't dug into it....
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 05 November 2020, 20:43:04
haydoselefantes,
What OS are you guys on? Mac OS?
This issue happens on Linux or Windows too?
Other keys than CapsLock still have same problem?

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

I tested this keymap (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb#456C4oOW4Kmg6biL5oKGcOOOiNeA5rWM4YaA7LCD5oCG6KyB7aOw1oDimKPkrKvmq7HssoLpoJXog4PooKDguILTouKAg+GEuuWiqu6IpOysi8K615HmkKLkoo/is7zipIjqnYLplIrjoIjliaHktoXkiJXjoZHuhZ/ouKHjorLsvYPoqo7jtozgo6Pmvp3unJzjsbPvjKLhlqbmiqPij5PiiaPijaPikKPimKDnjKHujKfuhaLhhaPqhaLqhaPthaXmjaHmlo3hmKHsp6Hmn6PsiJPsjqPsiqDmgbfinaPmj4Tij4Tuj4Huj4fumKLhmKPqmKLqmKjimKLmmKPmlKLhs6bih6bil6Dni6Lhi6Pqi6Lqi6Pti6Lmi6Pmi6Tii6Tui6Hui6ful6Lhl6Pql6Lql6Ptl6Lml6HpjpXukKXuk6Xuh6Xun6LsgJLgq4Los6Xsj5Dvv7jgpKTItt+R5ICl76CI5ZCC556H7aGP5o6R5oWE7Im/65+Y5KiJ7Iu847GE5byO4rWA5p+R4aSJ6piz4oSl5I2n7YGT55O23Lzooo/kpJDtg4Tgs5LhroTkg4rhpIjvqKPjrp3ivqftmabjj4juspHknKPiqZXpp4jiq6zmqq3kvYDtj4HjkZrrvILjmYjmoqfqnrXto7zmloPpga7svpngsILntYnoh5TluarigLjitJbpmLHkiKbiobfhh6LniaHpg5rmqIjnnZvjtZbsva/qr5Lih7bor7Xnur/nkpbpv6ngvZvOkemjgOeEm+GhjOKLueiniO+RouO6nOufhuOPmeuTiuaotemvjuifg+iXv+a5u+OomOK+l+SulemLmOqyu+Wuj+Kaq+GWpuyNoem9nuayiuyNsuWbp+a6s+WvreeYh+a2pO6DpeuYv+y7tuScneibjO+Bve27gOi/u+WOie2zpOuavO6xru+Nm+qrju+Et+unj+GYp+yvo++moO+sn+O+p+K+qe6Hqu+bu+O+v+y6j+Svhu6npO+Lv+a4v+2dn+y3j++tt++3nMO97LCwxbzogIA=) on Linux and it works. I don't have Mac for testing unfortunately.



nevin,
USB-USB converter firmware doesn't Locking key at this point, I think there is virtually no USB keybaords with locking key.
Only ADB, M0110 and PC98 converters support the feature for classic keyboards by default. And LOCKING_* keys are fixed for MacOS some time ago (https://github.com/tmk/tmk_keyboard/commit/88c95615b9446d69343bc11455521ed7625edb5b), so it should work on MacOS, Linux and WIndows now.

EDIT: Mechanical Locking key support (https://github.com/tmk/tmk_keyboard/commit/df164fecc93dd09e0965a8889063e60c7c3fd259) was added  for USB-USB converter now. 2020-11-07
Title: Re: USB to USB keyboard converter
Post by: nevin on Thu, 05 November 2020, 22:46:48
yes, on mac. (El Capitan) yes, i know... old....
not a big issue, but i've seen it before. also in qmk on a GH60. it very well may be the OS. (i don't even have a "caps" on my current daily board)
Title: Re: USB to USB keyboard converter
Post by: haydoselefantes on Fri, 06 November 2020, 13:44:26
haydoselefantes,
What OS are you guys on? Mac OS?
This issue happens on Linux or Windows too?
Other keys than CapsLock still have same problem?

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

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

You're right.  I should have known your stuff was working perfectly!  Is there an easy way to increase duration of the keypress generated by TAP_KEY?  100 ms might work (https://blog.digital-magic.io/2018/12/removing-pesky-caps-lock-delay-on-macos.html)

Off topic, but: CapsLockNoDelay (https://github.com/gkpln3/CapsLockNoDelay) fixes this issue for me on Mac OS Catalina.
 
Neither (https://apple.stackexchange.com/a/187260) of the SO workarounds (https://apple.stackexchange.com/a/262187) change the behavior on Catalina (Mac OS 10.15.7).  This is not surprising, I vividly remember High Sierra changing/breaking a ton of keyboard functionality.  I'm not going to try karabiner, one of the best things about the alt controllers is not having to deal with karabiner!
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 07 November 2020, 03:28:27

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

You're right.  I should have known your stuff was working perfectly!  Is there an easy way to increase duration of the keypress generated by TAP_KEY?  100 ms might work (https://blog.digital-magic.io/2018/12/removing-pesky-caps-lock-delay-on-macos.html)

Yes, it is a workaround. I updated (https://github.com/tmk/tmk_keyboard/commit/02664fe72adc15eee327a557577917880dfa202b) fimware again, download from Keymap Editor and try the TAP_KEY(Capslock). I think it should work now unless I mistook something.


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

Good to know the infos. Thanks.
Title: Re: USB to USB keyboard converter
Post by: nevin on Sat, 07 November 2020, 04:10:30
thanks Hasu
Title: Re: USB to USB keyboard converter
Post by: haydoselefantes on Sat, 07 November 2020, 13:08:41
Yes, it is a workaround. I updated (https://github.com/tmk/tmk_keyboard/commit/02664fe72adc15eee327a557577917880dfa202b) fimware again, download from Keymap Editor and try the TAP_KEY(Capslock). I think it should work now unless I mistook something.

Thanks!

I tried to use the new firmware a couple of times and don't see any change.  I may be doing something wrong.  I went to the keymap editor (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?fc980c), loaded a file with my existing firmware, changed Caps Lock to be plain Caps Lock, then changed Caps Lock back to ACTION_LAYER_TAP_KEY, downloaded and flashed.

Can you please try it out also nevin?
Title: Re: USB to USB keyboard converter
Post by: daniel123 on Sun, 22 November 2020, 06:28:30
Hi Hasu,

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

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

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

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

Thanks a lot  :thumb:


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

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


#define AC_FN0 ACTION_LAYER_MOMENTARY(1)

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


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

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


Hi Hasu,

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

Thanks man :)
Daniel
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 22 November 2020, 06:46:07
Hi Daniel,

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

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


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

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

Note that it is not keymap.c, you can copy the code into unimap.c and compile with 'make -f Makefile.unimap'.
Post error outputs if this doesn't work for you.
Title: Re: USB to USB keyboard converter
Post by: daniel123 on Mon, 23 November 2020, 14:32:20
Hi Hasu,

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

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

Take care
Daniel


PS. In case anyone else who wants to use two keyboards at a time wonders why it doesn't work.... You have to use a DIFFERENT hex-files for each keyboard, e.g. the F24 hex file for the first keyboard and the F23 hex file for the second keyboard. Knowing this now makes me feeling silly to point that out, but some stupid people like me did not get that :D
Title: Re: USB to USB keyboard converter
Post by: nevin on Mon, 23 November 2020, 14:38:26
don't feel bad. i've been playing with qmk & hasu's tmk for years. and it wasn't until recently, i started prepping a couple boards for VIA that i saw/realized the USB Device descriptor's in the firmware. (just a file you don't look into when you're just changing keymaps, or starting off.)
Title: Re: USB to USB keyboard converter
Post by: phedd on Mon, 30 November 2020, 15:36:39
This just happened when disconnecting it from my computer. :(

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

(https://i.imgur.com/JcZr1xB.jpg)
Title: Re: USB to USB keyboard converter
Post by: suicidal_orange on Mon, 30 November 2020, 16:10:22
This just happened when disconnecting it from my computer. :(

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

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

You need four pins for USB, one has disappeared so you'll need a new socket and if you can't solder it you'll have to find someone who can.  If you're in the UK I could do it?
Title: Re: USB to USB keyboard converter
Post by: nevin on Mon, 30 November 2020, 16:22:47
i'll offer the same if in the states.
ask around to friends, colleagues, etc... won't be a hard job and we can talk you through it.
looks like something like this (https://www.amazon.com/uxcell-Right-Angle-Mounting-Connector/dp/B00NWFYLJG) for replacement. could probably find the same connector at mouser or digikey as well. (this was just one of the first couple results)
Title: Re: USB to USB keyboard converter
Post by: phedd on Mon, 30 November 2020, 17:09:30
This just happened when disconnecting it from my computer. :(

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

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

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

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

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

i'll offer the same if in the states.
ask around to friends, colleagues, etc... won't be a hard job and we can talk you through it.
looks like something like this (https://www.amazon.com/uxcell-Right-Angle-Mounting-Connector/dp/B00NWFYLJG) for replacement. could probably find the same connector at mouser or digikey as well. (this was just one of the first couple results)

Thanks alot! I'll try and ask some people
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 30 November 2020, 19:02:21
phedd,
Can you remove the wrapping cover and take pics of both side of the pcb to check pads is still safe and fixable?
Also I like to have pic of the connector from the side to see how its chassis tabs broke off.

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

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


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

Title: Re: USB to USB keyboard converter
Post by: nevin on Mon, 30 November 2020, 19:22:59
Now that's customer service.
Thanks hasu.
Title: Re: USB to USB keyboard converter
Post by: phedd on Mon, 30 November 2020, 20:59:20
phedd,
Can you remove the wrapping cover and take pics of both side of the pcb to check pads is still safe and fixable?
Also I like to have pic of the connector from the side to see how its chassis tabs broke off.

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

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


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

Absolutely, will dm you, thanks and very much appreciated
Title: Re: USB to USB keyboard converter
Post by: haydoselefantes on Tue, 01 December 2020, 17:34:13
OK, I figured this out.  I was doing something stupid.  ACTION_LAYER_TAP_KEY with caps lock om MacOS does work for me after hasu's change!

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

So this time, I went to the keymap editor (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb), selected USB-USB converter as the base firmware, loaded that, and then just manually re-entered my keymap and downloaded it.  Works great! 

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

Thanks hasu!

I tried to use the new firmware a couple of times and don't see any change.  I may be doing something wrong.  I went to the keymap editor (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?fc980c), loaded a file with my existing firmware, changed Caps Lock to be plain Caps Lock, then changed Caps Lock back to ACTION_LAYER_TAP_KEY, downloaded and flashed.

Can you please try it out also nevin?
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 01 December 2020, 17:59:31
Hasu, In the TMK USB to USB converter config if I were to use something like a Unicomp PC122 which comes natively as USB the config is missing the left hand function keys as well as the key that would go below the down arrow. Also, if I wanted to split the numpad 0 into 2 seperate keys how could this be accomplished on the software end?

Interesting topic, It is worth to share this here.

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

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


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

You will have to know scan code of the keys, first.
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 01 December 2020, 18:41:43
OK, I figured this out.  I was doing something stupid.  ACTION_LAYER_TAP_KEY with caps lock om MacOS does work for me after hasu's change!

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

So this time, I went to the keymap editor (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb), selected USB-USB converter as the base firmware, loaded that, and then just manually re-entered my keymap and downloaded it.  Works great! 

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

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

Or you can bookmark 'Raw URL'(or 'URL shortener' may be useful) to backup your keymap instead of storing old firmware file somewhere.
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 02 December 2020, 00:08:03
I found these doc on Unicomp site. Green marked keys are not fully remappable unfortunately.
https://support.pckeyboard.com/knowledgebase.php?article=52
https://support.pckeyboard.com/knowledgebase.php?article=58


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

Interesting topic, It is worth to share this here.

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

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


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

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

Title: Re: USB to USB keyboard converter
Post by: TheNeonKnight on Thu, 03 December 2020, 13:35:30
I'm not sure how much faith I put in Unicomps documentation, they are resistant to most things new and probably would not even try to remap those keys. I bet it can be done, when I get my hands on one, ill be able to figure out more info.
Title: Re: USB to USB keyboard converter
Post by: TrollyBashGuy on Wed, 09 December 2020, 10:11:56
Hi Hasu,

I got your USB to USB converter and I am having problems with one of my keyboards (Logitech G213).
Here is the output from hid_listen when I plug it in, unplug and plugin again.

Code: [Select]
Listening:


TMK:2e5e6a69+/LUFA

usb_state: 12

USB configured.

Keyboard start.
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
[gC]Cl:003B
crIN:05
crIN:05
crIN:05
crIN:05
crIN:05
bNumEP:01
Cnf:00
bIfaceNum:00
bNumIface:00

Interface:00
PROTOCOL SET HID_BOOT rcode:00
SET_IDLE rcode:00
RPIPE rcode:00
BM configured
host.Task: 2319
usb_state: 90
speed: full
usb_state: 12
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
[gC]Cl:003B
crIN:05
crIN:05
crIN:05
crIN:05
crIN:05
bNumEP:01
Cnf:00
bIfaceNum:00
bNumIface:00

Interface:00
PROTOCOL SET HID_BOOT rcode:00
SET_IDLE rcode:00
RPIPE rcode:00
BM configured
host.Task: 2319
usb_state: 90
speed: full

I am running on windows 10 I have Linux on another machine if you need me to test it on that. It works with a different keyboard but not the G213.

Is there a way I can fix this problem? or do you know what is happening here?

Thanks in advance!
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 11 December 2020, 09:00:12
Thanks for your report.

USB STALL error happens on 'GET DESCRIPTOR(CONFIGURATION)' for some reason, this is same as this report.
https://geekhack.org/index.php?topic=69169.msg2896289#msg2896289

Can you try attached firmware?  this is debug firmware based the latest code.

[attachurl=1]


Hi Hasu,

I got your USB to USB converter and I am having problems with one of my keyboards (Logitech G213).
Here is the output from hid_listen when I plug it in, unplug and plugin again.


I am running on windows 10 I have Linux on another machine if you need me to test it on that. It works with a different keyboard but not the G213.

Is there a way I can fix this problem? or do you know what is happening here?

Thanks in advance!

Title: Re: USB to USB keyboard converter
Post by: TrollyBashGuy on Tue, 15 December 2020, 15:34:12
Sorry for the late reply I am doing exams at the moment. For some unknown reason the hex code that you gave me made the keyboard work.

Upon further inspection it doesn't work when I try to make the firmware myself. Is there anything that needs to be done to get it to work?

Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 17 December 2020, 20:06:59
Thanks for your test.
Can you share hid_listen log with the debug firmware I attached?


The debug firmware included change by my wild guess. This is the change.
And if possible, can you test to see diference with/without the change?

This should be applied under tmk_keyboard/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0-tmk/.
Code: [Select]
diff --git a/Usb.cpp b/Usb.cpp
index d8a51cb..2e334c0 100644
--- a/Usb.cpp
+++ b/Usb.cpp
@@ -170,8 +170,8 @@ uint8_t USB::ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bReque
 #if defined(ESP8266) || defined(ESP32)
                         yield(); // needed in order to reset the watchdog timer on the ESP8266
 #endif
-                                uint16_t read = nbytes;
-                                //uint16_t read = (left<nbytes) ? left : nbytes;
+                                //uint16_t read = nbytes;
+                                uint16_t read = (left<nbytes) ? left : nbytes;
 
                                 rcode = InTransfer(pep, nak_limit, &read, dataptr);
                                 if (rcode) USBTRACE2("crIN:", rcode);


Sorry for the late reply I am doing exams at the moment. For some unknown reason the hex code that you gave me made the keyboard work.

Upon further inspection it doesn't work when I try to make the firmware myself. Is there anything that needs to be done to get it to work?



Title: Re: USB to USB keyboard converter
Post by: santo on Mon, 21 December 2020, 01:34:39
Is Bluethooth to bluethooth converter possible?
Hi Hasu, I am thinking about all those cases where USB to USB converter is not usable because at least one end (host or keyboard) uses bluethooth only interface (iPad) or all the other cases in which a pure wireless connection is preferred.


Sent from my iPhone using Tapatalk
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 24 December 2020, 08:54:49
Updated firmware and fixed STALL error on GET_DESCRIPTOR(CONFIGURATION) (https://github.com/tmk/USB_Host_Shield_2.0/issues/4).
You can download from Keymap Editor or github repo.

I think this solves imcompatibility issues on some keyboards like Logitech G213 and NuType F1.

TrollyBashGuy and etops,
Could you try this on your keyobard when you have time?

Title: Re: USB to USB keyboard converter
Post by: garyngzb on Thu, 31 December 2020, 06:07:46
Updated firmware and fixed STALL error on GET_DESCRIPTOR(CONFIGURATION) (https://github.com/tmk/USB_Host_Shield_2.0/issues/4).
You can download from Keymap Editor or github repo.

I think this solves imcompatibility issues on some keyboards like Logitech G213 and NuType F1.

TrollyBashGuy and etops,
Could you try this on your keyobard when you have time?



Just received the converter!
It works well on my Logitech Unifying receiver, but not on my other keyboard.

The keyboard is some off-brand mechanical keyboard that I bought a few years back, below is some information about it - hopefully it helps in debugging what's going wrong (or maybe the keyboard is just poorly-made?)

I flashed the debug firmware downloaded from https://geekhack.org/index.php?topic=69169.msg2896191#msg2896191 (https://geekhack.org/index.php?topic=69169.msg2896191#msg2896191)

hid_listen output:

Code: [Select]
Waiting for new device:..
Listening:


TMK:2e5e6a69+/LUFA

usb_state: 12

USB configured.

Keyboard start.
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
[gC]Cl:0042
[pC][pI3][pI2][pI1][pI0][pI][pH][pE1][pE0][xE1][xE0][xE++][xE][pE][pI3][pI2][pI1][pI0][pH][pE1][pE0][pE][pE1][pE1][pE0][pE]bNumEP:02
Cnf:01
bIfaceNum:00
bNumIface:00

Interface:00
PROTOCOL SET HID_BOOT rcode:00
SET_IDLE rcode:00
RPIPE rcode:00
BM configured
host.Task: 2324
usb_state: 90
speed: full
TTTTTTTTTTTTTTTTT

The "TTTTT" appears when I press the keys on the keyboard.

USB descriptor (obtained via USB Device Tree Viewer):
Code: [Select]

    =========================== USB Port1 ===========================

Connection Status        : 0x01 (Device is connected)
Port Chain               : 2-1
Properties               : 0x01
 IsUserConnectable       : yes
 PortIsDebugCapable      : no
 PortHasMultiCompanions  : no
 PortConnectorIsTypeC    : no
ConnectionIndex          : 1
CompanionIndex           : 0
 CompanionHubSymLnk      : USB#ROOT_HUB30#4&e6886c1&0&0#{f18a0e88-c30c-11d0-8815-00a0c906bed8}
 CompanionPortNumber     : 16
 -> CompanionPortChain   : 2-16

      ======================== USB Device ========================

        +++++++++++++++++ Device Information ++++++++++++++++++
Device Description       : USB Composite Device
Device Path              : \\?\USB#VID_04B4&PID_3000#5&267524fb&0&1#{a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
Kernel Name              : \Device\USBPDO-12
Device ID                : USB\VID_04B4&PID_3000\5&267524FB&0&1
Hardware IDs             : USB\VID_04B4&PID_3000&REV_0108 USB\VID_04B4&PID_3000
Driver KeyName           : {36fc9e60-c465-11cf-8056-444553540000}\0021 (GUID_DEVCLASS_USB)
Driver                   : \SystemRoot\System32\drivers\usbccgp.sys (Version: 10.0.19041.488  Date: 2020-09-11)
Driver Inf               : C:\WINDOWS\inf\usb.inf
Legacy BusType           : PNPBus
Class                    : USB
Class GUID               : {36fc9e60-c465-11cf-8056-444553540000} (GUID_DEVCLASS_USB)
Service                  : usbccgp
Enumerator               : USB
Location Info            : Port_#0001.Hub_#0003
Location IDs             : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(1), ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HS01)
Container ID             : {8786439f-1333-11eb-9d48-80a589787414}
Manufacturer Info        : (Standard USB Host Controller)
Capabilities             : 0x84 (Removable, SurpriseRemovalOK)
Status                   : 0x0180600A (DN_DRIVER_LOADED, DN_STARTED, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
Problem Code             : 0
Address                  : 1
HcDisableSelectiveSuspend: 0
EnableSelectiveSuspend   : 0
SelectiveSuspendEnabled  : 0
EnhancedPowerMgmtEnabled : 0
IdleInWorkingState       : 0
WakeFromSleepState       : 0
Power State              : D0 (supported: D0, D1, D2, D3, wake from D0, wake from D1, wake from D2)
 Child Device 1          : USB Input Device
  Device ID              : USB\VID_04B4&PID_3000&MI_00\6&B3E4605&2&0000
  Class                  : HIDClass
  Driver KeyName         : {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0065 (GUID_DEVCLASS_HIDCLASS)
  Service                : HidUsb
   Child Device 1        : HID Keyboard Device
    Device Path 1        : \\?\HID#VID_04B4&PID_3000&MI_00#7&8b173b8&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} (GUID_DEVINTERFACE_KEYBOARD)
    Device Path 2        : \\?\HID#VID_04B4&PID_3000&MI_00#7&8b173b8&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd (GUID_DEVINTERFACE_HID)
    Kernel Name          : \Device\000004db
    Device ID            : HID\VID_04B4&PID_3000&MI_00\7&8B173B8&0&0000
    Class                : Keyboard
    Driver KeyName       : {4d36e96b-e325-11ce-bfc1-08002be10318}\0011 (GUID_DEVCLASS_KEYBOARD)
    Service              : kbdhid
 Child Device 2          : USB Input Device
  Device ID              : USB\VID_04B4&PID_3000&MI_01\6&B3E4605&2&0001
  Class                  : HIDClass
  Driver KeyName         : {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0066 (GUID_DEVCLASS_HIDCLASS)
  Service                : HidUsb
   Child Device 1        : HID-compliant system controller
    Device Path 1        : \\?\HID#VID_04B4&PID_3000&MI_01&Col02#7&311c2181&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} (GUID_DEVINTERFACE_HID)
    Device Path 2        : \\?\HID#VID_04B4&PID_3000&MI_01&Col02#7&311c2181&0&0001#{4afa3d53-74a7-11d0-be5e-00a0c9062857} (GUID_DEVICE_SYS_BUTTON)
    Kernel Name          : \Device\000004dd
    Device ID            : HID\VID_04B4&PID_3000&MI_01&COL02\7&311C2181&0&0001
    Class                : HIDClass
    Driver KeyName       : {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0067 (GUID_DEVCLASS_HIDCLASS)
   Child Device 2        : HID-compliant consumer control device
    Device Path          : \\?\HID#VID_04B4&PID_3000&MI_01&Col03#7&311c2181&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} (GUID_DEVINTERFACE_HID)
    Kernel Name          : \Device\000004de
    Device ID            : HID\VID_04B4&PID_3000&MI_01&COL03\7&311C2181&0&0002
    Class                : HIDClass
    Driver KeyName       : {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0068 (GUID_DEVCLASS_HIDCLASS)
   Child Device 3        : HID-compliant vendor-defined device
    Device Path          : \\?\HID#VID_04B4&PID_3000&MI_01&Col04#7&311c2181&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} (GUID_DEVINTERFACE_HID)
    Kernel Name          : \Device\000004df
    Device ID            : HID\VID_04B4&PID_3000&MI_01&COL04\7&311C2181&0&0003
    Class                : HIDClass
    Driver KeyName       : {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0069 (GUID_DEVCLASS_HIDCLASS)
   Child Device 4        : HID-compliant mouse
    Device Path 1        : \\?\HID#VID_04B4&PID_3000&MI_01&Col01#7&311c2181&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} (GUID_DEVINTERFACE_MOUSE)
    Device Path 2        : \\?\HID#VID_04B4&PID_3000&MI_01&Col01#7&311c2181&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} (GUID_DEVINTERFACE_HID)
    Kernel Name          : \Device\000004dc
    Device ID            : HID\VID_04B4&PID_3000&MI_01&COL01\7&311C2181&0&0000
    Class                : Mouse
    Driver KeyName       : {4d36e96f-e325-11ce-bfc1-08002be10318}\0009 (GUID_DEVCLASS_MOUSE)
    Service              : mouhid
   Child Device 5        : HID Keyboard Device
    Device Path 1        : \\?\HID#VID_04B4&PID_3000&MI_01&Col05#7&311c2181&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd (GUID_DEVINTERFACE_HID)
    Device Path 2        : \\?\HID#VID_04B4&PID_3000&MI_01&Col05#7&311c2181&0&0004#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} (GUID_DEVINTERFACE_KEYBOARD)
    Kernel Name          : \Device\000004e0
    Device ID            : HID\VID_04B4&PID_3000&MI_01&COL05\7&311C2181&0&0004
    Class                : Keyboard
    Driver KeyName       : {4d36e96b-e325-11ce-bfc1-08002be10318}\0012 (GUID_DEVCLASS_KEYBOARD)
    Service              : kbdhid

        +++++++++++++++++ Registry USB Flags +++++++++++++++++
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\04B430000108
 osvc                    : REG_BINARY 00 00
 NewInterfaceUsage       : REG_DWORD 00000000 (0)

        ---------------- Connection Information ---------------
Connection Index         : 0x01 (1)
Connection Status        : 0x01 (DeviceConnected)
Current Config Value     : 0x01
Device Address           : 0x19 (25)
Is Hub                   : 0x00 (no)
Device Bus Speed         : 0x01 (Full-Speed)
Number Of Open Pipes     : 0x03 (3 pipes to data endpoints)
Pipe[0]                  : EndpointID=1  Direction=IN   ScheduleOffset=0  Type=Interrupt
Pipe[1]                  : EndpointID=2  Direction=IN   ScheduleOffset=0  Type=Interrupt
Pipe[2]                  : EndpointID=3  Direction=OUT  ScheduleOffset=0  Type=Interrupt
Data (HexDump)           : 01 00 00 00 12 01 00 02 00 00 00 08 B4 04 00 30   ...............0
                           08 01 00 00 00 01 01 01 00 19 00 03 00 00 00 01   ................
                           00 00 00 07 05 81 03 08 00 01 00 00 00 00 07 05   ................
                           82 03 40 00 01 00 00 00 00 07 05 03 03 40 00 01   ..@..........@..
                           00 00 00 00                                       ....

        --------------- Connection Information V2 -------------
Connection Index         : 0x01 (1)
Length                   : 0x10 (16 bytes)
SupportedUsbProtocols    : 0x03
 Usb110                  : 1 (yes)
 Usb200                  : 1 (yes)
 Usb300                  : 0 (no)
 ReservedMBZ             : 0x00
Flags                    : 0x00
 DevIsOpAtSsOrHigher     : 0 (Is not operating at SuperSpeed or higher)
 DevIsSsCapOrHigher      : 0 (Is not SuperSpeed capable or higher)
 DevIsOpAtSsPlusOrHigher : 0 (Is not operating at SuperSpeedPlus or higher)
 DevIsSsPlusCapOrHigher  : 0 (Is not SuperSpeedPlus capable or higher)
 ReservedMBZ             : 0x00
Data (HexDump)           : 01 00 00 00 10 00 00 00 03 00 00 00 00 00 00 00   ................

    ---------------------- Device Descriptor ----------------------
bLength                  : 0x12 (18 bytes)
bDescriptorType          : 0x01 (Device Descriptor)
bcdUSB                   : 0x200 (USB Version 2.00) -> wrong, device is Full-Speed only
bDeviceClass             : 0x00 (defined by the interface descriptors)
bDeviceSubClass          : 0x00
bDeviceProtocol          : 0x00
bMaxPacketSize0          : 0x08 (8 bytes)
idVendor                 : 0x04B4 (Cypress Semiconductor)
idProduct                : 0x3000
bcdDevice                : 0x0108
iManufacturer            : 0x00 (No String Descriptor)
iProduct                 : 0x00 (No String Descriptor)
iSerialNumber            : 0x00 (No String Descriptor)
bNumConfigurations       : 0x01 (1 Configuration)
Data (HexDump)           : 12 01 00 02 00 00 00 08 B4 04 00 30 08 01 00 00   ...........0....
                           00 01                                             ..

    ------------------ Configuration Descriptor -------------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x02 (Configuration Descriptor)
wTotalLength             : 0x0042 (66 bytes)
bNumInterfaces           : 0x02 (2 Interfaces)
bConfigurationValue      : 0x01 (Configuration 1)
iConfiguration           : 0x02 (String Descriptor 2)
 Language 0x0409         : "Game_Keyboard"
bmAttributes             : 0xA0
 D7: Reserved, set 1     : 0x01
 D6: Self Powered        : 0x00 (no)
 D5: Remote Wakeup       : 0x01 (yes)
 D4..0: Reserved, set 0  : 0x00
MaxPower                 : 0x32 (100 mA)
Data (HexDump)           : 09 02 42 00 02 01 02 A0 32 09 04 00 00 01 03 01   ..B.....2.......
                           01 02 09 21 11 01 21 01 22 3F 00 07 05 81 03 08   ...!..!."?......
                           00 01 09 04 01 00 02 03 01 02 04 09 21 11 01 21   ............!..!
                           01 22 B0 00 07 05 82 03 40 00 01 07 05 03 03 40   ."......@......@
                           00 01                                             ..

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x00
bAlternateSetting        : 0x00
bNumEndpoints            : 0x01 (1 Endpoint)
bInterfaceClass          : 0x03 (HID - Human Interface Device)
bInterfaceSubClass       : 0x01 (Boot Interface)
bInterfaceProtocol       : 0x01 (Keyboard)
iInterface               : 0x02 (String Descriptor 2)
 Language 0x0409         : "Game_Keyboard"
Data (HexDump)           : 09 04 00 00 01 03 01 01 02                        .........

        ------------------- HID Descriptor --------------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x21 (HID Descriptor)
bcdHID                   : 0x0111 (HID Version 1.11)
bCountryCode             : 0x21 (33 = US)
bNumDescriptors          : 0x01
Data (HexDump)           : 09 21 11 01 21 01 22 3F 00                        .!..!."?.
Descriptor 1:
bDescriptorType          : 0x22 (Class=Report)
wDescriptorLength        : 0x003F (63 bytes)
Error reading descriptor : ERROR_INVALID_PARAMETER

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x81 (Direction=IN EndpointID=1)
bmAttributes             : 0x03 (TransferType=Interrupt)
wMaxPacketSize           : 0x0008 (8 bytes)
bInterval                : 0x01 (1 ms)
Data (HexDump)           : 07 05 81 03 08 00 01                              .......

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x01
bAlternateSetting        : 0x00
bNumEndpoints            : 0x02 (2 Endpoints)
bInterfaceClass          : 0x03 (HID - Human Interface Device)
bInterfaceSubClass       : 0x01 (Boot Interface)
bInterfaceProtocol       : 0x02 (Mouse)
iInterface               : 0x04 (String Descriptor 4)
 Language 0x0409         : "Function_Device"
Data (HexDump)           : 09 04 01 00 02 03 01 02 04                        .........

        ------------------- HID Descriptor --------------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x21 (HID Descriptor)
bcdHID                   : 0x0111 (HID Version 1.11)
bCountryCode             : 0x21 (33 = US)
bNumDescriptors          : 0x01
Data (HexDump)           : 09 21 11 01 21 01 22 B0 00                        .!..!."..
Descriptor 1:
bDescriptorType          : 0x22 (Class=Report)
wDescriptorLength        : 0x00B0 (176 bytes)
Error reading descriptor : ERROR_INVALID_PARAMETER

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x82 (Direction=IN EndpointID=2)
bmAttributes             : 0x03 (TransferType=Interrupt)
wMaxPacketSize           : 0x0040 (64 bytes)
bInterval                : 0x01 (1 ms)
Data (HexDump)           : 07 05 82 03 40 00 01                              ....@..

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x03 (Direction=OUT EndpointID=3)
bmAttributes             : 0x03 (TransferType=Interrupt)
wMaxPacketSize           : 0x0040 (64 bytes)
bInterval                : 0x01 (1 ms)
Data (HexDump)           : 07 05 03 03 40 00 01                              ....@..

    ----------------- Device Qualifier Descriptor -----------------
Error                    : ERROR_GEN_FAILURE

      -------------------- String Descriptors -------------------
             ------ String Descriptor 0 ------
bLength                  : 0x04 (4 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language ID[0]           : 0x0409 (English - United States)
Data (HexDump)           : 04 03 09 04                                       ....
             ------ String Descriptor 2 ------
bLength                  : 0x1C (28 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "Game_Keyboard"
Data (HexDump)           : 1C 03 47 00 61 00 6D 00 65 00 5F 00 4B 00 65 00   ..G.a.m.e._.K.e.
                           79 00 62 00 6F 00 61 00 72 00 64 00               y.b.o.a.r.d.
             ------ String Descriptor 4 ------
bLength                  : 0x20 (32 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "Function_Device"
Data (HexDump)           : 20 03 46 00 75 00 6E 00 63 00 74 00 69 00 6F 00    .F.u.n.c.t.i.o.
                           6E 00 5F 00 44 00 65 00 76 00 69 00 63 00 65 00   n._.D.e.v.i.c.e.


Thanks!

I tried with the new firmware downloaded from GitHub with the same keyboard, and it works now!
Thanks!
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 31 December 2020, 08:30:21
garyngzb, Thank you for the feedback!


Title: Re: USB to USB keyboard converter
Post by: hyn on Fri, 08 January 2021, 16:30:37
Hi hasu, I received the converter at the tail end of last year and it's great, I'm using it with a Ducky Skyline One II (https://www.duckychannel.com.tw/en/Ducky-One2-Skyline-TKL) and it works perfectly. I really like it a lot.

I thought I would post first off to say thank you for making this, but secondly I fixed a problem that others may have.

I recently found that when I rebooted my pc or laptop it wouldn't recognise the keyboard till I unplug and re-plugged it. At first I thought it might be to do with the issues previously discussed in the thread around reboots, but I found instead it was due to the usb switch I was using to swap between my work laptop and home PC. I'm using a UGreen usb switch, and I think it just wasn't providing enough power. I found that you can power it independently and since then it's worked perfectly.

Hope this is the right place to post this and thanks again.
Title: Re: USB to USB keyboard converter
Post by: JimDetroit on Fri, 08 January 2021, 21:35:24
To any users of the Rosewill RK-9200: Hasu's latest patch fixes the non-responsive issue for this keyboard and several others. Thanks, Hasu!

Thanks, Hasu. Please let me know if you think of any other tests to run and I can do them for you and report the results.

JimDetroit,
Thanks for the log. It seems to work as expected and I couldn't find any clue there unfrotunately.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 09 January 2021, 01:05:32
hyn and JimDetroit,
Thank you for your feedback!

I believe that recent fix for TOGGLE error and STALL error improved compatibility of this converter grately.
If someone had problem before it is worth trying the latest firmware.
Title: Re: USB to USB keyboard converter
Post by: ilikepi2 on Mon, 25 January 2021, 18:08:26
Scratching my head on this one, so I figured I'd ask here:

I've got a USB to USB converter that I assembled based on this project, which is specifically for the Realforce 87U family:
https://github.com/duoshock/U2U-for-Norbaforce

However, it doesn't seem to take any input from the keyboard itself. Here's the logs from HID_Listen with the TMK debug firmware loaded:

Code: [Select]

TMK:c230460b+/LUFA
   
   
USB configured.
   
Keyboard start.
usb_state: 12

This device stays like this and does not leave this state, even if left alone for about a minute. I had one success with this board outputting inputs by plugging in the converter first and then plugging in the keyboard, but I have not had any luck since then.

 The device is plugged into a USB 2.0 port on my motherboard, but I've also tried USB 3.0 and a USB 3.0 hub as well. This has happened on two different boards I've tried (86 and 87U). Would you happen to have any insight into this?

EDIT: It seems to be hardware related. I used another one I assembled, and it looks like it's working on that one perfectly fine. I will continue investigating and see what's up.
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 25 January 2021, 19:47:10
Tried latest firmware? You can use debug firmware to get more info.
Title: Re: USB to USB keyboard converter
Post by: ilikepi2 on Tue, 26 January 2021, 01:42:46
Thanks for the quick reply, Hasu! I tried the latest copy of the debug firmware, unfortunately the above error is all I got. I will see if I can try and get USB descriptor working and see if anything else comes up.

From further examination, I believe this PCB might have been assembled incorrectly or something happened to it while I was handling it, as another PCB assembled to the exact same standard is working perfectly with my 86U and another one worked properly with my 87U as well. It doesn't look like the Realforce is communicating with the converter properly.

 
Title: Re: USB to USB keyboard converter
Post by: FungibleHappiness on Sat, 20 February 2021, 20:25:19
Hi hasu,

I picked up one of your usb2usb converters and have been using it without issue with a couple of keyboards and a recent TMK build.

Keychron K8 (https://www.keychron.com/pages/keychron-k8-wireless-mechanical-keyboard)
Apple A1048

Just passing the info along so they can be added to the list of supported keyboards.

Thanks for making all this possible!

Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 20 February 2021, 23:17:53
Thanks for your feedback!

Just updated the first post.
Title: Re: USB to USB keyboard converter
Post by: bluemilkfan on Thu, 18 March 2021, 17:54:14
apologies as I didn't go through all 13 pages of this thread and so these may have been mentioned. Regardless got my converter today and it worked perfectly for the UNICOMP Model M clone and a compact GMMK. Thrilled about the UNICOMP because I love my backspace and left control in the HHKB layout. Looking forward to seeing what else I can do with this. Really an amazing device! Thank you!
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 18 March 2021, 19:25:19
Thanks for your feedback!
Just updated compatibility list in the first post.
Title: Re: USB to USB keyboard converter
Post by: elcano on Mon, 22 March 2021, 00:23:53
Last week I received one USB to USB converter from 1upkeyboards. I guess that this was the most recent batch before it went out of stock again.

I already learned to use the web TMK Keymap editor and was able to load the generated firmware using dfu-programmer (I use Linux). I was also able to install TMK, compile and flash locally without problems.

However, I have been using a Brand New Model F Keyboard with QMK for some months and I have invested a lot of time learning to configure QMK and configuring my keyboard using C  language functions and macros. I was hoping to be able to use replicate most of the functionality in my non-programmable keyboards using the converter. I know that you don't support QMK, but are you aware for a reason for which this specific converter (probably latest batch) might not work with QMK, as configured currently? I tried using the web QMK Keymap editor. I did exactly the same that I did with the TMK Keymap editor, but after flashing, the PC doesn't receive the keys that I type in the keyboard connected to the converter. I also tried compiling some of the sample keyboard layouts that come in QMK for this converter and got the same results. I made sure that confirm that F_CPU = 16000000.

Again, I'm not expecting support for QMK here. I'll seek that support in the proper forum. Just wanted to check if there was something that we needed to be aware about the most recent batch/version of this device.

Thanks!
Title: Re: USB to USB keyboard converter
Post by: Zerpellica on Thu, 08 April 2021, 05:25:23
Last week I received one USB to USB converter from 1upkeyboards. I guess that this was the most recent batch before it went out of stock again.

I already learned to use the web TMK Keymap editor and was able to load the generated firmware using dfu-programmer (I use Linux). I was also able to install TMK, compile and flash locally without problems.

However, I have been using a Brand New Model F Keyboard with QMK for some months and I have invested a lot of time learning to configure QMK and configuring my keyboard using C  language functions and macros. I was hoping to be able to use replicate most of the functionality in my non-programmable keyboards using the converter. I know that you don't support QMK, but are you aware for a reason for which this specific converter (probably latest batch) might not work with QMK, as configured currently? I tried using the web QMK Keymap editor. I did exactly the same that I did with the TMK Keymap editor, but after flashing, the PC doesn't receive the keys that I type in the keyboard connected to the converter. I also tried compiling some of the sample keyboard layouts that come in QMK for this converter and got the same results. I made sure that confirm that F_CPU = 16000000.

Again, I'm not expecting support for QMK here. I'll seek that support in the proper forum. Just wanted to check if there was something that we needed to be aware about the most recent batch/version of this device.

Thanks!

I got it running on QMK and i'm now learning to code in c.
I dont know what i did different then you because i have 0 experience with this but i would like to help you with as much as i can.
First of all i followed this tutorial (https://beta.docs.qmk.fm/tutorial/newbs_getting_started).
downloaded QMK MSYS for this and used the path converter/usb_usb/hasu.
later in the process i made my own keymap which i think other people can use also because i can see the keymaps from others too.
since you said you have some experience in C language i skip my basic commands (mostly just multiple keystroaks at once)
later i compiled it what also creates a hexfile, this file i flashed to the converter using QMK toolbox.

Title: Re: USB to USB keyboard converter
Post by: shadowen on Sun, 11 April 2021, 12:36:04
Just wanted to report the converter works for the Logitech g915 with the lightspeed receiver. The app, media, and G keys didn't work, but that is to be expected. Now I just have to make that my next project :)

Genuinely impressive work Hasu, you have changed the world for the better.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 11 April 2021, 19:46:17
Thanks for your report. Just updated list in the first post.
Title: Re: USB to USB keyboard converter
Post by: Volny on Sun, 11 April 2021, 21:00:14
Is it possible/easy to use this converter to send characters like ("{}[]#$ directly (without needing modifiers), or at least very quickly? I currently use a Ducky Pocket that I've remapped for those characters, but the Ducky does them by sending slow modifier-based sequences. For example, to send a ( it sends Shift-down, 9-down, 9up, Shift-up. The whole sequence takes around 400ms, which makes it impossible to quickly combine or double-tap those keys. If I set the Ducky Pocket to output a single character (which is very fast), would the USB-converter be able to convert that into a very fast ( or { or $ ?
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 11 April 2021, 23:20:18
In US and most layouts you can't input ( without Shift in general while you can in French AZERTY.
It depends on keyboard layout on computer regardless of this converter.

Yes, the converter can send Shift and 9 in a row respectively without any interval.

Title: Re: USB to USB keyboard converter
Post by: Volny on Sun, 11 April 2021, 23:24:01
Lovely. I'm off to buy one then :)
Title: Re: USB to USB keyboard converter
Post by: Icemanrec on Fri, 30 April 2021, 21:34:15
not listed in the first page but does this work for the 108UG-HiPro JIS model? would love to be able to reprogram all those extra keys.
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 30 April 2021, 21:58:01
We can't know that without trying actually, though I think it works.

All keys specific to JIS should be supported with default firmware.
Title: Re: USB to USB keyboard converter
Post by: Icemanrec on Sat, 01 May 2021, 06:26:15
We can't know that without trying actually, though I think it works.

All keys specific to JIS should be supported with default firmware.

wow same day reply, very nice! and thank you for feedback i will go and grab one of your controllers, where is best to get one? i am based in hong kong
Title: Re: USB to USB keyboard converter
Post by: suicidal_orange on Thu, 06 May 2021, 02:52:56
We can't know that without trying actually, though I think it works.

All keys specific to JIS should be supported with default firmware.

wow same day reply, very nice! and thank you for feedback i will go and grab one of your controllers, where is best to get one? i am based in hong kong
Hasu's sales thread for these (https://geekhack.org/index.php?topic=109514.0) :)
Title: Re: USB to USB keyboard converter
Post by: Lunatique on Mon, 10 May 2021, 20:26:50
Someone suggested I take a look at this gadget as a viable replacement for TouchCursor. Before I order one, I'd like to make sure it can do exactly what TouchCursor can do, and can do the kind of mapping I need, as seen in this post: https://geekhack.org/index.php?topic=112674

The most important part is I need the spacebar to act like the activator, and then map all the various navigation and highlighting functions onto the home row and surrounding keys, so I never need to go far from home row for anything while typing.
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 10 May 2021, 23:20:11
I think you can define same key actions of your layout with this converter.
I've aslo used space bar as "activator" daily for a decade with my firmware.
I just tried TouchCursor for a few minutes and didn't feel strange, you won't feel discomfort much with my firmware too.

Title: Re: USB to USB keyboard converter
Post by: Lunatique on Tue, 11 May 2021, 01:00:33
I think you can define same key actions of your layout with this converter.
I've aslo used space bar as "activator" daily for a decade with my firmware.
I just tried TouchCursor for a few minutes and didn't feel strange, you won't feel discomfort much with my firmware too.

Thanks! How difficult would it be to program my TouchCursor setup with the converter? I'm not a coder, so  hope it's a very simple process. Here are some examples of some of the key combos I have set up:

[attachimg=1]
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 11 May 2021, 02:00:48
Not that easy but I think non-programmers also can manage somewhat.
You'll have to check some docs, start with the first post.

This is example on KeymapEditor for 'SpaceFn' called in the community, whihc is similar to yours.
https://bit.ly/3licBwS

See 'M' key posision on Layer1 especially to know how to define 'modifiered key' action. <Left Shift + `(Grave)> action is defined there to register ~(Tilde) on computer.

Use 'Code Edit' tab on the Keymap Editor to define 'modified key' using 'ACTION_MODS_KEY'.
Title: Re: USB to USB keyboard converter
Post by: nevin on Tue, 11 May 2021, 08:44:17
@Lunatique - i'll help you with it.

... was a little hard to decipher your pic in the other thread.

i'm nevin#3887 on discord if you want to hit me up there too.
Title: Re: USB to USB keyboard converter
Post by: Lunatique on Wed, 12 May 2021, 18:55:24
Thanks for all the help. I managed to get TouchCursor working with Scrivener again. I had to reinstall TouchCursor to make that happen. Very strange because it was working fine with other software and only had problem with Scrivener.
Title: Re: USB to USB keyboard converter
Post by: clexp on Fri, 21 May 2021, 04:25:05
Hi,
Just joined to say thanks to Hasu for such an amazing convertor project. It is working well and is really fixing a problem I did not know I had. 

I would be grateful for some config advice. Everything is working 99% perfect. 

Background: I work in non tech help desk, have to type a lot; and it is a dirty environment.  We hotdesk, the keyboards are heavy and sticky. Learnt touch type qwerty, then learnt about Colemak. Thought I would get a new Colemak board that I take with me, using Tarmak at work till I am fast enough, and similar setup at home. I could not find a board that does this, and at work boards eventually get uncleanable - they just need replacing - this would expensive. Instead went for the cheap board plus convertor.  Further, at home I am newly a Mac user. The USB convertor was perfect here; the Mac implementation of Colemak does not swap the Capslock key, so again here the convertor is brilliant.  The Keyboard is this one:
https://www.amazon.co.uk/TeckNet-Wireless-Keyboard-keyboard-Whisper-Quiet/dp/B00M75WPKO/ref=sr_1_1_sspa?crid=1CTFMUE0KU3EO&dchild=1&keywords=tecknet+wireless+keyboard&qid=1621574875&sprefix=tecknet+%2Caps%2C172&sr=8-1-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUEyRkdTUjdNTkVQQ1lEJmVuY3J5cHRlZElkPUEwMDAwMzEzUlBaMkMxNkg1U0QmZW5jcnlwdGVkQWRJZD1BMDk3MDQxNjMzVzNNR0tKUUpCTjUmd2lkZ2V0TmFtZT1zcF9hdGYmYWN0aW9uPWNsaWNrUmVkaXJlY3QmZG9Ob3RMb2dDbGljaz10cnVl (https://www.amazon.co.uk/TeckNet-Wireless-Keyboard-keyboard-Whisper-Quiet/dp/B00M75WPKO/ref=sr_1_1_sspa?crid=1CTFMUE0KU3EO&dchild=1&keywords=tecknet+wireless+keyboard&qid=1621574875&sprefix=tecknet+%2Caps%2C172&sr=8-1-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUEyRkdTUjdNTkVQQ1lEJmVuY3J5cHRlZElkPUEwMDAwMzEzUlBaMkMxNkg1U0QmZW5jcnlwdGVkQWRJZD1BMDk3MDQxNjMzVzNNR0tKUUpCTjUmd2lkZ2V0TmFtZT1zcF9hdGYmYWN0aW9uPWNsaWNrUmVkaXJlY3QmZG9Ob3RMb2dDbGljaz10cnVl)
and the Mac is a MacBook Pro. (Sorry I could not make the link work)

The problem: Just a few last config irks:
1. The new cheap keyboard has a blue 'Fn' key which allows use of an internal layer (see link) to access media, backslash/pipe, page up/down and home/end (all written in blue on the keys). On the board it is second in from left on the bottom row.  On the keymap it is second to right of space bar. (When I change that key on the unimap, that is the one that will change the blue Fn key).  Tried using this to set a momentary layer for media etc, but it seems not to work. Without the convertor the Mac Will accept most of the blue keys, but it takes the blue Fn-z (pipe) and Fn-x (backslash) as backtick/tilde key - (when in fact the code for backslash/fife is sent - I think). In the Unimap, I have set this to pipe/backslash as that is the one I need the most. What options do I have for using this key as its blue original Fn?

2. The cheap board has an ISO # key above the enter key - UK layout. When I set it to ISO hash, the Mac interprets this as backslash/pipe, regardless if the Keyboard is connected through the convertor or directly. So that is a Mac thing.  On the Mac board. the Mac key for # is [option-3] and for ~  is [shift-`]  where the ` key is in place of backslash/pipe would be on a normal US board - left of the z key. Is there a way to make the convertor send a [option-3] when # is pressed, and send [shift-`] when shift-# is pressed?

3. The top left key below escape is the ` key on the cheap board, which the Mac always rewrites as §/± (that’s the double S / plus-minus sign). The Mac back tic is left of the z (so is its internal actually pipe/backslash?) so if the convertor sent backslash/pipe on back tic key would I get what I wanted? Not tried that specifically, but experiments so far, suggest not. Any Thoughts?

I did have a go at hid_listen.mac64, but macOS blocked it 'unconfirmed developer' and I am a bit too new to Mac to fix this yet.

I typed this REALLY slowly with the convertor set to colemak. Thanks everyone.
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 21 May 2021, 06:10:40
The problem: Just a few last config irks:
1. The new cheap keyboard has a blue 'Fn' key which allows use of an internal layer (see link) to access media, backslash/pipe, page up/down and home/end (all written in blue on the keys). On the board it is second in from left on the bottom row.  On the keymap it is second to right of space bar. (When I change that key on the unimap, that is the one that will change the blue Fn key).  Tried using this to set a momentary layer for media etc, but it seems not to work. Without the convertor the Mac Will accept most of the blue keys, but it takes the blue Fn-z (pipe) and Fn-x (backslash) as backtick/tilde key - (when in fact the code for backslash/fife is sent - I think). In the Unimap, I have set this to pipe/backslash as that is the one I need the most. What options do I have for using this key as its blue original Fn?
I can't get what your problem is actually. Can you rephrase it ?

Note that these limitations of the converter.
- You cannot remap 'Fn' key with the converter, becasue 'Fn' key doesn't send any scan code and is processed internally within keyboard.
- You cannot remap and handle Media keys of keybaord with the converter, because the converter cannot recognize their scan codes.
Refer to 'Limitation' in the first post.



Quote
2. The cheap board has an ISO # key above the enter key - UK layout. When I set it to ISO hash, the Mac interprets this as backslash/pipe, regardless if the Keyboard is connected through the convertor or directly. So that is a Mac thing.  On the Mac board. the Mac key for # is [option-3] and for ~  is [shift-`]  where the ` key is in place of backslash/pipe would be on a normal US board - left of the z key. Is there a way to make the convertor send a [option-3] when # is pressed, and send [shift-`] when shift-# is pressed?
I don't have macos to test and don't know UK layout much. You are using UK-layout on MacOS, right?

You better check MacOS really sees the keyboard as ISO.
It seems you can specify yourself if MacOS doesn't recognize your keyboard correctly.
https://support.apple.com/guide/mac-help/specify-a-keyboard-type-mchlp2886/mac


What does scan code show up in debug output "when # is press"?
You can use 'hid_listen' to get debug output like below. See the first post.

Code: [Select]
input 1: 00 00 1D 00 00 00 00 00
00 00 1D 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 1D 00 00 00 00 00
00 00 1D 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00


Use 'ACTION_MODS_KEY' to send modified key in 'Code Edit' tab on Keymap Editor.
See position of 'M' key on Layer 1 for example, it is configured to send Shift + `.
https://bit.ly/3licBwS


Quote
3. The top left key below escape is the ` key on the cheap board, which the Mac always rewrites as §/± (that’s the double S / plus-minus sign). The Mac back tic is left of the z (so is its internal actually pipe/backslash?) so if the convertor sent backslash/pipe on back tic key would I get what I wanted? Not tried that specifically, but experiments so far, suggest not. Any Thoughts?

I think so. Try what you want.
It seems that UK keyboard layout is different between Mac and PC, it is annoying




Quote
I did have a go at hid_listen.mac64, but macOS blocked it 'unconfirmed developer' and I am a bit too new to Mac to fix this yet.

Without hid_listen it is really difficult to debug. Hope we can find solution for that.

Title: Re: USB to USB keyboard converter
Post by: nevin on Fri, 21 May 2021, 07:43:58
Quote
I did have a go at hid_listen.mac64, but macOS blocked it 'unconfirmed developer' and I am a bit too new to Mac to fix this yet.
run apps other than from app store:
- to go system preferances
- go to security & privacy
- click on the lock in the bottom left corner (enter password or touch id)
- under general tab, allow from "app store and indentified developers
- start the program you want to run
- you may get a prompt when the app loads to verify that you want to use it
this works with any signed app that's compatible with your version of mac OS. this will not work for un-signed apps though, that's a different workaround.

see screen shots below:
[attach=1]
[attach=2]
[attach=3]

yes, sounds like there's something not matching between language of the keyboard and what the computer is saying the language is....
- system preferances
- keyboard -> change keyboard type (button lower left)
or
- system preferances
- language & region
Title: Re: USB to USB keyboard converter
Post by: pauld on Mon, 31 May 2021, 05:03:26
Sorry if this has been asked and answered before - I could not find an answer.
If I use the TMK online Keymap Editor to generate a hex file for the USB-USB convertor, is it possible to add foreign language characters?  I need to include Å Ä and Ö to the keymap but I can't see these.  I also use Left Alt as a compose key (that is what it was called on Sun keyboards - xmodmap calls it multi_key).  Eg the sequence compose-o-o produces the degree symbol °  Can that be programmed via the online keymap editor?  That is less important as I can just put all the special characters I am likely to need on other levels.
I have done a basic map as a test and I must say, this is an absolutely brilliant device.  Many thanks to hasu
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 31 May 2021, 05:56:21
No. You can't define key sequence like 'compose-o-o' on Keymap Editor.
Simple modified key like RightAlt(AltGr)+o can be defined on Keymap Editor, but Macro is need to input coplmex key sequence and you have to write C code to define Macro.
Title: Re: USB to USB keyboard converter
Post by: suicidal_orange on Mon, 31 May 2021, 06:10:03
Sorry if this has been asked and answered before - I could not find an answer.
If I use the TMK online Keymap Editor to generate a hex file for the USB-USB convertor, is it possible to add foreign language characters?  I need to include Å Ä and Ö to the keymap but I can't see these.  I also use Left Alt as a compose key (that is what it was called on Sun keyboards - xmodmap calls it multi_key).  Eg the sequence compose-o-o produces the degree symbol °  Can that be programmed via the online keymap editor?  That is less important as I can just put all the special characters I am likely to need on other levels.
I have done a basic map as a test and I must say, this is an absolutely brilliant device.  Many thanks to hasu
If you use the US-International layout in your operating system you can access these characters by holding Alt Gr as seen here:
[attach=1]
So what you would do is emulate that in the convertor.

The other option is as I mentioned in your thread - have a default layer with the keys assigned in sv-dvorak positions (using US labels) and another layer with the standard layout for recovery mode.

The compose key also seems to be handled on the computer so that should still work with the convertor.  Or the degree symbol can be input on Linux by holding Ctrl+Shift and typing ub0 and this should work on the convertor as a macro, I just tried on the layout editor website (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb) but when I try to assign ACTION_MACRO on the Code Edit tab it doesn't seem to work so I'll wait for hasu's input on that.

As you're in Linux it is not hard to manually edit the text files and compile the firmware yourself which would allow you to do anything - is that of any interest to you?
Title: Re: USB to USB keyboard converter
Post by: pauld on Mon, 31 May 2021, 07:58:56
Thanks both for your replies. 

What I am aiming for - I'm not completely certain that it is possible, but I think it is - is that all the re-mapping currently done by xmodmap is done by the convertor, such that I could plug it into any computer (at least one running linux) and I would get the layout I want, without any need to change anything on the computer itself, and without having to use extra levels or alt keys to get the extra letters (they are just a single key press now).  As I said, I have had a basic try-out of installing a standard dvorak-with-uk-punctuation layout onto the convertor and that is great - I can plug it into my wife's laptop and the internal keyboard retains standard ISO uk-english layout but an external keyboard connected via the convertor gives dvorak layout.  Thus I can broadly achieve what I want, but there are no buttons on the Keymap Editor that have the extra 3 characters on them.

It's a similar requirement for the multi-key: I don't want it to actually execute a macro that sends the complete sequence for, say, a degree symbol.  I just want the key to the left of the space bar to send "Multi Key" instead of "Left Alt" - that is, the convertor makes the change, rather than xmodmap.  Using the Keymap Editor I can easily assign the left alt key to Tab or Right_Shift or whatever because those options are provided on the Keymap Editor, but Multi_Key is not. 

To summarise, I suppose I am looking for a way of adding a couple of extra things to the Keymap Editor that aren't already there.

As far as compiling the firmware myself goes... I have a horrible feeling that that is what I will end up having to do if I want to completely avoid using xmodmap.  However, it's years since I did any programming.  I had a quick look, got as far as running make, and got the dreaded error messages.  (I tried it on 2 different machines and got 2 different error messages: "avr-gcc: not found" on one and "/usr/lib/gcc/avr/5.4.0/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory
compilation terminated."  I fear it would be a long haul sorting all this out.
Title: Re: USB to USB keyboard converter
Post by: nevin on Mon, 31 May 2021, 12:38:41
you just have to make sure you have your build environment setup. it's looking for things that need to be installed.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/build.md
Title: Re: USB to USB keyboard converter
Post by: pauld on Mon, 31 May 2021, 13:53:39
> you just have to make sure you have your build environment setup

Of course, you are right, but that's where things always seem to get tricky ;(

I have followed the instructions in the link you posted above, and  all the tools seem to be installed, yet I still get the error about stdint.h.    make clean completes without errors, but make does not:

Code: [Select]
$ make -f Makefile.unimap

-------- begin --------
avr-gcc (GCC) 5.4.0
Copyright (C) 2015 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.


mkdir -p obj_usb_usb_unimap
Compiling C: unimap.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DARDUINO=1813 -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DUNIMAP_ENABLE -DACTIONMAP_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DNO_DEBUG -DKEYMAP_SECTION_ENABLE -DTMK_VERSION=a93677cb -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_usb_usb_unimap/unimap.lst -I../../tmk_core/common -I. -I../../tmk_core -I../../tmk_core/protocol/usb_hid -I../../tmk_core/protocol/usb_hid/USB_Host_Shield_2.0-tmk -I../../tmk_core/protocol/usb_hid/arduino-1.8.13/cores/arduino -I../../tmk_core/protocol/usb_hid/arduino-1.8.13/variants/leonardo -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/lufa-abcminiuser -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_usb_usb_unimap_unimap.o.d  unimap.c -o obj_usb_usb_unimap/unimap.o
In file included from unimap_trans.h:20:0,
                 from unimap.c:17:
/usr/lib/gcc/avr/5.4.0/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory
compilation terminated.
make: *** [../../tmk_core/rules.mk:560: obj_usb_usb_unimap/unimap.o] Error 1
$

Title: Re: USB to USB keyboard converter
Post by: DotMatrixMoe on Mon, 31 May 2021, 14:27:51
The name caught me off guard! If only I read the post  ;D
Title: Re: USB to USB keyboard converter
Post by: suicidal_orange on Mon, 31 May 2021, 22:40:20
I've been reading and sadly there is no such thing as a 'multi key' in the specifications of keyboards (one company made boards with one long ago but it would have had it's own driver), the key must be defined in your operating system so unless you can set it the same on all the computers you want to use it isn't an option.

Similarly the way to input Swedish letters will vary depending on the language setting in the OS of each computer and on ISO-UK they are not included at all so you would need to use a macro to input them.  On Linux this would be done by holding Ctrl+shift then typing u?? where ?? is the hex code of the character, but that wont work in Windows or Mac (which has different way again)  Not sure if there's room for Linux and Windows layers plus the two layers for the macros of each (ä and Ä have different codes so it's not just shifted) but that's what you would need.

Make clean only deletes previously compiled files it doesn't actually compile anything, if you say what distro you're on I will check what packages need to be installed and we can get the instructions updated so it works for the next you :)
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 31 May 2021, 23:53:08
> you just have to make sure you have your build environment setup

Of course, you are right, but that's where things always seem to get tricky ;(

I have followed the instructions in the link you posted above, and  all the tools seem to be installed, yet I still get the error about stdint.h.    make clean completes without errors, but make does not:


Check this if you are on Ubuntu. You may find similar package names even if not.

https://github.com/tmk/tmk_keyboard/wiki#build-on-linux

Title: Re: USB to USB keyboard converter
Post by: pauld on Tue, 01 June 2021, 09:39:46
Bring back Cobol - that's what I say :)

I will try installing the extra packages and have another go at compiling, but I probably won't have time until the weekend.  I'm using Debian (Bullseye/testing) btw.

Meanwhile, apologies for using up your time like this.  It would probably be easier if I actually understood the whole input process better.  Is there somewhere I could read about it?  I only encounter linux boxes so it doesn't matter in the slightest whether any of this works with Windows or MacOS.  I can live without the multi key as well, and leave that to be defined by the OS.  I don't use it a lot.

I *think* I now understand about the Swedish characters.  At the moment, I have LANG set to en_IE.UTF-8 but keyboard layout set to "gb" with variant "dvorakukp" as that puts most of what I want in the right place.  I achieve the remainder with xmodmap.  I use it to do things like make the Win key into Caps Lock, etc, and to add extra characters that I need, eg with "keycode 24 = aring Aring" which gives me lower and upper case Å on what is usually the Q key.  All this works with no apparent mention of Swedish character sets in either locale or keyboard settings. 

As I understood it (and I now think this is wrong, and that my misunderstanding has caused most of my problems) the usb-usb convertor works by juggling the keycodes.  So if I swapped, say, the Q and the W on a standard qwerty layout, every time the convertor got keycode 24, which is normally Q, it would output 25, and vice versa, and so on for any other altered mappings I made.  I think my error is that I assumed there is an absolute relationship between keycode 24 and Q, and that there is also therefore a keycode specifically for Å (and all the other non-latin charaters), and that the convertor would exchange 24 for whatever the actual keycode for Å is.  I now think that is probably wrong: there is no absolute mapping that says "24 -> Q", I think the 24 just means whichever is the top left character in the current layout.  If that is true, then if I just switched the keyboard settings to a Swedish layout, then I would get Å in the top left corner because in the svorak layout, which linux already has, that is where Å is located.  In that situation, it would be the case that "24 -> Å" and no further re-mapping is necessary.  If this is correct, then I can easily use the online Keymap Editor to achieve the layout I want, since it's a simple question of swapping keys around, and it doesn't matter what character appears on the key in the online keyboard.  Is that correct?

Sorry this has turned into such a long post but I think if I properly understood what was going on here, I could probably go away and save you quite a lot of time! 

I will try to get to grips with the compiling anyway, as presumably that would be a good way of adding extra characters to the layout by using the other layers.  Eg for Irish, it's useful to have all of the standard English vowels with acute accents, and I do that at the moment by using xmodmap to specify level 2 and 3 values for some of the letters, eg "keycode 41 = u U uacute Uacute udiaeresis Udiaeresis".  None of these are as important as getting the basic layout right.

One final (for now) thing: can the convertor be used to change what you get as the upper case character on non-letter keys?  For example, I'm used to having Shift-4 -> $  but you don't get that with the Swedish layout.  That's the main reason I use gb layout, it keeps all the punctuation characters in the places I expect them to be.

Thanks again for all the help!!
Title: Re: USB to USB keyboard converter
Post by: suicidal_orange on Wed, 02 June 2021, 07:08:11
Yes, 24 is the top left key not Q.  To have different characters on the shifted layer you would want to set your shift key as an FN (layer key) with shift on that key, then you would move 2 (I think?  Never used IE...) to 4 on that layer to get the $.

@hasu - if this is too off topic let me know and I'll move it :)
Title: Re: USB to USB keyboard converter
Post by: pauld on Wed, 02 June 2021, 08:49:40
Ok, thanks, got it.  I will work it out.  Many thanks for all your patience and help.
Title: Re: USB to USB keyboard converter (cant get it working with Ducky One 2 Mini)
Post by: garek on Sun, 20 June 2021, 04:42:53
I can't get my keyboard working with the usb-to-usb controller. When plugged
through the controller no keystroke get to my pc.

One anther keyboard worked well with no changes to usb-to-usb firmware.

It seems I cant get it work on my own, so I figured I ask here.  Any advice is
welcome, thank you.

The keyboard, that does not work is Ducky One 2 Mini[1] (I have 2061ST).  I
tried it in both NKRO and 6KRO modes.

Here is the output from hid_listen with the debug firmware[2]

Code: [Select]
Waiting for device:
Listening:
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
Ci BM Init
Ci Addr:01
Ci NC:01
HID_PROTOCOL_KEYBOARD
Ci Ci bNumEP:01
D1
BM Init
Ci Addr:01
Ci NC:01
HID_PROTOCOL_KEYBOARD
Ci Ci bNumEP:01
D1
BM Init
Ci Addr:01
Ci NC:01
HID_PROTOCOL_KEYBOARD
Ci Ci bNumEP:01
D1
BM Init
Ci Addr:01
Ci NC:01
HID_PROTOCOL_KEYBOARD
Ci Ci bNumEP:01
D1
Ci Ci host.Task: 2141
usb_state: 90
speed: full

Device disconnected.

There is no output from the hid_listen when I hit keystrokes on my Ducky One
2 Mini.

I tried it on MacOS Catalina 10.15.7 (19H524).

Thanks for help!  :)

[1]: https://duckychannel.net/download/user_manual/2020/Ducky_Mecha_One2mini_2061ST_usermanual.pdf
[2]: https://raw.githubusercontent.com/tmk/tmk_keyboard/master/converter/usb_usb/binary/usb_usb_debug.hex
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 20 June 2021, 09:43:20
Seems like the converter fails to find keyboard interface of the keyboard, it may have multiple interfaces.

Checking USB descriptor of the keyboard would help.

https://github.com/tmk/tmk_keyboard/wiki/USB:-Descriptor#how-to-get-descriptor
https://github.com/tmk/tmk_keyboard/wiki/USB:-HID-Report-Descriptor
Title: Re: USB to USB keyboard converter
Post by: garek on Mon, 21 June 2021, 05:46:09
Checking USB descriptor of the keyboard would help.

Thanks for the reply!

I run `system_profiler SPUSBDataType` on my mac a few times.  Let me know if I
can provide anything else to address the issue.

I list the full output only in the first run.  For subsequent runs I list the
diff to the previous run.  Let me know if the full listing is needed.

First run, my keyboard plugged in as usual.

Code: [Select]
USB:

    USB 3.1 Bus:

      Host Controller Driver: AppleUSBXHCITR
      PCI Device ID: 0x15ec
      PCI Revision ID: 0x0006
      PCI Vendor ID: 0x8086
      Bus Number: 0x00

    USB 3.1 Bus:

      Host Controller Driver: AppleUSBXHCITR
      PCI Device ID: 0x15ec
      PCI Revision ID: 0x0006
      PCI Vendor ID: 0x8086
      Bus Number: 0x01

    USB 3.1 Bus:

      Host Controller Driver: AppleIntelCNLUSBXHCI
      PCI Device ID: 0xa36d
      PCI Revision ID: 0x0010
      PCI Vendor ID: 0x8086

        Ducky One2 Mini RGB:

          Product ID: 0x6301
          Vendor ID: 0x3233
          Version: 0.00
          Serial Number: DK-V1.08-200925
          Speed: Up to 12 Mb/s
          Manufacturer: Ducky
          Location ID: 0x14300000 / 5
          Current Available (mA): 500
          Current Required (mA): 100
          Extra Operating Current (mA): 0

    Apple T2 Bus:

      Host Controller Driver: AppleUSBVHCIBCE

        Composite Device:

          Product ID: 0x8104
          Vendor ID: 0x05ac (Apple Inc.)
          Version: 2.14
          Serial Number: 000000000000
          Speed: Up to 480 Mb/s
          Manufacturer: Apple
          Location ID: 0x80800000 / 1
          Current Available (mA): 500
          Current Required (mA): 500
          Extra Operating Current (mA): 0
          Built-In: Yes

        Touch Bar Backlight:

          Product ID: 0x8102
          Vendor ID: 0x05ac (Apple Inc.)
          Version: 2.01
          Serial Number: 0000000000000000
          Manufacturer: Apple Inc.
          Location ID: 0x80700000

        Touch Bar Display:

          Product ID: 0x8302
          Vendor ID: 0x05ac (Apple Inc.)
          Version: 2.01
          Serial Number: 0000000000000000
          Manufacturer: Apple Inc.
          Location ID: 0x80600000

        Apple Internal Keyboard / Trackpad:

          Product ID: 0x0340
          Vendor ID: 0x05ac (Apple Inc.)
          Version: 2.75
          Serial Number: FM7025701QVHYYKA3+TVZ
          Speed: Up to 480 Mb/s
          Manufacturer: Apple Inc.
          Location ID: 0x80500000 / 9
          Current Available (mA): 500
          Current Required (mA): 500
          Extra Operating Current (mA): 0
          Built-In: Yes

        Headset:

          Product ID: 0x8103
          Vendor ID: 0x05ac (Apple Inc.)
          Version: 2.14
          Serial Number: 000000000000
          Manufacturer: Apple
          Location ID: 0x80400000

        Ambient Light Sensor:

          Product ID: 0x8262
          Vendor ID: 0x05ac (Apple Inc.)
          Version: 2.01
          Serial Number: 000000000000
          Manufacturer: Apple Inc.
          Location ID: 0x80300000

        FaceTime HD Camera (Built-in):

          Product ID: 0x8514
          Vendor ID: 0x05ac (Apple Inc.)
          Version: 2.01
          Serial Number: CC201870348HNW19A
          Manufacturer: Apple Inc.
          Location ID: 0x80200000

        Apple T2 Controller:

          Product ID: 0x8233
          Vendor ID: 0x05ac (Apple Inc.)
          Version: 2.01
          Serial Number: 0000000000000000
          Manufacturer: Apple Inc.
          Location ID: 0x80100000

Second run, I plugged in the usb-to-usb as well.

Code: [Select]
diff --git a/system_profiler_spusbdatatype2 b/system_profiler_spusbdatatype3
index c803509..74b95a9 100644
--- a/system_profiler_spusbdatatype2
+++ b/system_profiler_spusbdatatype3
@@ -23,6 +23,18 @@ USB:
       PCI Revision ID: 0x0010
       PCI Vendor ID: 0x8086

+        USB to USB keyboard converter:
+
+          Product ID: 0x005b
+          Vendor ID: 0xfeed
+          Version: 8.14
+          Speed: Up to 12 Mb/s
+          Manufacturer: t.m.k.
+          Location ID: 0x14400000 / 6
+          Current Available (mA): 500
+          Current Required (mA): 100
+          Extra Operating Current (mA): 0
+
         Ducky One2 Mini RGB:

           Product ID: 0x6301



Third run, my keyboard plugged in the controller.

Code: [Select]
diff --git a/system_profiler_spusbdatatype3 b/system_profiler_spusbdatatype4
index 74b95a9..fa2fe17 100644
--- a/system_profiler_spusbdatatype3
+++ b/system_profiler_spusbdatatype4
@@ -30,20 +30,7 @@ USB:
           Version: 8.14
           Speed: Up to 12 Mb/s
           Manufacturer: t.m.k.
-          Location ID: 0x14400000 / 6
-          Current Available (mA): 500
-          Current Required (mA): 100
-          Extra Operating Current (mA): 0
-
-        Ducky One2 Mini RGB:
-
-          Product ID: 0x6301
-          Vendor ID: 0x3233
-          Version: 0.00
-          Serial Number: DK-V1.08-200925
-          Speed: Up to 12 Mb/s
-          Manufacturer: Ducky
-          Location ID: 0x14300000 / 5
+          Location ID: 0x14400000 / 8
           Current Available (mA): 500
           Current Required (mA): 100
           Extra Operating Current (mA): 0


p.s.: Probably unrelated but `system_profiler` writes a few lines like this to
stderr

Code: [Select]
2021-06-21 19:10:56.389 system_profiler[1510:11006427] SPUSBDevice: IOCreatePlugInInterfaceForService failed 0xe00002be

p.s.2: When I plug my keyboard via the controller, it flickers as usual.  I assume
it goes through the usual initialization process.  When I hit keystrokes the RGB
highlighting works normally.  Though no keystrokes are registered on the pc.
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 21 June 2021, 08:37:40
hmm, system_profiler can't seem to show useful information unfortunately in this case.

I don't know much about how to do on MacOS, USBProber.app may work for this purpose, perhaps.
https://itectec.com/superuser/how-to-install-usb-prober-from-the-developer-sdk-on-mac-os-x/

Or just try Linux or Windows to get USB descriptor if either one is available.
Title: Re: USB to USB keyboard converter
Post by: nevin on Wed, 23 June 2021, 00:48:21
mac -> terminal
Code: [Select]
ioreg -p IOUSB -w0 -l
Quote
In addition to system_profiler SPUSBDataType (suggested by @kjs), you can also use ioreg -p IOUSB
Quote
By default it clips to the window's width (80 chars in the example above), so you may want to add -w0 to get a full-width display. Also, adding -l will show details (probably more than you need) about each of the devices
-- from: https://apple.stackexchange.com/questions/170105/list-usb-devices-on-osx-command-line

using both the "-w0" & "-l" variables, gets you an output that looks like the descriptors you linked to in your git.

so open terminal & run
Code: [Select]
ioreg -p IOUSB -w0 -l
and i'd send output in a PM to hasu. this lists everything, not just your keyboard.
Title: Re: USB to USB keyboard converter
Post by: nevin on Wed, 23 June 2021, 00:55:04
just found this too...

Get the Ducky One 2 working as a native keyboard on macOS
https://wimpostma.com/blog/ducky-one-2-keyboard-macos/

....so, there IS some kind of hanky panky going on behind keys on that board.
Title: Re: USB to USB keyboard converter
Post by: shockwave on Wed, 23 June 2021, 01:13:36
I purchased one of these; it's currently in the mail. I'm planning to compile the firmware from github, to try some funky keybinds. Question:
The web configurator supports 8 layers. I know the TMK can support 32. Does the device support more than 8 layers, if updated manually? Or does this limit have something to do with memory limitations?

I don't know if I'll need more than those 7/8 for the stuff I want to try, but I'm asking just in case.
Title: Re: USB to USB keyboard converter
Post by: nevin on Wed, 23 June 2021, 01:31:40
more than 8... the only problem i see would be finding a place to put all 32 triggers to get to those layers.....

i've been using these firmwares for years & only use 3 layers total (including the main 0 layer). but i'm not using different main keymaps like (colemak, dvorak, workman, etc...) either....
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 23 June 2021, 01:51:39
The firmware can support up to 32 layers when you build yourself and flash memory is enough.

When using Keymap Editor and prebuilt firmware only 8 layers, mainly due to flash space.

Especially, firmware for USB-USB converter is large and doesn't have spare space much.
WIth configuring build options to remove some features you can get 4-8 layers, perhaps.
Title: Re: USB to USB keyboard converter
Post by: shockwave on Wed, 23 June 2021, 02:30:18
Especially, firmware for USB-USB converter is large and doesn't have spare space much.
WIth configuring build options to remove some features you can get 4-8 layers, perhaps.

Oh. I was thinking of turning on all features, but I might have to rethink that.

One more question:
Are the hooks in 'hooks.h/c' meant to be used by us, end-users, to add our extra features to the firmware? Or is that not meant to be messed with?
If meant for the users, do you recommend that they be implemented within the usb-to-usb converter source tree, or just edit the original files in core, or it doesn't matter?

Thanks for the quick reply!

Btw, your code is elegant.
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 23 June 2021, 06:23:26
One more question:
Are the hooks in 'hooks.h/c' meant to be used by us, end-users, to add our extra features to the firmware? Or is that not meant to be messed with?
If meant for the users, do you recommend that they be implemented within the usb-to-usb converter source tree, or just edit the original files in core, or it doesn't matter?

Yes, hook API is intended to be used by users.
You can place your code file basically under converter directory(converter/usb_usb) and edit(or create your own) Makefile to add the file to source list.


Title: Re: USB to USB keyboard converter
Post by: shockwave on Wed, 23 June 2021, 09:14:33
Thanks
Title: Re: USB to USB keyboard converter
Post by: makeit_mike on Fri, 25 June 2021, 20:17:59
First post, so I apologize in advance for any Noob mishaps.

Just wanted to say I did this with an Arduino Leonardo (two actually, one was from Arduino, another from KEYSTUDIO) both worked great; however, the Host Shields in the initial post do not work.

The only working link for me when I built them was for the SparkFun Host Shield. This was incompatible with the Leonardo (there are ways to make it work in Arduino forms by jumping certain wires or by using an adapter that is no longer sold)

I did end up getting both Leonardos to work with the USB USB firmware by using a SainSmart USB Host Shield from Amazon for like 20 US Dollars. Worked immediately out of the box. Highly recommend.

Been using for a month or so with absolutely no issues. Working with UNICOMP Model M, Topre RealForce R2, Cherry G80, and a BTC 5100C that goes from PS/2 to USB to Arduino to PC. The Leonardo seems to handle TMK just fine.

I have a console app for Windows on github that makes flashing Arduinos with HEX files much easier, but I haven't had much reason to make the repo public (unless there seems to be some demand)

If anyone is reading at this point, I do have one question... does anyone know how to make this firmware compatible with VIA? I sometimes want to change a layout on the fly, but I can't flash keyboards on my work computer, but I can use VIA.
Shot in the dark I am sure.. but worth a shot.
Title: Re: USB to USB keyboard converter
Post by: nevin on Sat, 26 June 2021, 00:16:48
VIA is a QMK thing, not a TMK thing.

but, hasu's converter has been ported to QMK, and if you enable the VIA features in the firmware, and the converter has an EEPROM you may be able to use VIA. (looks like it will need a layout json as well for VIA)
https://github.com/qmk/qmk_firmware/tree/master/keyboards/converter/usb_usb
https://caniusevia.com/docs/specification
Title: Re: USB to USB keyboard converter
Post by: shockwave on Sun, 27 June 2021, 09:30:48
Hello,

I was able to compile TMK for use with the USB2USB converter. I have made some layout changes, uploaded the hex to the device, and they're working well.

I have also been trying to enable Bootmagic, but I get compilation errors when I enable it in the Usb2Usb config.h ... I also tried to addit ih bootmagic.h
#define BOOTMAGIC_ENABLE

...
obj_usb_usb_debug/common/keyboard.o: In function `keyboard_init':
W:\Github\TMK\converter\usb_usb/../../tmk_core/common/keyboard.c:187: undefined reference to `bootmagic'

Are there pre-requisites to enable Bootmagic?
Title: Re: USB to USB keyboard converter
Post by: shockwave on Sun, 27 June 2021, 10:01:49
Dang! I was able to get it to compile by adding bootmagic.c and eeconfig.c to the Makefile. The hex file went from about 76KB to about 85KB. But, when I went to load it in Atmel FLIP, it throws an out of range exception. So, I guess that the hex limit is somewhere between 76 and 85KB.

Anyone know the actual maximum size of the hex file for the Usb2Usb converter?

Also, I'm confused because the datasheet for the Atmel32U4, which is what the board is running, says it only has 32KB of flash memory. But it can run the 76KB hex file, so how does that happen?
https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7766-8-bit-AVR-ATmega16U4-32U4_Datasheet.pdf

EDIT:
I partially get the size thing. It seems what's important is the size of the 'text'+'data' section, which is reported by the TMK compilation. FLIP also shows the size of those sections added up, as 'util bytes', which seems to be what that 32KB is about. In my case, for a 77KB hex, it is showing as 27712 bytes, which is why that hex file is acceptable.
Title: Re: USB to USB keyboard converter
Post by: nug on Sun, 27 June 2021, 18:05:33
Is it possible to change the key/HID code the converter is expecting?

I have a Snow-Pro TKL-C2 PCB which is programmable with SnowTools but the programming is limited. I cannot map KC_RO to the key next to right shift (split rshift) so it appears that the converter simply passes through whatever character has been assigned to the key (i.e., if I program the key to be 'A' then the converter will simply show 'A' as being pressed when I flash my own keymap, despite a different key being programmed in my own converter keymap)

This is the programmed layout in SnowTools: (https://i.imgur.com/nQRESLL.png)

And this is the HID output using HID_listen.exe: (https://i.imgur.com/ay15ZUQ.png)
The first keypress is the 'A' key right of rshift and the second keypress is rshift. If I change 'A' to 'Del' in SnowTools, the HID output becomes:
Code: [Select]
input 1: 00 00 4C 00 00 00 00 00
00 00 4C 00 00 00 00 00

Any suggestions on how I can get the converter to recognise this key?
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 27 June 2021, 19:48:55
shockwave,
You can add 'BOOTMAGIC_ENABLE ?= yes' to Makefile to build the feature, neede files are added in source list automatically in tmk_core/common.mk.
But BootMagic is inteded for usual keyboard projects, it won't be useful for converter. In converter projects keyboard startup takes rather long and its timing is different  by keyboard, so firmware can't check keys at startup in consistent way probably.

ATMega32U4 has 32KB flash space, but 4KB of that is dedicated to bootloader. You can use 28KB(28672 bytes) for converter firmware including keymaps.
 Yes, Programed flash size is test and data section, while bss and data section indicates memory usage at startup.

Section size is displayed at the end of make command, or avr-size.
Quote
$ avr-size   usb_usb_debug.elf
   text    data     bss     dec     hex filename
  26660     136    1075   27871    6cdf usb_usb_debug.elf
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 27 June 2021, 19:58:07
nug,
Assuming the key you want to change spits 'A' just change 'A' key to KC_RO on Keymap Editor.
But this may not be useful because your 'A' next to 'Caps' is also changed KC_RO.

I think you can assign unuseful/unused key like F24 or something on the key next right shift in SnowTools, and then remap F24 to KC_RO in KeymapEditor.
Title: Re: USB to USB keyboard converter
Post by: nug on Sun, 27 June 2021, 20:17:22
nug,
Assuming the key you want to change spits 'A' just change 'A' key to KC_RO on Keymap Editor.
But this may not be useful because your 'A' next to 'Caps' is also changed KC_RO.

I think you can assign unuseful/unused key like F24 or something on the key next right shift in SnowTools, and then remap F24 to KC_RO in KeymapEditor.

Thank you hasu! That works well
Title: Re: USB to USB keyboard converter
Post by: PicMan on Mon, 28 June 2021, 16:50:44
This is just to confirm that the USB-USB converter and the online keymap editor work very well with my EpoMaker EP-84 keyboard. 
Thank you Hasu for a great product!
BTW, any other WordStar users here?  This product is perfectly suited to replicate the venerable WordStar cursor diamond.
(FYI, I'm running Linux on a Raspberry Pi.)
Title: Re: USB to USB keyboard converter
Post by: shockwave on Mon, 28 June 2021, 19:26:20
I have the following keyboard:
https://trulyergonomic.com/ergonomic-keyboards/best-truly-ergonomic-mechanical-keyboard/

Because of the physical layout, and I'm trying to map many shortcuts to the same 2 thumb keys. Using the same thumb keys for various shortcuts creates a nice flow, where I'm using the same keys for various tasks.

So far, I've downloaded the TMK firmware for the USB-to-USB device, compiled it, and tried out most of the shortcut ideas that I wanted to get. TMK is very well designed, so the process has been smooth. However, there is one shortcut that I haven't been able to get working, and this is what this post is about.

I have the 2 thumb shortcut keys defined as:
Left: ACTION_LAYER_TAP_TOGGLE(1),
Right: ACTION_LAYER_TAP_KEY(1, KC_ENTER)

That is, press a thumb key for one action, and hold to switch the "NAV" layer.

PROBLEM: I want to make it so that holding  a thumb key while holding another specific key makes the firmware act as if I'm on the first layer with Ctrl+Shift pressed. The effect that I'm trying to achive is that holding the thumb key + the "ctrl" key is like if I was holding Ctrl+Shift. This would then allow me to perform Ctrl+Shift shortcuts gracefully, while "remaining" on the default layer.
I tried various ways to achieve that. My initial take was this: In the "nav" layer, assign an FN key to a "Ctrl" key, which then makes it jump to a third layer (that's identical to the first). I mapped the FN key to "ACTION_LAYER_MODS(2, MOD_RSFT | MOD_RCTL)", but I only seem to get the Ctrl sent, not the Shift.

Is is possible to do with this with the firmware? I'm a C++ programmer, so I'm not shy about tinkering with the codebase to achive that result.

Please find attached the "keymap.c" and "keymap_common.h", showing the current version my shortcut definitions. Also attached is an image of keyboard with the pertinent keys highlighted. NOTE: In the "keymap.c" code, the keys highlighted are F17, F18, F19, and Ent -- This is shown on the ASCII diagram in the code.

Thanks


Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 28 June 2021, 20:49:41
shockwave,
Quote
My initial take was this: In the "nav" layer, assign an FN key to a "Ctrl" key, which then makes it jump to a third layer (that's identical to the first). I mapped the FN key to "ACTION_LAYER_MODS(2, MOD_RSFT | MOD_RCTL)", but I only seem to get the Ctrl sent, not the Shift.

This should work. what if using MOD_LSFT | MOD_LCTL instead?



PicMan,
Thanks for the report!
Just updated keyboard list in the first post.
Title: Re: USB to USB keyboard converter
Post by: shockwave on Mon, 28 June 2021, 21:14:56
This should work. what if using MOD_LSFT | MOD_LCTL instead?

I had tried both versions initially. But, I tried it again, just now, to confirm. No luck.
Title: Re: USB to USB keyboard converter
Post by: shockwave on Tue, 29 June 2021, 02:43:09
This should work. what if using MOD_LSFT | MOD_LCTL instead?

Ok, found the issue and got it working now. It's nice!
The problem is that C's bitwise right-shift takes precedence over bitwise or.

Change:
ACTION_LAYER_MODS(layer, mods)              ACTION_LAYER_TAP((layer), 0xc0 | ((mods>>8)&0x1f))

To:
ACTION_LAYER_MODS(layer, mods)              ACTION_LAYER_TAP((layer), 0xc0 | (((mods)>>8)&0x1f))
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 29 June 2021, 04:17:29
great find! I'll update that code in repo soon. Thanks
Title: Re: USB to USB keyboard converter
Post by: madison437 on Tue, 06 July 2021, 11:31:53
Simple question: has anyone yet figured out a way to get the power-on LED indicator to work when the USB-USB converter is flashed with QMK firmware instead of TMK?

I've looked through quite a few of these messages in the threads but have only seen mention of it not working.

Thanks.
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 07 July 2021, 19:13:43
Simple question: has anyone yet figured out a way to get the power-on LED indicator to work when the USB-USB converter is flashed with QMK firmware instead of TMK?

I've looked through quite a few of these messages in the threads but have only seen mention of it not working.

Thanks.

Generally the LED is/was inteded to use for debug purpose. In current version TMK covnerter doesn't has the LED and firmware doesn't control it.

I don't know about QMK specific but I think this works.
Place two lines below in config.h(or equivalent in QMK) and use LED_ON() or LED_OFF() anywhere you want.

Code: [Select]
#define LED_ON()    do { DDRD |= (1<<6); PORTD |=  (1<<6); } while (0)
#define LED_OFF()   do { DDRD |= (1<<6); PORTD &= ~(1<<6); } while (0)

PD6 pin is connected to anode of the LED.
Title: Re: USB to USB keyboard converter
Post by: madison437 on Wed, 07 July 2021, 19:21:21
Thank you for this info!
Title: Re: USB to USB keyboard converter
Post by: netbike on Sat, 17 July 2021, 14:15:08
Hi Hasu,

please update your compatible list.

compatible keyboard report

Arkoncore AR87
Title: Re: USB to USB keyboard converter
Post by: nug on Fri, 06 August 2021, 00:42:22
I have a weird issue with the converter and a Matrix Vita keyboard. If I plug in the keyboard into the converter and then the converter into the computer, no input is detected on the computer from the converter. If I then flash the converter, it will detect input. I think it may have something to do with the Matrix Vita booting up as the keyboard has a screen which takes some time to load.

I installed the debug hex onto the converter and when plugging in the converter into the computer I get the following output (please click ""MORE" for an image):
More
(https://i.imgur.com/bnhvbyS.png)

At point (1) I have plugged in the converter with the keyboard connected to the converter. No input from the keyboard is detected by the converter.
At (2), I press the reset switch on the converter and re-flash the debug hex. After re-flashing, the keyboard is detected and input is read.
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 06 August 2021, 08:48:00
Yes, it looks like slow startup after bus reset and the keyboard seems to fail to reply a request.
And rare CRC errors(crIN:0B) are shown in the log, I never seen the error so far. This is unusual at least.

Can you try this debug firmware and share debug log? It may give something helpful.
[attachurl=1]


Also try this firmware on the converter to get USB descriptors of the keyboard.
https://github.com/tmk/tmk_keyboard/tree/master/converter/usb_desc_dump

Please share debug log as text format.
Title: Re: USB to USB keyboard converter
Post by: nug on Fri, 06 August 2021, 09:08:49
Thanks hasu, I've attached the output using the debug hex you shared. I'm not sure how to use the other firmware to get the USB descriptors, could you please let me know what I should do for that?
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 06 August 2021, 09:35:59
Just flash firmware under 'binary' firmware, and then plug the keyboard.
It should show hex dump of USB descriptors in hid_listen console.
Title: Re: USB to USB keyboard converter
Post by: nug on Fri, 06 August 2021, 09:48:56
Got it, thanks. Attached is the desc dump log. The input is shown twice as I reflashed it while keeping the keyboard plugged in.
Title: Re: USB to USB keyboard converter
Post by: nug on Fri, 06 August 2021, 17:31:51
Yes, it looks like slow startup after bus reset and the keyboard seems to fail to reply a request.
And rare CRC errors(crIN:0B) are shown in the log, I never seen the error so far. This is unusual at least.

Is it possible to add some sort of delay to the converter so that the keyboard can power on before the converter starts up?
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 06 August 2021, 19:00:10
Yes, You can increase this value to 100 for example. Try this if you can build firmware on your site. This may show display different behaviour with the keyboard.
The file is located at tmk_keyboard/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0-tmk/Usb.cpp of your working repository.
https://github.com/tmk/USB_Host_Shield_2.0/blob/96112d43858b5c5327565c36bd8ea2192ec77d1b/Usb.cpp#L535


But I guess the delay value is not root cause of the problem now, after seeing 'desc_dump.txt'. The log shows 'USB Descriptor Dumper' worked with the keyboard without the problem.
Both the dumper and the converter use same library and basically equivalent process to handle USB keyboards. I'll look into code to find difference between them.

Title: Re: USB to USB keyboard converter
Post by: nug on Fri, 06 August 2021, 23:36:20
Sorry I just tested it again and the USB descriptor dumper does not work with the keyboard similar to the debug hex. I've attached another log file, the first time the converter is already plugged in and then I plug in the keyboard into the converter. I then reflash the converter with the dump hex (from Line 11 onwards) while keeping the keyboard plugged in and the descriptor then detects the board.
Title: Re: USB to USB keyboard converter
Post by: nug on Fri, 06 August 2021, 23:54:32
I managed to compile a hex with
Code: [Select]
delay = millis() + 5000; and it seems to be working. I'll do a few more tests to check. Lowering down to 500 also seems to work.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 08 August 2021, 05:12:52
Thanks for the explanation and the test.

Adding 500ms delay to default firmware is acceptable workaround but lower value would be preferable if possible.
Doesn't 100ms delay work perhaps?


Can you test attached firmware to see what shows in debug log?
This firmware uses 500ms delay instead of 20ms.
[attachurl=1]

I like to know more about what happens with the keyboard in fact.
Title: Re: USB to USB keyboard converter
Post by: nug on Sun, 08 August 2021, 08:15:11
I've attached 2 logs, one where the converter was already plugged in after flashing, and then the keyboard was connected, and the other where the keyboard was plugged into the converter before plugging the converter into the computer.

I also tested changing the delay, it seems to work with 400ms, but it failed on 100/200/300ms.
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 09 August 2021, 22:21:32
500ms delay seems to work well without any errors in the both logs.
OK. Confirmed that increasing bus rest delay to 400 or 500ms is a workaround for the problem.
I'll fix it when next binary firmware update if I don't find other good solution. Thanks
Title: Re: USB to USB keyboard converter
Post by: poly dactyl on Sun, 15 August 2021, 00:07:13
I'm trying to use a Truly Ergonomic Cleave,  which is on the known-good list. But I'm having the same slow startup problem as nug - works after flashing firmware & MCU reset, does not work after being unplugged.
I have two hasu USB2 USB adapters (thank you). Both work with other keyboards. I've updated the cleave to the latest firmware (001). I also tried modifying the delay to 2 seconds, but no change.

Debug log attached.
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 15 August 2021, 03:55:58
Thank you for the debug log.


Code: [Select]
### unplug usb2usb & re-insert.
Device disconnected.
Waiting for new device:..
Listening:

TMK:44ee4f/LUFA:d6a7df/UHS2:8b8cde

USB configured.

Loop start.
usb_state: 12


It seems that the converter doesn't recognize the keyboard at all after re-plug.
It fails to prove USB bus and to detect keyboard insertion for some reason.


I just worked on improvent of bus probe a few week ago. It may help.
Try attached debug firmware. [attachurl=1]


Title: Re: USB to USB keyboard converter
Post by: poly dactyl on Sun, 15 August 2021, 10:28:13
the ee3e6b firmware worked (log attached). Where can I find that version of the source?
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 15 August 2021, 22:15:56
Great.
The related fix is located here.  You will have to check out 'master' branch under tmk_keyboard/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0-tmk.

https://github.com/tmk/USB_Host_Shield_2.0/commit/3e831605d058c2c7d209167acd804653699fddc9

Title: Re: USB to USB keyboard converter
Post by: the_marsbar on Fri, 03 September 2021, 02:13:14
It seems to work with the HHKB Hybrid too (don’t have a Classic) :)

Very cool.
Title: Re: USB to USB keyboard converter
Post by: Draconian on Sun, 05 September 2021, 05:48:06
I have a HHKB Hybrid too a can confirm it works perfectly.

I flashed QMK onto the converter and have got that working. I cannot successfully build the QMK firmware if I enable VIA though. The error states:

“dynamic keymaps are configured to use more EEPROM than is available”

I’ve tried all the standard tweaks to reduce the size of the firmware, but to no avail.

Has anyone else tried this and had any success?

Title: Re: USB to USB keyboard converter
Post by: the_marsbar on Sun, 05 September 2021, 06:23:26
What is VIA and what’s it good for? I realize this might be a stupid question.
Title: Re: USB to USB keyboard converter
Post by: Draconian on Sun, 05 September 2021, 07:00:04
Not a silly question at all, and I’m only just learning about it myself.

https://caniusevia.com/

VIA is an extension to QMK that lets you modify key mappings on the fly, without having to flash the firmware each time. You run an app on your computer and that updates the QMK mappings behind the scenes. The mappings are still stored with the keyboard.

I’ve read lots of comments about people finding QMK intimidating, and this looks like a more accessible way to program your keyboard.

I have an HHKB Hybrid plugged into HASU’s controller which is in turn plugged into a KVM switch to move between my work laptop and my Mac.

I don’t really want to modify the HHKB, and don’t believe that HASU has released a controller for the Hybrid yet anyway. But I do like the additional functionality of QMK - hence the USB-USB adapter.

When I couldn’t get VIA to compile, I trawled through loads of documentation and managed to configure a Tap Dance combination where a double-left-ALT sends ALT+CTRL+1 to the KVM, which switches to my work laptop, abd double-right-ALT sends ALT+CTRL+3 to switch to the Mac.

When it worked, I punched the air with delight!

I’d just like to see if I can enable the VIA support, as I think it would be easier.

Sorry for the long and rambling answer!
Title: Re: USB to USB keyboard converter
Post by: the_marsbar on Sun, 05 September 2021, 07:11:17
That sounds cool indeed - thanks for the explanation.

I’d like to know if you get it working - it sounds like a handy feature.
Title: Re: USB to USB keyboard converter
Post by: qk6339zmdm on Mon, 06 September 2021, 08:46:18
Thanks Hasu!  These 60% models work with your converter with TMK or QMK:

HyperX Alloy Origins 60
Redragon Dragonborn K630 RGB
Womier K61

These work with TMK but not QMK:

Razer Huntsman Mini
Redragon Anivia K614 RGB
Zopsc-1/Bajeal (https://www.amazon.ca/Mechanical-Keyboard-Percent-Rainbow-Backlit/dp/B08RXW3NSW)
Stoga MK22 (https://www.amazon.ca/Mechanical-Keyboard-STOGA-Portable-Computer/dp/B08MDPDX39)
Vimukun/Magic-Refiner MK21 (https://www.amazon.ca/Mechanical-Keyboard-Percent-Rainbow-Backlit/dp/B08RXW3NSW)

I'll test a Corsair K65 RGB Mini and will post the results.
Title: Re: USB to USB keyboard converter
Post by: qk6339zmdm on Mon, 06 September 2021, 17:32:27
The Corsair K65 RGB Mini doesn't work, here are some debug logs:

This sequence repeats:

Waiting for device:
Listening:
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 12
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 12

With the descriptor dump firmware, this is the repeating sequence:

Waiting for device:
Listening:
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
usb_state: 12
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
usb_state: 12
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 06 September 2021, 21:35:39
qk6339zmdm, thanks for the report.

As for Corsair K65 RGB, can you try this debug firmware to get more debug info?
https://github.com/tmk/tmk_keyboard/blob/usb_usb_test/converter/usb_usb/binary/usb_usb_debug.hex
Title: Re: USB to USB keyboard converter
Post by: qk6339zmdm on Mon, 06 September 2021, 23:05:31
Hasu,

This is the debug output after plugging in the converter:

Waiting for device:......
Listening:

TMK:1ef45c/LUFA:d6a7df/UHS2:8dc3c8

USB configured.

Loop start.
usb_state: 12

This sequence loops when the Corsair is plugged in:

usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 12
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 12
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 07 September 2021, 02:17:00
It seems to fail at very early stage of enumeration.

Can you try this instead?
https://gist.github.com/tmk/f24c3773935afdd110e346097265508b

Title: Re: USB to USB keyboard converter
Post by: qk6339zmdm on Tue, 07 September 2021, 10:07:17
Waiting for device:.............
Listening:

TMK:39273d/LUFA:d6a7df/UHS2:8dc3c8
se0
USB configured.

Loop start.
usb_state: 12


After Corsair inserted, loop:

fs DET usb_state: 20
usb_state: 40
usb_state: 50
se0 SE0 usb_state: 12
fs DET usb_state: 20
usb_state: 40
usb_state: 50
se0 SE0 usb_state: 12
Title: Re: USB to USB keyboard converter
Post by: the_marsbar on Wed, 08 September 2021, 06:49:50
I can't seem to figure out how to do this...

I have a HHKB. I'd like to map Esc to Fn (tap) and Esc (hold). I know how to do this with the alternative controller, but could someone give me a hint how to do it with the USB-USB converter?

Any help is greatly appreciated :)
Title: Re: USB to USB keyboard converter
Post by: JPAU401 on Wed, 08 September 2021, 08:09:33
Hi, I'm currently considering pairing an IKBC MF108 V3 with the converter. Would the backlighting and top right keys be supported using QMK?

Website: https://www.ikbckeyboard.com/product-page/copy-of-ikbc-mf108-v-3

Manual: https://63a1a1b2-30f3-45a3-bacb-ff53fe2e8743.filesusr.com/ugd/d98a68_44bfb7d814f245a8b43b03a38da8ec49.pdf
Title: Re: USB to USB keyboard converter
Post by: Draconian on Wed, 08 September 2021, 08:24:08

I have a HHKB. I'd like to map Esc to Fn (tap) and Esc (hold). I know how to do this with the alternative controller, but could someone give me a hint how to do it with the USB-USB converter?


I've set up some similar mappings using the "Tap Dance" feature in QMK:

https://beta.docs.qmk.fm/using-qmk/software-features/feature_tap_dance

There's a specific example for TD_SINGLE_HOLD which I think should provide that functionality.
Title: Re: USB to USB keyboard converter
Post by: the_marsbar on Thu, 09 September 2021, 13:34:27

I have a HHKB. I'd like to map Esc to Fn (tap) and Esc (hold). I know how to do this with the alternative controller, but could someone give me a hint how to do it with the USB-USB converter?


I've set up some similar mappings using the "Tap Dance" feature in QMK:

https://beta.docs.qmk.fm/using-qmk/software-features/feature_tap_dance

There's a specific example for TD_SINGLE_HOLD which I think should provide that functionality.

Awesome! That definitely looks relevant. Thanks a lot :)
Title: Re: USB to USB keyboard converter
Post by: dxlr8r on Thu, 16 September 2021, 12:38:54
Thank you for this project. I just recieved my Hasu converter. I am starting to learn. And some findings.

hid_listen linked to in wiki, is really old. And do not work on most Macs nowadays (non PPC, and non Rosetta MacOS). But I found this project: https://github.com/PaulStoffregen/hid_listen

It is a fork, and it compiles and runs. You can also use "QMK Toolbox.app" for the same functionality.

Also, to get it to work, I had to disable some features to slim down the firmware:

Makefile:


Code: [Select]
#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

This bearly fits it, with no keyboard customisation.

Just thought I would share in case some other noob stumbles a cross this project.
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 16 September 2021, 17:20:19
Thanks for headsup.

I don't have Mac and can build the tool and test it. I'll update github wiki if needed.

You mean that hid_listen.mac64 here wouldn't work on recent Macs?
https://github.com/tmk/tmk_keyboard/wiki#debug-console

Can you attach or send me binary of the tool you build? Binary built on the lates macOS would be helpful.

QMK Toolbox can be used to flash firmware but I can't recommend it for debug, because it can lost debug outputs sometime at least on WIndows. You need to use hid_listen tool direclty when debuging.
Title: Re: USB to USB keyboard converter
Post by: dxlr8r on Fri, 17 September 2021, 11:09:31
Seems like I did missed that you hosted the binaries as well. I was looking at:

https://github.com/tmk/tmk_keyboard#debugging

And then the page linked to there, https://www.pjrc.com/teensy/hid_listen.html and that one only works for PPC.
Title: Re: USB to USB keyboard converter
Post by: ismaelyork on Fri, 17 September 2021, 16:47:59
I always liked to order different accessories online. I needed a USB to connect the keyboard to the computer, and usually, mom, when she comes from outside, walks past my room. She looks at what I look at on the computer and for a while see that I keep looking at something to give my order and the next day https://www.dontpayfull.com/page/sweepstakes he bought me a gift 100$ card with credit so I could buy what I wanted from Amazon and I'm thrilled that I got what I needed.
Title: Re: USB to USB keyboard converter
Post by: hasu on Fri, 17 September 2021, 17:39:15
dxlr8r,
Ah, I'll fix the README and link to wiki.
https://github.com/tmk/tmk_keyboard#debugging

The binary hosted on the wiki was built on Catalina(10.15.3) before release of M1 Mac.
It would be appreciated if you can build hid_listen with the latest Xcode on BIg Sur.
Title: Re: USB to USB keyboard converter
Post by: dxlr8r on Sat, 18 September 2021, 08:11:45
I am still on Catalina myself, and my Mac runs on x86. Your binary, from where did you compile it?

I can compile with Big Sur when update in the future, and hopefully get the new ARM MBP 16".
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 19 September 2021, 00:10:32
I see.  The current mac binary(hid_listen.mac64) was contributed by some user.

I believe 'hid_listen.mac64' contains only executable for x86 64-bit architecture and it should work well on current Intel macs.
And I think it works on M1 mac with bnianry translation probably, but it would be great to support M1 ARM natively.
Title: Re: USB to USB keyboard converter
Post by: Horsebadorties on Wed, 22 September 2021, 20:24:29
Hi Hasu,
I received the USB to USB converter from you this week, only 10 days after placing my order from the US East Coast. It's a very elegant, well-built gadget. Thanks!

I have not modified the default firmware yet. So, as I understand it, the converter is simply passing the keystroke data unchanged. With that caveat, the converter works perfectly with these three keyboards. All keystrokes are faithfully transmitted, with no noticeable lag at all.
If it matters, both Hexgears keyboards have soldered switches. I bought them before Hexgears released new versions with hot-swap PCBs.

My positive results are with the converter plugged into my computer's USB port.  But the converter works very poorly when it is plugged into the dedicated keyboard port of my KVM switch. Then, I get constant lagging. Some keystrokes are missed, others are rapidly repeated. There are no problems when the converter is plugged into the KVM's generic USB port, but then I lose some key features of the KVM, including hotkey switching.

Can you suggest any firmware settings I might experiment with, to better sync the converter to the KVM switch?
Title: Re: USB to USB keyboard converter
Post by: qk6339zmdm on Wed, 22 September 2021, 20:51:56
Please add this keyboard to the list of compatible models, I tested it with TMK only:

Tezarre TK61

https://www.amazon.ca/Tezarre-TK61-Mechanical-Keyboards-Programmable/dp/B096VM93T2
https://www.amazon.ca/Tezarre-TK61-Mechanical-Keyboards-Programmable/dp/B096XQYMGC

Support page, including downloads: https://www.tezarre.com/index.php/support/


The Punkston TH61 should also work, it uses the same software and appears to be from the same manufacturer:

https://www.amazon.ca/Punkston-TH61-Mechanical-Ultra-Compact-Programmable/dp/B08YJX2LVX
https://www.amazon.ca/Punkston-TH61-Mechanical-Ultra-Compact-Programmable/dp/B08YNJNWDQ

Support page, including downloads: https://www.punkston.com/index.php/support/
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 22 September 2021, 20:56:32
Horsebadorties, qk6339zmdm,
Thanks for your feedback.

Horsebadorties,
To be honest I don't know much about modern KVM technology and what 'dedicated' and generic port mean exactly.
But I know some users with KVM had trouble like that.

What's your KVM model number actually?
Do the three keyboards work well on the 'dedicated' port?
Do you have any other keyboard which doesn't works well on the 'dedicated' port?

It may be helpful to see difference between USB descriptors of the converter and those keyboards.

You can get USB descriptor of device using 'USB Descriptor Dumper'.
Flash the Dumpr firmware on your converter and just plug the device into the converter, you shoulld get USB descriptors on 'hid_listen'.
https://github.com/tmk/tmk_keyboard/wiki/USB:-Descriptor#usb-descriptor-dumper
https://github.com/tmk/tmk_keyboard/wiki#hid_listen

EDIT: And let me know what OS you are using.
As for firmware build options what is worth trying would be:
Code: [Select]
MOUSEKEY_ENABLE = no  # Mouse keys
EXTRAKEY_ENABLE = no  # Media control and System control
CONSOLE_ENABLE = no   # Console for debug
Title: Re: USB to USB keyboard converter
Post by: mi0 on Sat, 25 September 2021, 07:57:17
Hi Hasu,
I bought one of your converters about a year ago for a leopold FC750R on a Windows machine. It works well, I can flash my device with my custom layout. The only problem is that I am flashing the Atmel chip using Atmel's FLIP application every time I power off my device... as I understand it such chips will loose their flash-memory after they power down, but I'm not sure if this is the way your device was designed to function. I don't understand much about hardware programming/electronics.

So my question is: is it possible to program the device persistently, instead of flashing to volatile memory?

Steps I usually take after I turn on the computer:
Code: [Select]
1. click the button on the USB-to-USB converter device.
2. launch FLIP
3. ctrl+U to select USB device
4. select "Load HEX File" to select my custom payload
5. click "run" with all checkmarks checked: "Erase [+]", "Blank Check [+]", "Program [+]",  "Verify [+]"
6. click "start Application" with the reset option unchecked: "Reset [ ]".
7. plug in my keyboard into the USB-to-USB converter.






Title: Re: USB to USB keyboard converter
Post by: suicidal_orange on Sat, 25 September 2021, 08:43:47
The Atmel chip doesn't lose it's memory - did you actually try or just assume it didn't work after a boot?
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 25 September 2021, 08:52:52
I'm not sure what your problem is exactly.
Can you rephrase the problem and describe its details more?

Check this wiki entry if not yet. Also trying other flash tool may be helpful.
https://github.com/tmk/tmk_keyboard/wiki#flash-firmware

What if you use default firmware instead of your custom one?
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb
Title: Re: USB to USB keyboard converter
Post by: mi0 on Mon, 27 September 2021, 13:08:57
Thanks for the replies, it seems to be working just fine, which is sort of embaressing since I've been using it at work for many months now, without realizing that I didn't have to flash the device every time I unplugged it or powered-off my computer.

When I set up the device, I might've forgotten to uncheck the "[ ] reset" checkmark box, next to the "Start Application" button. Whatever it was, I was convinced that the flash memory was being reset.

Thanks for your guy'ses help again.
Title: Re: USB to USB keyboard converter
Post by: Horsebadorties on Sat, 02 October 2021, 15:45:18
Hi Hasu,

Sorry for the late reply, but I've been trying out your suggestions, and I keep getting stuck.

Horsebadorties,
To be honest I don't know much about modern KVM technology and what 'dedicated' and generic port mean exactly.
But I know some users with KVM had trouble like that.

The dedicated USB ports on a KVM are for HID devices only. Some KVMs, including mine, use Dynamic Device Mapping (DDM) to emulate a connection between those ports and the computer (or computers) that are not actively connected. Many KVMs also monitor the dedicated keyboard port for a "hotkey" sequence that tells the KVM to switch active computers.

A generic USB port on the KVM can accept any device: another HID, or a printer, webcam, etc. With those ports, the KVM doesn't use DDM, or watch for hotkeys. The KVM deals with those ports the same way an ordinary USB switch does. I usually don't use these ports, because the computers "beep" when being switched.

What's your KVM model number actually?
Do the three keyboards work well on the 'dedicated' port?
Do you have any other keyboard which doesn't works well on the 'dedicated' port?

I have two KVMs:
Yes, all three of my current keyboards (GMMK TKL, Hexgears Impulse and Hexgears Nova) work well when connected directly to the KVM's dedicated port. I had another keyboard that would not work at all on that port: a Realforce R2 TKL. I discussed this with you in June (https://geekhack.org/index.php?topic=72052.msg3062182#msg3062182), but then I returned the board.

It may be helpful to see difference between USB descriptors of the converter and those keyboards.

You can get USB descriptor of device using 'USB Descriptor Dumper'.
Flash the Dumpr firmware on your converter and just plug the device into the converter, you shoulld get USB descriptors on 'hid_listen'.
https://github.com/tmk/tmk_keyboard/wiki/USB:-Descriptor#usb-descriptor-dumper
https://github.com/tmk/tmk_keyboard/wiki#hid_listen

EDIT: And let me know what OS you are using.
As for firmware build options what is worth trying would be:
Code: [Select]
MOUSEKEY_ENABLE = no  # Mouse keys
EXTRAKEY_ENABLE = no  # Media control and System control
CONSOLE_ENABLE = no   # Console for debug


I'm using Windows 10. I built TMP on a ubuntu VirtualBox (https://github.com/tmk/tmk_keyboard/wiki/Build-on-VirtualBox), changed the options in the Makefile, ran 'make' and then 'make dfu'. When finished, this appeared on the console:
Code: [Select]
27104 bytes used (94.53%)

The modified firmware makes no difference. When the converter is between my keyboard and my KVM, I get missed and repeated keystrokes and delays, just like before. Unfortunately, I was unable to get the Dumper firmware and flash it on my converter. I just could not figure out how to do that. I'll try again later, when time permits.

Thanks for your help, Hasu!


Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 02 October 2021, 23:18:17
Horsebadorties,
Thanks for the detailed explanation. And I just revisited the another thread to recall the last discussion.

OK.  I think I understand the problem and situation now.

- Realforce R2 TKL does not work on the KVM 'dedicated' port. It doesn't send even a single keystroke there.
- USB-USB converter has constant lagging, missing keystrokes and repeated key problem on the KVM 'dedicated' port.
- Both the Realforce and the converter works withouth problem on the KVM 'generic' port.
- GMMK TKL, Hexgears Impulse and Hexgears Nova work well on the KVM 'dedicated' port.

Try this firmware instead, this firmware has keyboard interface only and makes it as simple as possible.
[attachmini=1]

And thanks for your offer about the KVM. It would be very helpful to debug if we can't find any clue to fix the problem.
Title: Re: USB to USB keyboard converter
Post by: Horsebadorties on Sun, 03 October 2021, 16:01:51
Hasu,

OK.  I think I understand the problem and situation now.

Yes, your description is absolutely correct. But I no longer have the Realforce R2 TKL, just the GMMK TKL, Hexgears Impulse and Hexgears Nova.

Try this firmware instead, this firmware has keyboard interface only and makes it as simple as possible.
* usb_usb_unimap.hex

I flashed this firmware to the converter. Now, with the converter inline between my GMMK TKL keyboard and the KVM 'dedicated' port, everything works. No more lagging, missed or repeated keystrokes. It even passes through the hotkey sequences to switch computers.

What can I do with the converter now? Is TKL installed? Can I use the TMK Keymap Editor, or re-build firmware from C source?

Once I get your address, I'll ship my spare KVM to you.

Thanks!
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 03 October 2021, 22:38:08
Great.
The last firmware was built from the latest code repo without media key, mouse key and debug feature.
I guess that debug feature is the cause probably. To confirm that, can you try attached firmares?

This is firmware with debug feature and it will cause the problem, I guess.
[attachurl=1]

This firmware with  media key and mouse key will work without the problem.
[attachurl=2]

I'll DM for the KVM. Thank you.



The firmwares I attached in this and the last post can be used in Keymap Editor.
https://github.com/tmk/tmk_keyboard/wiki/Keymap-Editor#edit-your-firmware-file

If you want to built firmware yourself  see this.
More
Edit Makefile.unimap as below and run make command with it.

    make -f Makefile.unimap

Code: [Select]
TARGET = usb_usb_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
#TMK_LUFA_DEBUG = yes
MOUSEKEY_ENABLE = no
EXTRAKEY_ENABLE = no
CONSOLE_ENABLE = no
NO_DEBUG = yes
include Makefile

And to change keymap edit unimap.c.
Title: Re: USB to USB keyboard converter
Post by: tko2007 on Mon, 04 October 2021, 15:51:33
Maybe stupid question, but can I use this Converter to switch from French AZERTI Lay-out to German ISO?

Many thanks t
Title: Re: USB to USB keyboard converter
Post by: hasu on Mon, 04 October 2021, 18:20:29
Not stupid. You will have to wirte some codes and build firmware yourself. Keymap Editor can't do that at least.
In general changing keyboard language in the converter is very difficult, especially with AZERTY.
Change language on OS is good option if possible, of course.

Maybe stupid question, but can I use this Converter to switch from French AZERTI Lay-out to German ISO?

Many thanks t

Title: Re: USB to USB keyboard converter
Post by: Horsebadorties on Mon, 04 October 2021, 19:27:03
Hi Hasu,

This is firmware with debug feature and it will cause the problem, I guess.
(Attachment Link)

This firmware with  media key and mouse key will work without the problem.
(Attachment Link)

You are correct! The first .hex file indeed replicated the problem. The second file works fine.

Thanks so much. Now I can actually start using the converter!
Title: Re: USB to USB keyboard converter
Post by: mcaple on Tue, 05 October 2021, 06:16:51
Hi Hasu,
    I have a Corsair K70 MK 2 LP and have visited [https://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb][/https://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb] from there I made no changes but simply downloaded the unimap.hex file. I then flashed the converter using FLIP and none of the mappings appear to work.

Attached is a log from hid_listen (just copy and paste from console) that shows the keyboard attaching. I hit a key to switch off the flashing LEDs and then try typing a Q and a W.

Hope that helps.

Thanks,
Mark
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 05 October 2021, 07:18:09
mcaple,
The converter recognizes the keyboard somewhat but seems to fail to make it into Boot(6KRO) mode.

Please check 'Troubleshoot' section in the first post(just updated).
Can you flash debug firmware and check its log with hid_listen again?
Also try 'USB Descriptor Dumper' to get the keyboard's descriptor.
Title: Re: USB to USB keyboard converter
Post by: mcaple on Tue, 05 October 2021, 16:26:39
OK Hasu I hope this is what you need,


Thanks,
Mark
Title: Re: USB to USB keyboard converter
Post by: hasu on Tue, 05 October 2021, 21:24:59
As for debug_log.txt, the converter seems to work well without explicit issue at startup. We will have to check keyboard's USB Descriptor colsely to further investigation now.

Sorry for confusion of  the instruction. Use hid_listen with TMK USB Descriptor Dumper firmware and just share all of its output like your debug_log.txt.

Title: Re: USB to USB keyboard converter
Post by: mcaple on Tue, 05 October 2021, 23:15:20
Aha,
   easy when you know this stuff so well to expect certain knowledge so no worries on your last request. I have now flashed the tmk dumper file and attached the log from hid_listen
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 06 October 2021, 00:25:49
Attached file(tmk_dumper.txt) is output of debug firmware as previous, not of dumper firmware.


Output of dumper is exepected like below.
Code: [Select]
usb_state: 12                                                                                                                                                 
usb_state: 20                                                                                                                                                 
usb_state: 40                                                                                                                                                 
usb_state: 50                                                                                                                                                 
usb_state: 51                                                                                                                                                 
usb_state: 90                                                                                                                                                 
                                                                                                                                                             
//////////////////////////////////////////////////////////////////////                                                                                       
// USB_desc_dump                                                                                                                                             
// Address: 01                                                                                                                                               
// Lowspeed: 01                                                                                                                                               
                                                                                                                                                             
// Devicer dump:                                                                                                                                             
12 01 00 02 00 00 00 08 6A 04 11 00 00 01 00 00                                                                                                               
00 01                                                                                                                                                         
                                                                                                                                                             
// Device:                                                                                                                                                   
bLength:                12                                                                                                                                   
bDescriptorType:        01                                                                                                                                   
bcdUSB:                 0200                                                                                                                                 
bDeviceClass:           00                                                                                                                                   
bDeviceSubClass:        00                                                                                                                                   
bDeviceProtocol:        00                                                                                                                                   
bMaxPacketSize0:        08                                                                                                                                   
idVendor:               046A                                                                                                                                 
idProduct:              0011
bcdDevice:              0100
iManufacturer:          00
iProduct:               00
iSerialNumber:          00
bNumConfigurations:     01

// Config0 dump:        len: 0022
09 02 22 00 01 01 00 A0 32 09 04 00 00 01 03 01
01 00 09 21 11 01 00 01 22 40 00 07 05 81 03 08
00 0A

Title: Re: USB to USB keyboard converter
Post by: mcaple on Wed, 06 October 2021, 06:02:05
Sorry about that had a problem with the extension under windows  :(
Title: Re: USB to USB keyboard converter
Post by: hasu on Wed, 06 October 2021, 09:12:59
Thanks.
But dumper output is broken somewhat unfortunately.

Did you use QMK Toolbox for this, perhaps?  It is known to miss some output.

If so, use hid_listen directly in cmd or power shell.
If not, this is a bug of dumper firmware.
Title: Re: USB to USB keyboard converter
Post by: mcaple on Wed, 06 October 2021, 17:12:02
Morning Hasu,
     I didn't use TMK Toolbox for this and have found that you cannot use it and hid_hidden at the same time as one expects the converter to be in program mode and the other not.
     I did the whole process again and I think I have found that the first time you connect after reflash the output appears broken but if you disconnect and reconnect another time the output looks OK. I have attached 3 outputs for you. As you will see the 1st looks broken and the other 2 have the Corsair keyboard name and look complete. Let me know what you think.

Mark
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 07 October 2021, 00:58:37
try3.txt has complete descriptors. Thanks.
Dumper firmware seems to have a bug on reading decriptors from K70.

Accodring to descriptors of the keyboard  it should support Boot mode(6KRO) as well as NKRO. But it seems to refuse Boot mode request of the converter for some reason.

I dont' know how to update Corsair keyboard firmware but the latest firmware may solve somewhat. iCUE software?

Try this to turn keyboard into 6KRO mode manually. This won't be a solution but may kind of work.
https://help.corsair.com/hc/en-us/articles/360053198052-How-to-Use-a-CORSAIR-keyboard-to-enter-BIOS-mode

Also try "Reset" to return to default setting.
https://help.corsair.com/hc/en-us/articles/360025465031-How-to-Reset-your-keyboard
Title: Re: USB to USB keyboard converter
Post by: mcaple on Thu, 07 October 2021, 02:56:55
Hi Hasu,
     I am writing this message using my Corsair K70 RGB with the USB-USB converter plugged in!!!! At the moment I have done nothing but this is a big step forward. I updated the firmware from 3.19 to 3.24 but that made no difference. What I did have to do was manually enter bios mode using https://help.corsair.com/hc/en-us/articles/360053198052-How-to-Use-a-CORSAIR-keyboard-to-enter-BIOS-mode (https://help.corsair.com/hc/en-us/articles/360053198052-How-to-Use-a-CORSAIR-keyboard-to-enter-BIOS-mode)

It suggests two options but my option was a mixture of the two. The options are

Code: [Select]
Entering BIOS mode
If your keyboard has a Windows lock key:

Hold down the Windows lock key and the F1 key at the same time.
Wait 5 seconds.
Release the Windows lock key and the F1 key.
 
If your keyboard does not have a Windows lock key:

Unplug your keyboard.
Hold down the S key and the B key at the same time.
Plug in your keyboard while still holding the S and B keys.
Release the S and B keys.

Well my keyboard has a windows lock and after plugging the keyboard in and hitting Windows lock key and F1 key nothing happened. What I had to do was unplug hold these two keys and replug the keyboard. I guess otherwise I am not quick enough before your little device is trying to enter BIOS mode.

I am a bit reluctant to try the reset option in fear of losing what I have.

As you say not perfect but just another key combination I need to commit to memory.

Could I ask one final question. Is their a location where people have shared how they have programmed their keyboard? Always easier to get ideas rather than reinvent the wheel. I know you were attempting the spacebar layer selector at one point, is that available anywhere? I did look at another topic that mentioned this work but the site that was linked does not exist anymore and I cannot remember where I was on geekhack  :-[.

Many thanks for your speedy responses thus far and I will try not to bother you anymore,
Mark
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 07 October 2021, 07:33:28
Quote
Could I ask one final question. Is their a location where people have shared how they have programmed their keyboard? Always easier to get ideas rather than reinvent the wheel. I know you were attempting the spacebar layer selector at one point, is that available anywhere? I did look at another topic that mentioned this work but the site that was linked does not exist anymore and I cannot remember where I was on geekhack  :-[.

I tried to collect ideas and examples of keymap here but almost abandoned. I think people can github the wiki page for the purpose.
https://github.com/tmk/tmk_keyboard/wiki/Keymap-examples

As for layer swtich by spacebar search with word 'SpaceFn' in the first post.

Title: Re: USB to USB keyboard converter
Post by: mcaple on Thu, 07 October 2021, 17:13:59
Thanks Hasu,
     I want to try something a bit unusual out but I am having trouble working out how to get the shifted characters using

http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb)

For instance !, @, #, $, % etc

When I look at the Code Edit tab for A I see that the Hex code is 0004 which is not what I expected from

https://unicode-table.com/en/ (https://unicode-table.com/en/)

or

https://unicode-table.com/jp/#0041 (https://unicode-table.com/jp/#0041)
Title: Re: USB to USB keyboard converter
Post by: hasu on Thu, 07 October 2021, 18:45:04
You can use this to input the charactors.
https://github.com/tmk/tmk_keyboard/wiki/Keymap#212-modified-key

As for Unicode see this, you have to use keymap MACRO. Unicode input depends on your OS and is not suit for keyboard protocol. TMK doesn't support Unicode in efficient way at least.
https://github.com/tmk/tmk_keyboard/wiki/FAQ-Keymap#2-unicode-input


Traverse these wiki pages for keymap.
https://github.com/tmk/tmk_keyboard/wiki#keymap
Title: Re: USB to USB keyboard converter
Post by: mcaple on Sat, 09 October 2021, 00:08:04
Hi Hasu,
    the SpaceFn https://geekhack.org/index.php?topic=51069.0 (https://geekhack.org/index.php?topic=51069.0) talks about the idea and then there are a few discussions about the implementation through a number of OS specific scripts and also your more generic implementation. Am I correct in thinking that you have implemented this in https://github.com/tmk/tmk_keyboard/tree/master/keyboard/gh60 (https://github.com/tmk/tmk_keyboard/tree/master/keyboard/gh60) as I can see your keymap_hasu.c ? After installing all the necessary software I have now successfully built this project using

Code: [Select]
make all
and I can see a gh60_lufa.hex

I was going to flash this to my keyboard to try this out. Is this how you would have done it? I feel this is probably a long winded way of getting to this point.

Mark


Title: Re: USB to USB keyboard converter
Post by: mcaple on Sat, 09 October 2021, 00:13:44
Sorry Hasu I missed this crucial piece of information (lots of moving parts to this stuff)

Code: [Select]
$ make KEYMAP=[poker|poker_set|poker_bit|plain|hasu|spacefn|hhkb|<name>]

I should have done

Code: [Select]
$ make KEYMAP=[hasu]
I guess my question was more of is gh60 the only place that you have implemented this logic or is there a better project for me to start with?

Mark
Title: Re: USB to USB keyboard converter
Post by: mcaple on Sat, 09 October 2021, 00:35:35
Unfortunately after doing a

Code: [Select]
make clean

and then

Code: [Select]
make KEYMAP=hasu
the gh60_lufa.hex is created but when I flash it none of the keys do anything. I think a little knowledge is a dangerous thing and I have attempted something silly.

Mark
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 09 October 2021, 01:16:22
GH60 is product name of keyboard PCB, GH60 firmware is not suit for this converter.


You can define SpaceFn layout in Keymap Editor
See this exampel of SpaceFN layout: https://goo.gl/aFmnbY

This link displays Keymap Editor for HHKB Alt Controller by default, but you can
just select "USB-USB Converter" at "Base Firmware File:" to edit for this converter.
[attach=1]


Title: Re: USB to USB keyboard converter
Post by: mcaple on Sat, 09 October 2021, 17:11:29
Thanks Hasu,
     it's only after you reply that I notice the answer is right in front of my eyes, sorry and thanks for your patience. That layout is a great starter for me. When I asked about shifted characters you suggested I use MACROS. My understanding is they are key recordings defined in code.

An example of defining MACROS in keymap.c is given at https://github.com/tmk/tmk_keyboard/wiki/Keymap#232-examples (https://github.com/tmk/tmk_keyboard/wiki/Keymap#232-examples)

Once defined you simply index them from the TMK Keymap Editor Code Editor Tab using ACTION_MACRO and enter the index in Code(hex).

If the MACROS cannot be defined in the editor then is there code for the SpaceFn layout as https://github.com/tmk/tmk_keyboard/wiki/Keymap-examples (https://github.com/tmk/tmk_keyboard/wiki/Keymap-examples) says TBD.

Maybe they can be defined in the editor, as this hex firmware file is the output of the code? Sorry Hasu I know you are not the sole maintainer of TMK and I have asked too many questions but this is probably my last piece in the puzzle to start me on my keyboard journey and I will address other questions to the broader community.

Mark
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 09 October 2021, 20:09:06
I meant that 'modified key' is enough for your need(shifted characters) and you don't have to use MACRO and Unicode probably.
https://github.com/tmk/tmk_keyboard/wiki/Keymap#212-modified-key

MACRO is not supported currently in Keymap Editor and you have to write C code. MACRO is not well documented and not maintained actively, you will have to traverse source codes and wiki pages in github. I don't recommend that unless you are a programmer who have enough time and patience.
Title: Re: USB to USB keyboard converter
Post by: mcaple on Sun, 10 October 2021, 18:47:44
Thanks Hasu,
    I have finally got around to defining my Atreus-like keyboard settings and have been trying it out. It does take a little unlearning but I am reasonably happy so far. I have what looks like a small issue when I toggle back to layer 0 from layer 2 the key action codes from layer 2 appear to be retained and not the action codes from layer 0.

It is described in the PROBLEMS section of https://github.com/mcaple/tmk_keyboard/wiki/Keymap-examples#atreus-like-layout (https://github.com/mcaple/tmk_keyboard/wiki/Keymap-examples#atreus-like-layout)

Any ideas?

As usual many thanks,
Mark
Title: Re: USB to USB keyboard converter
Post by: hasu on Sun, 10 October 2021, 21:08:25
Great. In TMK keymap layer switching means enabling or disabling a layer, not moving one to another layer exactly.
"Toggle" action changes state(on/off) of a layer, you can turn a layer on if its current state is off, and vice versa.

I think what you want there is disabling Layer 2, not enabling Layer 0. (Layer 0 should be always enabled in most cases.)
You will have to T2 on Layer 2,  intead of T0.


I just found that we discussed about keymap topic here for a while, which is not specfic to USB-USB converter :D
Feel free to post in this thread if you have any generic problem or question to TMK firmware.
https://geekhack.org/index.php?topic=41989.0




Title: Re: USB to USB keyboard converter
Post by: mcaple on Mon, 11 October 2021, 01:19:28
Brilliant Hasu,
      the 'Toggle on Layer 2' tooltip confused me a bit. Maybe 'Toggle Layer2' or 'Toggle on/off Layer2' would have been better.

No more questions to you in this thread unless I find a USB-USB converter problems. Scouts honour.   :thumb:

Mark 
Title: Re: USB to USB keyboard converter
Post by: hasu on Sat, 23 October 2021, 10:56:24
[FIRMWARE UPDATE]
Updated prebuilt firmware on Keymap Editor and github repo.

- Fix for ConnectPro UD-12+ KVM #707
- UHS2: 500ms delay for bus reset for Matrix Vita
  https://geekhack.org/index.php?topic=69169.msg3073431
- UHS2: Improve plugin detection in busprobe()



Horsebadorties,
You can download new firmware from Keymap Editor now.

ConnectPro UD-12+ KVM doesn't support upto 3 endpoints. USB-USB converter had 4-5 endpoints so far but uses only 3 now.
https://github.com/tmk/tmk_keyboard/issues/707

You are correct! The first .hex file indeed replicated the problem. The second file works fine.

Thanks so much. Now I can actually start using the converter!



nug,
Sorry for the late firmware update.
The fix is included in new firmware now.

I've attached 2 logs, one where the converter was already plugged in after flashing, and then the keyboard was connected, and the other where the keyboard was plugged into the converter before plugging the converter into the computer.

I also tested changing the delay, it seems to work with 400ms, but it failed on 100/200/300ms.
Title: Re: TMK USB to USB keyboard converter
Post by: apastuszak on Fri, 05 November 2021, 11:05:58
I'm about to order one of these, and had a question.

I use a USB switch box all day and hop between a PC and Mac.

Is this going to mess with the converter, or should it work just fine?
Title: Re: TMK USB to USB keyboard converter
Post by: haydoselefantes on Fri, 05 November 2021, 16:00:02
I'm about to order one of these, and had a question.

I use a USB switch box all day and hop between a PC and Mac.

Is this going to mess with the converter, or should it work just fine?

Works fine with my Ugreen USB 3.0 switcher between my PC and Mac.
Title: Re: TMK USB to USB keyboard converter
Post by: apastuszak on Fri, 05 November 2021, 16:01:25
I'm about to order one of these, and had a question.

I use a USB switch box all day and hop between a PC and Mac.

Is this going to mess with the converter, or should it work just fine?

Works fine with my Ugreen USB 3.0 switcher between my PC and Mac.

That's the exact switch I have.  I guess it's time to place an order.
Title: Re: TMK USB to USB keyboard converter
Post by: apastuszak on Thu, 11 November 2021, 20:32:14
And another question. Can we remap modifier keys?

I have a Matias Tactile Pro and I'd like to remap this little fn key to an insert key.
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Thu, 11 November 2021, 21:56:11
Usual modifier keys can be remapped.
But you can't remap Fn key, becase Fn key doesn't send any code to computer or converter in most cases.


And another question. Can we remap modifier keys?

I have a Matias Tactile Pro and I'd like to remap this little fn key to an insert key.

Title: Re: TMK USB to USB keyboard converter
Post by: dxlr8r on Sun, 14 November 2021, 15:50:55
Are there any plans to implement more dual role functions? For example, I would love double tap and press and hold for turning a key into some other key. For example double tap, within a short amount of time, A-Å for example. Now it only to work with modifier and layers, not regular characters.
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Tue, 16 November 2021, 21:21:59
I don't have plan for adding exact action like that because the action cannot be supported in Keymap Editor probably.

but I want the firmware to allow you to implement the custom action.
It would be better to have good documentation about how to write custom action. Poeple have various needs and you can't expect all of them.

I started documenting here again today :D and will update when I have time.
https://github.com/tmk/tmk_keyboard/wiki/Keymap:-Custom-Key-Action#function-action

You can post in general TMK firmware thread if you need help.
https://geekhack.org/index.php?topic=41989.0


Are there any plans to implement more dual role functions? For example, I would love double tap and press and hold for turning a key into some other key. For example double tap, within a short amount of time, A-Å for example. Now it only to work with modifier and layers, not regular characters.

Title: F23 with Modifiers no replug issue
Post by: daniel123 on Wed, 08 December 2021, 16:19:45
Hi Hasu,

I use two of your converters since last year and my life has literally changed  :thumb: Thanks a lot!

Anyways, I'm having an issue ever since I started using my second keyboard and I hope you can change my life a little further now :D

I followed the conversation between you and Zucca (somewhere here:  https://geekhack.org/index.php?topic=69169.450) and downloaded the hex files Zucca provided for the F24, F23, and F22 (here: https://geekhack.org/index.php?topic=69169.msg2781175#msg2781175).

The hex-keymap works fine and comes without this nasty re-plug issue.

BUT... it doesn't allow for the use of modifiers. And that has only recently become a real issue to me as I have more and more automated workflows I'd like to use.

Taran, made me aware of your USB-2-USB-converter in his YouTube video here:


He also has a Github page (https://github.com/TaranVH/2nd-keyboard/tree/master/HASU_USB/NO_REPLUG_ISSUES_with_modifiers) on which he provides the code of Zucca WITH the modifiers enabled.

He writes, however, that it is untested and he also does not provide a hex file but only the raw code. If I use this and try creating a hex file myself, I run into the error attached to this message.

Can you guide me on how to bring together both, no-replug issue plus modifiers? That would be super awesome <3

Thanks a lot
Daniel
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Thu, 09 December 2021, 01:56:19
 daniel123,
I don't know about how to build QMK and hope someone can help.


But confirmed the keymap can be built with TMK firmware like below.

1. Download this keymap file and save it as 'unimap_TaranVH.c' under converter/usb_usb/ directory.
https://github.com/TaranVH/2nd-keyboard/blob/master/HASU_USB/NO_REPLUG_ISSUES_with_modifiers/keymap.c

2. Run make command.
Quote
$ make -f Makefile.unimap KEYMAP=TaranVH clean
$ make -f Makefile.unimap KEYMAP=TaranVH

Attached its hex file.
[attachurl=1]
Title: Re: TMK USB to USB keyboard converter
Post by: daniel123 on Thu, 09 December 2021, 16:05:07
Hi Hasu,

Thanks a lot for your quick reply but unfortunately I'm just pretty stupid and have no idea :D

When I use your hex-file, there are some issues with my keyboard e.g., CAPSLOCK, WIN, PRINT, etc.

I also tried downloading TMK after all and was trying to make a hex file myself. But I struggle a lot and give up for now. It looks very similar to QMK but somehow I can't get it to run. I also looked for some proper instructions on how to do this but couldn't really find a step-by-step instruction (which I need with my skills). Do you know any page or YouTube video that is describing how to do this?

Thanks man

Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Thu, 09 December 2021, 18:04:58
When I use your hex-file, there are some issues with my keyboard e.g., CAPSLOCK, WIN, PRINT, etc.
Note that those keys are remapped to unusual keys(F20, LANG1, ???), they won't be useful without TaranVH's AHK scripts.


Quote
I also tried downloading TMK after all and was trying to make a hex file myself. But I struggle a lot and give up for now. It looks very similar to QMK but somehow I can't get it to run. I also looked for some proper instructions on how to do this but couldn't really find a step-by-step instruction (which I need with my skills). Do you know any page or YouTube video that is describing how to do this?

There is firmware build instruction on github wiki, check it first.
https://github.com/tmk/tmk_keyboard/wiki#build-firmware
Title: Re: TMK USB to USB keyboard converter
Post by: daniel123 on Sat, 11 December 2021, 05:22:17
Hi Hasu,

I am actually using Taran's AHK script but still the modifiers were not working as expected. But ok, I'm going the tough way then, I guess/hope :P :D

One question before I jump into the rabbit hole. Are you aware of any way that would allow me to read a hex file that I have flashed onto an USB-2-USB-converter of yours? Because I have a fully functioning hex-file on my main keyboard with all modifiers enabled and no replug issue or any other issues but I can't seem to find the hex file and/or the original keymaps somewhere on my hard drive. I don't want to screw up anything so I'd like to backup my current setting. Any chance I can dump that already flashed hex-file onto a file on my hard drive?

Thanks for your time and guidance, really appreciate it man :)
Daniel
Title: Re: TMK USB to USB keyboard converter
Post by: suicidal_orange on Sat, 11 December 2021, 06:53:20
What are you using to flash the chip daniel?  Looking at the documentation it suggests you use dfu-programmer, if you do take whatever command you use to flash a hex change 'flash' to 'read' and it should output to the filename rather than flashing it.  Be sure not to overwrite anything!

Or not (see below)
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Sat, 11 December 2021, 20:45:15
One question before I jump into the rabbit hole. Are you aware of any way that would allow me to read a hex file that I have flashed onto an USB-2-USB-converter of yours?

Unfotunately you can't.



What are you using to flash the chip daniel?  Looking at the documentation it suggests you use dfu-programmer, if you do take whatever command you use to flash a hex change 'flash' to 'read' and it should output to the filename rather than flashing it.  Be sure not to overwrite anything!

Default factory setting of ATMega32U4 doesn't support "read" as far as I know.
And my converter uses the default setting and stock bootloader as it is, it doesn't support "read" feature unfortunately.
Title: Re: TMK USB to USB keyboard converter
Post by: suicidal_orange on Sun, 12 December 2021, 02:29:06
Default factory setting of ATMega32U4 doesn't support "read" as far as I know.
And my converter uses the default setting and stock bootloader as it is, it doesn't support "read" feature unfortunately.
Sorry for spreading misinformation - I'll have to remember this :(
Title: Re: TMK USB to USB keyboard converter
Post by: daniel123 on Sun, 12 December 2021, 14:43:26
Thanks guys, then no backup it is :P :D

If I succeed I'll come back here and share what I've found... most probably I get back even earlier with stupid questions :D
Title: Re: TMK USB to USB keyboard converter
Post by: daniel123 on Sun, 19 December 2021, 15:22:43
Ok, in the past days I did a few things and documented what I did. I'm happy to let you know that I've found the source of my keyboard issue. Super long story very short: it was an USB extension cable  :D

For everyone experiencing similar issues or interest in what I did, here is what I did ;)

I installed TMK via my Ubuntu which is running on Win10
I took the code from Taran's Git and adjusted it for my F23 keymap (from here: https://github.com/TaranVH/2nd-keyboard/blob/master/HASU_USB/NO_REPLUG_ISSUES_with_modifiers/keymap.c)
-> I attached my F22, F23 and F24 hex files in case anyone is interested in the modifier hex files that run with Taran's AHK script. I didn't test the F22 and F24 hex though, but they follow the same principle, see the *.c files.
I built my own hex files thanks to the documentation that Hasu was referring me to via TMK on Ubuntu - thanks for the tip, Hasu :)  (see: https://github.com/tmk/tmk_keyboard/wiki#build-firmware)
I flashed my USB-converter using QMK Toolbox

Result: All keys, including the modifiers, could be used.

So I started testing. I re-started my PC, put it to sleep, woke it up, turned it off and turned it back on a few times to figure out two things:
1) The keyboard stays "online" as long as I don't turn off the PC. So I can re-start and put it to sleep without any issues. Once I turn it off, however, I have to replug the keyboard after turning it back on (see attachment with test results).
2) I do not have any of those nasty replug issues Zucca was describing i.e., I do not have to replug my keyboard multiple times until it works or anything like this described here: https://geekhack.org/index.php?topic=69169.msg2738586#msg2738586. I only had to replug the keyboard once and then it worked again - always.

I then ran the same tests using Zucca's hex files (see https://geekhack.org/index.php?topic=69169.msg2781175#msg2781175).

Result 1: All keys could be used, EXcluding the modifiers.
Resutl 2: The replug issue was exactly as described above i.e., only after turning off the PC the keyboard would go "offline" and only after repluging it once it would come "online" again.

I decided to read the entire communication between Hasu and Zucca to figure out whether I'm missing something.
There I found that you guys were talking about the energy savings options and that this was the root cause for the replug issues (see https://geekhack.org/index.php?topic=69169.msg2740179#msg2740179).

I went to the Windows device manager and switched off all USB energy savings options I could find for the HID devices and also enabled that all USB devices could wake the PC from sleeping.

Result: No effect at all i.e., the keyboard would still need to be replugged after turning the PC off and on again.

Around that time I started questioning each single detail and recognised that the keyboard was plugged into the USB converter, and the USB converter was plugged into a 5m USB extension cable (a USB-female to USB-male cable, because my PC is "around the corner"), and my 5m USB extension cable was plugged into the PC.
So I ran a few tests without that 5m long USB extension cable by plugging in my keyboard directly to the PC. I switched it off and on and everything and then - it just worked - each time! :)

Then I recognized how stupid I was.
I remembered that my second keyboard never had the replug issue at all, however, the modifiers didn't work. When I decided to do something about the modifier issue, I changed the setup of my 2nd keyboard.

The whole time it was plugged into a USB hub. This USB hub was connected to the PC via a 5m long USB cable (no extension cable but rather a regular USB-male to USB-male 5m long cable)
My first keyboard, by the way, is using the same USB hub and experiences no replug issues ever, I recognized... but yeah, quite late... so yeah, quite stupid :D

However, my USB hub is in a very unhandy location for some (h)experiments so I decided using my 5m USB extension cable. And that was causing my replug problems when actually everything was performing correctly.

Once I bypassed the 5m USB extension cable but plugged the USB converter directly into the USB hub, I had no replug problems or whatsoever anymore. Plus, all modifiers are working now as desired <3

I'm happy now, thanks for your support Hasu :)

PS. I messaged Taran via Twitter, maybe he includes the correct hex files in his Git repository.


Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Mon, 20 December 2021, 01:54:51
Around that time I started questioning each single detail and recognised that the keyboard was plugged into the USB converter, and the USB converter was plugged into a 5m USB extension cable (a USB-female to USB-male cable, because my PC is "around the corner"), and my 5m USB extension cable was plugged into the PC.
So I ran a few tests without that 5m long USB extension cable by plugging in my keyboard directly to the PC. I switched it off and on and everything and then - it just worked - each time! :)

Then I recognized how stupid I was.
I remembered that my second keyboard never had the replug issue at all, however, the modifiers didn't work. When I decided to do something about the modifier issue, I changed the setup of my 2nd keyboard.

The whole time it was plugged into a USB hub. This USB hub was connected to the PC via a 5m long USB cable (no extension cable but rather a regular USB-male to USB-male 5m long cable)
My first keyboard, by the way, is using the same USB hub and experiences no replug issues ever, I recognized... but yeah, quite late... so yeah, quite stupid :D

However, my USB hub is in a very unhandy location for some (h)experiments so I decided using my 5m USB extension cable. And that was causing my replug problems when actually everything was performing correctly.

Once I bypassed the 5m USB extension cable but plugged the USB converter directly into the USB hub, I had no replug problems or whatsoever anymore. Plus, all modifiers are working now as desired <3

Nice find and thank you for the detailed tests. Interesting.

Was the USB hub is "externally powered", or "bus powered"?

Voltage of power line drops depending on length and quality of USB cable, I guess serious voltage drop causes the problem especially when computer is turned on, or pulg-in. The hub mitigates voltage drop probably.
Title: Re: TMK USB to USB keyboard converter
Post by: daniel123 on Mon, 20 December 2021, 15:49:47
I just checked, it's using an external power supply ;)

And it works like a charm :)
Title: Re: TMK USB to USB keyboard converter
Post by: glennm on Thu, 30 December 2021, 08:09:04
Hi Hasu,

I bought 3 of the USB converters from you about a year ago and want to thank you again for the great service.

I'm finally getting around to working with these, and it looks like I should do a firmware update.

I've downloaded from Github before, but I'm really don't understand which zip I should download and how to update the firmware.   Any chance you could step me through the process or refer me to a link(s)?

A great New Year to you!
Title: Re: TMK USB to USB keyboard converter
Post by: suicidal_orange on Thu, 30 December 2021, 08:53:23
I really don't understand which zip I should download and how to update the firmware.   Any chance you could step me through the process or refer me to a link(s)?
The info is in the first post, as long as you don't want to do complicated things with macros you can change your keymap using the online editor (http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb) to make the hex file and flash it using these instructions (https://github.com/tmk/tmk_keyboard/wiki#flash-firmware) :)
Title: Re: TMK USB to USB keyboard converter
Post by: macintosh on Mon, 03 January 2022, 03:29:32
Not sure if I should post this issue here or not. Please let me know if this is not the right thread.
I tried building the converter using pro micro 3.3v and mini usb shield 2.0. Works great except that it doesn't work with my usb numpad.

Keyboard Model:
https://www.lazada.com.my/products/19-keys-multimedia-digital-keypad-numpad-ultra-slim-wired-keyboard-usb-wired-numeric-keyboard-i1843506352.html
Sorry, I've tried looking for the official product page but I couldn't  find it. There is also no model number on the numpad (I can take apart the unit to see the PCB if needed).

OS:
Windows

hid_listen output:
I've tried building the usb desc dumper and using hid listen but it couldn't even get to the stage where it could dump the description. I can only see the following:

Code: [Select]
Waiting for device:
Listening:
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
nak_limit:7FFF
crSU:0D
Configuring:0D
usb_state: A0


Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Mon, 03 January 2022, 04:08:44
It fails to get Device descriptor for some reason.

Check around these lines and try adding debug prints with TRACE* macro to narrow down the problem.
My wild guess is that this is timing issue, adding delay() somewhere may help.

https://github.com/tmk/USB_Host_Shield_2.0/blob/master_debug/Usb.cpp#L160
https://github.com/tmk/USB_Host_Shield_2.0/blob/master_debug/Usb.cpp#L745
https://github.com/tmk/USB_Host_Shield_2.0/blob/master_debug/Usb.cpp#L566
Title: Re: TMK USB to USB keyboard converter
Post by: salvanipour on Fri, 07 January 2022, 11:57:34
Hi All,

I recently got a USB-to-USB converter for my Realforce 87u, with the intention of remapping a few keys to better work with MacOS. Everything works great with one exception: swapping of capslock and left control.

My keyboard has jumpers that are already set to flip left control and capslock, which is great, however after programming the USB-to-USB converter it keeps interpreting capslock as capslock and left control as left control. I have tried both QMK and TMK with their respective online mappers, using QMK Toolbox to program the controller itself. I am not sure if there is an issue with using QMK Toolbox to deploy TMK firmware or if I need to clear the EEPROM of the QMK firmware prior to flashing the TMK firmware. Any help would be greatly appreciated.
Title: Re: TMK USB to USB keyboard converter
Post by: suicidal_orange on Fri, 07 January 2022, 12:19:29
Hi All,

I recently got a USB-to-USB converter for my Realforce 87u, with the intention of remapping a few keys to better work with MacOS. Everything works great with one exception: swapping of capslock and left control.

My keyboard has jumpers that are already set to flip left control and capslock, which is great, however after programming the USB-to-USB converter it keeps interpreting capslock as capslock and left control as left control. I have tried both QMK and TMK with their respective online mappers, using QMK Toolbox to program the controller itself. I am not sure if there is an issue with using QMK Toolbox to deploy TMK firmware or if I need to clear the EEPROM of the QMK firmware prior to flashing the TMK firmware. Any help would be greatly appreciated.

I guess you are using a GUI to change the firmware?  If so you need to map things where they would be by default, so whatever you want to do with caps needs to be mapped next to A on screen even if the code for caps is actually sent when you press control.  The convertor (or indeed the computer) doesn't know what the keys are actually labelled, all it knows is what code has been sent.

If you are not using a GUI and/or are already doing this are you sure the physical switch works?
Title: Re: TMK USB to USB keyboard converter
Post by: salvanipour on Fri, 07 January 2022, 13:30:18
Hi All,

I recently got a USB-to-USB converter for my Realforce 87u, with the intention of remapping a few keys to better work with MacOS. Everything works great with one exception: swapping of capslock and left control.

My keyboard has jumpers that are already set to flip left control and capslock, which is great, however after programming the USB-to-USB converter it keeps interpreting capslock as capslock and left control as left control. I have tried both QMK and TMK with their respective online mappers, using QMK Toolbox to program the controller itself. I am not sure if there is an issue with using QMK Toolbox to deploy TMK firmware or if I need to clear the EEPROM of the QMK firmware prior to flashing the TMK firmware. Any help would be greatly appreciated.

The convertor (or indeed the computer) doesn't know what the keys are actually labelled, all it knows is what code has been sent.

Thank you so much for this. I completely blanked out on the fact that the dip switch was already doing the flipping, so by telling the firmware to do the same thing it was essentially flopping it back to normal ANSI (self sabotage, so to speak). I updated the firmware accordingly:

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

And it works perfectly now. I cannot thank you enough for providing such an easy fix so quickly. I really appreciate it!

Edit: Also thank you Hasu for such a wonderful little device! So glad to be able to use my 87u again.
Title: Re: TMK USB to USB keyboard converter
Post by: HyperDown on Sun, 09 January 2022, 09:04:02
Am I correct in thinking that this converter will allow me to remap the 'kana' and 'eng' keys on a Japanese layout realforce keyboard?  I'm interested in mapping those keys to return and backspace, respectively.

 
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Sun, 09 January 2022, 12:36:30
I believe so.

EDIT: The converter supports all of six Japnese specific keys; 無変換(muhenkan), 変換(henkan), ひらがな(hiragana), ろ(ro), ¥(yen) and 全角/半角(zenkaku/hankaku).
Note that 全角/半角 key is identical to `(grave in US) in USB spec and TMK firmware.
And 英数(eisuu/english) and かな(kana) on Mac layout are handled as 無変換 and 変換 by the converter.

See this for JIS layout.
https://en.wikipedia.org/wiki/Keyboard_layout#Japanese
Title: Re: TMK USB to USB keyboard converter
Post by: HyperDown on Mon, 10 January 2022, 06:52:52
Thanks, Hasu!
Title: Re: TMK USB to USB keyboard converter
Post by: dxlr8r on Wed, 16 March 2022, 09:28:06
Perhaps been addressed before. But I would like to use layers, but I do not want to dedicate an entire button for it.

What would be perfect was to be able to switch to a layer by pressing and holding a key, like Space. And if you simply tap, you get the Space key.

Then once inside that layer, I could use a dedicated button to return to the default layer.

Guess kinda like a sticky version of ACTION_LAYER_TAP_KEY.

Perhaps this is already possible?
Title: Re: TMK USB to USB keyboard converter
Post by: suicidal_orange on Wed, 16 March 2022, 10:46:16
Perhaps been addressed before. But I would like to use layers, but I do not want to dedicate an entire button for it.
Not perfect but you could use the hold space for layer (with tap typing space) then on that layer have a key to switch to another layer with a key to return to default on it.  Then you could have hold space and tap M for a media layer or G for gaming (or whatever it is you do on your computer) with all the keys you want on the home row so you don't have to move your fingers.
Title: Re: TMK USB to USB keyboard converter
Post by: qeebored on Wed, 16 March 2022, 18:05:21
At last I got to test the converter I got in the mail a few weeks ago. It works really well with my HHKB Pro 2. I used an hour creating a decent keymap on the online configurator, and now it is almost as I want it. Thanks a lot for this excellent converter, Hasu.
Title: Re: TMK USB to USB keyboard converter
Post by: dxlr8r on Wed, 23 March 2022, 06:26:22
Perhaps been addressed before. But I would like to use layers, but I do not want to dedicate an entire button for it.
Not perfect but you could use the hold space for layer (with tap typing space) then on that layer have a key to switch to another layer with a key to return to default on it.  Then you could have hold space and tap M for a media layer or G for gaming (or whatever it is you do on your computer) with all the keys you want on the home row so you don't have to move your fingers.

That is a really good advice. Not what I wanted, but I think it might be better :)
Title: Re: TMK USB to USB keyboard converter
Post by: nevin on Wed, 23 March 2022, 09:24:46
depending on use, sometimes it's easier to have the layer switch as a momentary function.
- tapping space = space
- holding space = momentarily go to layer X while space is held (acting like a Fn key)
- dual role keys are key with some of the older macintosh keyboards.
...again, depends on use, but the momentary is usually easier than switching to a layer then switching back.
[attachimg=1]
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Thu, 24 March 2022, 16:46:16
Perhaps been addressed before. But I would like to use layers, but I do not want to dedicate an entire button for it.

What would be perfect was to be able to switch to a layer by pressing and holding a key, like Space. And if you simply tap, you get the Space key.

Then once inside that layer, I could use a dedicated button to return to the default layer.


Not sure I can help but describe details more about your usage scenario.

Is this what you want?
when you get something on destionation layer:
1. press and hold "space" to switch to destination layer.
2. release space. (still in destination layer)
3. register one or more keys in the destination layer
4. press and release "dedicated button" to return to the original layer

What key is "dedicated button" in your case?
You really want to place the function on your space, or other key?

Title: Re: TMK USB to USB keyboard converter
Post by: dxlr8r on Fri, 25 March 2022, 16:32:21
Not sure I can help but describe details more about your usage scenario.

Is this what you want?
when you get something on destionation layer:
1. press and hold "space" to switch to destination layer.
2. release space. (still in destination layer)
3. register one or more keys in the destination layer

Sound right.

4. press and release "dedicated button" to return to the original layer

What key is "dedicated button" in your case?
You really want to place the function on your space, or other key?

On my default layer, I do not want to dedicate a button, like a single tap, to anything else that what is printed on the key. I cannot do without any letter, space, backspace etc. :)

For other layers it is not a problem to dedicate a button entirely (no dual role) to a button.
Title: Re: TMK USB to USB keyboard converter
Post by: dxlr8r on Fri, 25 March 2022, 16:36:48
Is it possible to bind two actions to one key? Say you press "f", which then results in a layer switch, then types "F8" (just an example). I thought MACROs might do it, but in the example it can only type normal keys, and not function keys.
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Fri, 25 March 2022, 22:33:25
4. press and release "dedicated button" to return to the original layer

What key is "dedicated button" in your case?
You really want to place the function on your space, or other key?

On my default layer, I do not want to dedicate a button, like a single tap, to anything else that what is printed on the key. I cannot do without any letter, space, backspace etc. :)

For other layers it is not a problem to dedicate a button entirely (no dual role) to a button.



OK. I think I understand what you want somehow.

Save code below as file named 'unimap_stickylayer.c' and buiild firmware like this.
With this code you can enable 'Layer1' by holding 'Space' key on 'Layer0' and disable 'Layer1' by pressing(and release) 'Right Control' key on 'Layer 1'.

Quote

$ make -f Makefile.unimap KEYMAP=stickylayer clean
$ make -f Makefile.unimap KEYMAP=stickylayer

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


/* ID for user defined functions */
enum function_id {
    STICKY_LAYER,
};

/*
 * user defined action function
 */
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
    xprintf("%s%d%s\n", (record->event.pressed ? "P" : "R"), record->tap.count, (record->tap.interrupted ? "i" : ""));

    switch (id) {
        case STICKY_LAYER:
            if (record->event.pressed) {
                if (record->tap.count > 0) {
                    register_code(KC_SPACE);
                } else {
                }
            } else {
                if (record->tap.count > 0) {
                    unregister_code(KC_SPACE);
                } else {
                    layer_on(1);
                }
            }
            break;
    }
}

#define AC_STL1     ACTION_FUNCTION_TAP(STICKY_LAYER)
#define AC_OFF1     ACTION_LAYER_OFF(1, ON_PRESS)

#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,          STL1,          HENK,KANA,RALT,RGUI,APP, 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,BTLD,         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,OFF1,     HOME,PGDN,END,     TRNS,     TRNS,TRNS
    ),
};
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Fri, 25 March 2022, 22:40:34
Is it possible to bind two actions to one key? Say you press "f", which then results in a layer switch, then types "F8" (just an example). I thought MACROs might do it, but in the example it can only type normal keys, and not function keys.

MACRO offers no layer handling action in current implementation.
Title: Re: TMK USB to USB keyboard converter
Post by: suicidal_orange on Sat, 26 March 2022, 03:26:13
Is it possible to bind two actions to one key? Say you press "f", which then results in a layer switch, then types "F8" (just an example). I thought MACROs might do it, but in the example it can only type normal keys, and not function keys.
Unless you're trying to mess with someone having no "f" on your keyboard really doesn't sound like a good idea (https://cdn.geekhack.org/Smileys/solosmileys/laugh.gif)

I guess you've simplified the scenario to the point of it looking useless, what are you actually trying to do?
Title: Re: TMK USB to USB keyboard converter
Post by: dxlr8r on Sat, 26 March 2022, 07:04:26
I guess you've simplified the scenario to the point of it looking useless, what are you actually trying to do?

It was a simple example, yes. It is kind of complicated to explain. But the "f" key (just an example for a letter) remapping would not happen on the default layer. Kinda reminds me of the Simpsons episode where Homer is lacking keys for his typewriter, it quickly becomes funny ;)

But from the other layer, not default, my point would be to jump to the default layer (where f types f) then press a Function key. This mechanism could be used in for example emacs, where the Function key could drop you into a modal mode and layer. So it is way to integrate the keyboard layers with a software's layer.


It could also be used as a signal to the system, so it can provide the end user with a visual marker/notication of some kind of what layer the user is at. You jump to a layer, and a function key is pressed, which the system looks for.

Can also be used for prefix keys, say you are on layer 1, and bind f to Switch to layer 0, then type ctrl-o, then programs like emacs will see that as a prefix, and the next key you press with determine the command (C-o x).
Title: Re: TMK USB to USB keyboard converter
Post by: dxlr8r on Sat, 26 March 2022, 07:08:18
MACRO offers no layer handling action in current implementation.

Thank you for answer though. Would be a nice feature though.
Title: Re: TMK USB to USB keyboard converter
Post by: suicidal_orange on Sat, 26 March 2022, 07:46:48
But from the other layer, not default, my point would be to jump to the default layer (where f types f) then press a Function key. This mechanism could be used in for example emacs, where the Function key could drop you into a modal mode and layer. So it is way to integrate the keyboard layers with a software's layer.
That makes sense.

So you don't really care which order the actions happens in, maybe the tap key code could be manipulated to send the Fx key on the first tap then switch layer on the second?  A double tap is still going to be quicker than any other key combo.

If hasu doesn't say it wont work I'll have a look at it later.
Title: Re: TMK USB to USB keyboard converter
Post by: dxlr8r on Sat, 26 March 2022, 08:11:27
So you don't really care which order the actions happens in, maybe the tap key code could be manipulated to send the Fx key on the first tap then switch layer on the second?  A double tap is still going to be quicker than any other key combo.

Order does not matter. But ideally one tap would be better though ;)

If hasu doesn't say it wont work I'll have a look at it later.

 :cool:
Title: Re: TMK USB to USB keyboard converter
Post by: suicidal_orange on Sat, 26 March 2022, 12:11:58
one tap would be better though ;)

Based on the documentation (https://github.com/tmk/tmk_keyboard/wiki/Keymap%3A-Custom-Key-Action) I think this code should enable the keycode F2L2 which will type F2 then switch to layer 2 in a single tap, of the four scenarios the original handled only one remains as if it works you can't tap it twice because you'll be on another layer, and you wont quickly press another key while pressing this one because it wouldn't make sense to.  I think the code goes in the keymap.c file but I can't get it to compile because LUFA is too old (I have no idea what this is and the suggested fix doesn't work)

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


/* id for user defined functions */
enum function_id {
    F2_LAYER2,
};

/*
 * user defined action function
 */
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
    if (record->event.pressed) dprint("P"); else dprint("R");
    dprintf("%d", record->tap.count);
    if (record->tap.interrupted) dprint("i");
    dprint("\n");

    switch (id) {
        case F2_LAYER2:
            if (record->event.pressed) {
                    register_code(KC_F2);
                    unregister_code(KC_F2);
                    layer_on(2)
            }
            break;
    }
}

#define AC_F2L2     ACTION_FUNCTION_TAP(F2_LAYER2)
Title: Re: TMK USB to USB keyboard converter
Post by: dxlr8r on Sun, 27 March 2022, 15:26:51
I think the code goes in the keymap.c file but I can't get it to compile because LUFA is too old (I have no idea what this is and the suggested fix doesn't work)

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


/* id for user defined functions */
enum function_id {
    F2_LAYER2,
};

/*
 * user defined action function
 */
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
    if (record->event.pressed) dprint("P"); else dprint("R");
    dprintf("%d", record->tap.count);
    if (record->tap.interrupted) dprint("i");
    dprint("\n");

    switch (id) {
        case F2_LAYER2:
            if (record->event.pressed) {
                    register_code(KC_F2);
                    unregister_code(KC_F2);
                    layer_on(2)
            }
            break;
    }
}

#define AC_F2L2     ACTION_FUNCTION_TAP(F2_LAYER2)

First, what is LUFA?

Second, it does not work here either. Tried putting in keymap.c and keymap_common.c.

I get:

Code: [Select]
In file included from keymap_my.c:1:
keymap_common.h:128:47: error: 'KC_F2L2' undeclared here (not in a function); did you mean 'KC_F22'?
  128 |       KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, /* 28-2F */ \
      |                                               ^~~
keymap_common.h:179:3: note: in expansion of macro 'KEYMAP_ALL'
  179 | ) KEYMAP_ALL( \
      |   ^~~~~~~~~~
keymap_my.c:39:5: note: in expansion of macro 'KEYMAP'
   39 |     KEYMAP(
      |     ^~~~~~
make: *** [obj_usb_usb/keymap_my.o] Error 1

EDIT: made it work, better example https://github.com/tmk/tmk_keyboard/blob/a93677cbf145baf210f92a9129ded55c9ef5657b/keyboard/hhkb/keymap_spacefn.c

So just call the action function from fn_actions.
Title: Re: TMK USB to USB keyboard converter
Post by: dxlr8r on Mon, 28 March 2022, 07:12:50
So, I find myself in the same situation as many others before me... There are to few fn actions, I quickly used up all 32.

Then I read up on actionmap, does this work for USB to USB converter? And if so, any examples.

I also had issues compiling. I saw `keyboard/alps64` had some examples, so I tried:

Code: [Select]
keyboard/alps64 % make -f Makefile.unimap KEYMAP=hasu

-------- begin --------
avr-gcc (Homebrew AVR GCC 9.3.0_3) 9.3.0
Copyright (C) 2019 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.

make: *** No rule to make target `obj_alps64_unimap/unimap_hasu.o', needed by `alps64_unimap.elf'.  Stop.

What am I missing? Using macOS Monterey on a M1.
Title: Re: TMK USB to USB keyboard converter
Post by: dxlr8r on Thu, 28 April 2022, 08:57:44
With this code you can enable 'Layer1' by holding 'Space' key on 'Layer0' and disable 'Layer1' by pressing(and release) 'Right Control' key on 'Layer 1'.

Code: [Select]
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
    xprintf("%s%d%s\n", (record->event.pressed ? "P" : "R"), record->tap.count, (record->tap.interrupted ? "i" : ""));

    switch (id) {
        case STICKY_LAYER:
            if (record->event.pressed) {
                if (record->tap.count > 0) {
                    register_code(KC_SPACE);
                } else {
                }
            } else {
                if (record->tap.count > 0) {
                    unregister_code(KC_SPACE);
                } else {
                    layer_on(1);
                }
            }
            break;
    }
}

After reading up on the source code, I have unicode working, and all examples above.

I find myself wanting to experiment with tapping to change layers. I know you have "ACTION_LAYER_TAP_TOGGLE" for just that, but I want to be able to tap, say Space, quickly twice to switch to a layer, if you do not tap fast enough, or only once (some other key pressed afterwards) type Space as normal.
Title: Re: TMK USB to USB keyboard converter
Post by: qk6339zmdm on Fri, 29 April 2022, 23:29:49
The Anne Pro 2 model doesn't appear to work, attached is the debug output.
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Sat, 30 April 2022, 00:25:48
The Anne Pro 2 model doesn't appear to work, attached is the debug output.


what does USB-USB firmware show when the keyboard is plugged?
Title: Re: TMK USB to USB keyboard converter
Post by: qk6339zmdm on Sat, 30 April 2022, 06:38:01
Hi Hasu, if I understand you correctly here is the output, first when inserting the converter then the keyboard and with both:

Waiting for device:..........
Listening:

TMK:2ccdf7/LUFA:d6a7df/UHS2:e37ed6

USB configured.

Loop start.
usb_state: 12
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
host.Task: 2415
usb_state: A0

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

TMK:2ccdf7/LUFA:d6a7df/UHS2:e37ed6

USB configured.

Loop start.
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
host.Task: 2416
usb_state: A0
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Wed, 04 May 2022, 08:36:55
Thanks for the log.
It fails at somewhere in configuration process.

Could you try this debug firmware to get more info?
https://github.com/tmk/tmk_keyboard/blob/master/converter/usb_usb/binary/usb_usb_debug.hex
Title: Re: TMK USB to USB keyboard converter
Post by: qk6339zmdm on Wed, 04 May 2022, 12:58:09
Here are the results, Hasu:

Waiting for device:...
Listening:

TMK:ed7dfa/LUFA:d6a7df/UHS2:065e50

USB configured.

Loop start.
usb_state: 12
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
Ci read:0012
left:0000
vid:04D9
pid:A293
klass:00
subklass:00
AC1
AC2
A2 driver:00
BM Init
Ci read:0008
left:0000
Addr:01
Ci read:0012
left:0000
NC:01
HID_PROTOCOL_KEYBOARD
[gC]Ci read:0009
left:0000
Cl:007B
Ci [xE1][xE1][xE++]read:0040
left:003B
read:003B
left:0000
bNumEP:02
Cnf:01
bIfaceNum:00
bNumIface:00

Interface:00
crST:05
SetProto:05
Init:05
BUSRST
AttemptConfig2:05
Configuring:05
host.Task: 2422
usb_state: A0
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Wed, 04 May 2022, 21:07:06
The keyboard replies to SET_PROTOCOL request with STALL, it doesn't seem to support the rquest for no reason.

Try attached firmware to see if the keyboard works without the request. Posting debug log would be helpful again.

[attachurl=1]

Thanks
Title: Re: TMK USB to USB keyboard converter
Post by: qk6339zmdm on Wed, 04 May 2022, 22:55:58
Thanks Hasu, you're a wizard!  Here's the output, the keyboard is accepting input now.

Waiting for device:...
Listening:

TMK:6a5741/LUFA:d6a7df/UHS2:13078c

USB configured.

Loop start.
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
Ci read:0012
left:0000
vid:04D9
pid:A293
klass:00
subklass:00
AC1
AC2
A2 driver:00
BM Init
Ci read:0008
left:0000
Addr:01
Ci read:0012
left:0000
NC:01
HID_PROTOCOL_KEYBOARD
[gC]Ci read:0009
left:0000
Cl:007B
Ci [xE1][xE1][xE++]read:0040
left:003B
read:003B
left:0000
bNumEP:02
Cnf:01
bIfaceNum:00
bNumIface:00

Interface:00
crST:05
PROTOCOL SET HID_BOOT rcode:05
crST:05
SET_IDLE rcode:05
Ci read:0040
left:0040
read:000F
left:0031
RPIPE rcode:00
BM configured
Init:00
AttemptConfig2:00
Configuring:00
host.Task: 2323
usb_state: 90
speed: full
Co
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Thu, 05 May 2022, 00:35:05
Great.
Updated source code at github repository. Now you can download new firmware from Keymap Editor.
Title: Re: TMK USB to USB keyboard converter
Post by: qk6339zmdm on Thu, 05 May 2022, 09:36:22
Thanks again Hasu!  Your updated firmware works!
Title: Re: TMK USB to USB keyboard converter
Post by: antony on Wed, 25 May 2022, 13:14:18
i use a computer that only accept a German keyboard! And I can't change to my favorite one, US ASCCI or ISO International  After a year I am getting better at using DE keyboard.  Still it feels slowing me down. I  use vim, screen, tmux all day, think of  [], {} with  the Alt Gr combinations. 
So I would like build a hardware keyboard mapping translator. Would TMK be able translate from a English keyboard to a German keyboard? Is there a TMK firmware or an examples of mapping a layout to a German keyboard layout?
Any pointers before I order the hardware?
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Thu, 26 May 2022, 23:21:10
This is not trivial and you have to write C code to implement it.

You mean that you cannot change 'keyboard layout' setting on the computer and it is German, right?
Layout of your 'physical' keyboard is not that matter here, but let's assume it is US ASCII for sake of simplicity.


For example, when you press '[' on your US keyboard you will get 'ü' by default but you want to get '[' here.
To get '[' char on the computer the keyboard(conveter) have to send scan code for 'RAlt + 8'.
This can be done with `ACTION_MODS_KEY(MOD_RALT, KC_8)` relatively easily. See line 96 and 230.

And you want to get '{' char when pressing Shift + '[' on your US keyboard. This is more complex. The converter should send scan code for 'RAlt+9' but it have to cancel Shift before sending the code.
See line 146 and 240.

https://gist.github.com/tmk/70babc152e09f102396dc0a621c8d66a/332f76be59c95c9efc33bcfd9337f7de26ba9501

I implemented Default(0) and Shift(1) layer for trial, and it seems to work during my brief test on Linux. Note that keys tweaked with `CANCEL_*` function can't do key repeating.
Title: Re: TMK USB to USB keyboard converter
Post by: antony on Wed, 01 June 2022, 09:09:07
thanks hasu. C code should be fine me me. Your message to me sounds like I should be prepared for a lot of debugging. Can I attach TMK's console? I didn't read in depth yet.


I see the restriction, can't repeat some keys. It seems ok now. Special keys {},[] seems are not often repeated. And I am not 100% where that would be an issue. Repeating is most important for space bar, arrow keys, backspace, delete. I guess I will order some.

Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Thu, 02 June 2022, 02:23:52
Yes you can use hid_listen to to see debug prints. See this wiki page.

https://github.com/tmk/tmk_keyboard/wiki#hid_listen

You can use xprintf() to show values on debug console like below.

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

xprintf("key: %02X\n", key);

Refer to this for xprintf format string:
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/avr/xprintf.h#L62-L85


Title: Re: TMK USB to USB keyboard converter
Post by: qk6339zmdm on Mon, 13 June 2022, 17:07:59
Hello Hasu, the LTC NB681 Nimbleback also works with your converter.

https://ltcofficial.com/collections/keyboard/products/ltc-nb681-nimbleback-wired-65-layout-mechanical-keyboard-rgb-backlit-ultra-compact-68-keys-gaming-keyboard-with-hot-swappable-tactile-blue-red-brown-switch-and-stand-alone-arrow-control-keys-white
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Mon, 13 June 2022, 19:30:35
Thanks for your report!
Updated the list in the first post.
Title: Re: TMK USB to USB keyboard converter
Post by: ionflux on Thu, 30 June 2022, 12:14:15
Hi guys!
sorry for posting here, I'm a bit lost. What can I do if my keyboard is working with TMK but not with QMK?? it's a filco majestouch ninja. I bought it because I had success with filco majestouch 2 (the hasu converter experience was life changing!!), but it seems the ninja version is not working.
I would keep TMK instead, but I need KC_LSPO/KC_RSPC (the shift as parens thingie)
I have the debug output, but it's useless, right? since it's actually working with TMK....

Code: [Select]
> TMK:2dc680/LUFA:d6a7df/UHS2:3b1e03
>
> USB configured.
>
> Loop start.
> usb_state: 20
USB device connected (HidUsb): (Standard system devices) USB Input Device (FEED:005B:0815)
USB device connected (HidUsb): (Standard system devices) USB Input Device (FEED:005B:0815)
USB device connected (usbccgp): (Standard USB Host Controller) USB Composite Device (FEED:005B:0815)
> usb_state: 40
> usb_state: 50
> usb_state: 51
> BM Init
> Addr:01
> NC:01
> HID_PROTOCOL_KEYBOARD
> bNumEP:02
> Cnf:01
> bIfaceNum:00
> bNumIface:00
>
> Interface:00
> PROTOCOL SET HID_BOOT rcode:00
> SET_IDLE rcode:00
> RPIPE rcode:00
> BM configured
> host.Task: 2317
> usb_state: 90
> speed: full


Many thanks in advance for any suggestions...

Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Thu, 30 June 2022, 20:46:41
ionflux,
This is my implementation of steve losh's Shift Parentheses.
I don't know how QMK does this internally, you may want to looking into their codes.

You can disscuss its details there.

https://github.com/tmk/tmk_keyboard/discussions/744
Title: Re: TMK USB to USB keyboard converter
Post by: ionflux on Fri, 01 July 2022, 02:16:44
Many Thanks for this hasu !! I'll try it !!
it's weird because i thought i almost got it with the TMK online editor, except i could sort of do it with the brackets, but not the parens :(
anyway, this looks like it's exactly what I need.
Title: Re: TMK USB to USB keyboard converter
Post by: Fabrice on Sun, 10 July 2022, 02:28:52
Hi guys,

I compiled the usb_usb using the command make and I was able to upload the usb_usb.hex file into my "pro micro 5v 16mhz". Then I plugged my "pro micro" in my laptop and it recognizes it as a keyboard => OK :)

Then I compiled using the command "make -f Makefile.8mhz" for my "pro micro 3.3v 8mhz" and I get an error :

Code: [Select]
-------- begin --------
avr-gcc (GCC) 5.4.0
Copyright (C) 2015 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.

Linking: usb_usb.elf
avr-gcc -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=8000000UL -DBOOTLOADER_SIZE=4096 -DTMK_USB_HOST_SHIELD_VERSION=3b1e03 -DARDUINO=1813 -DTMK_LUFA_VERSION=d6a7df -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DUNIMAP_ENABLE -DACTIONMAP_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DKEYMAP_SECTION_ENABLE -DTMK_VERSION=4923f0 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=usb_usb.elf -I../../tmk_core/common -I. -I../../tmk_core -I../../tmk_core/protocol/usb_hid -I../../tmk_core/protocol/usb_hid/USB_Host_Shield_2.0-tmk -I../../tmk_core/protocol/usb_hid/arduino-1.8.13/cores/arduino -I../../tmk_core/protocol/usb_hid/arduino-1.8.13/variants/leonardo -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/lufa-abcminiuser -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/usb_usb.elf.d   obj_usb_usb/unimap.o obj_usb_usb/usb_usb.cpp.o obj_usb_usb/protocol/usb_hid/parser.cpp.o obj_usb_usb/protocol/usb_hid/override_Serial.cpp.o obj_usb_usb/protocol/usb_hid/override_wiring.o obj_usb_usb/common/avr/timer.o obj_usb_usb/protocol/usb_hid/USB_Host_Shield_2.0-tmk/Usb.cpp.o obj_usb_usb/protocol/usb_hid/USB_Host_Shield_2.0-tmk/usbhid.cpp.o obj_usb_usb/protocol/usb_hid/USB_Host_Shield_2.0-tmk/usbhub.cpp.o obj_usb_usb/protocol/usb_hid/USB_Host_Shield_2.0-tmk/parsetools.cpp.o obj_usb_usb/protocol/usb_hid/USB_Host_Shield_2.0-tmk/message.cpp.o obj_usb_usb/protocol/usb_hid/arduino-1.8.13/cores/arduino/abi.cpp.o obj_usb_usb/protocol/usb_hid/arduino-1.8.13/cores/arduino/Print.cpp.o obj_usb_usb/protocol/usb_hid/arduino-1.8.13/cores/arduino/Stream.cpp.o obj_usb_usb/protocol/lufa/lufa.o obj_usb_usb/protocol/lufa/descriptor.o obj_usb_usb/protocol/lufa/lufa-abcminiuser/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.o obj_usb_usb/protocol/lufa/lufa-abcminiuser/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.o obj_usb_usb/protocol/lufa/lufa-abcminiuser/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.o obj_usb_usb/protocol/lufa/lufa-abcminiuser/LUFA/Drivers/USB/Core/DeviceStandardReq.o obj_usb_usb/protocol/lufa/lufa-abcminiuser/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.o obj_usb_usb/protocol/lufa/lufa-abcminiuser/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.o obj_usb_usb/protocol/lufa/lufa-abcminiuser/LUFA/Drivers/USB/Core/ConfigDescriptors.o obj_usb_usb/protocol/lufa/lufa-abcminiuser/LUFA/Drivers/USB/Core/Events.o obj_usb_usb/protocol/lufa/lufa-abcminiuser/LUFA/Drivers/USB/Core/USBTask.o obj_usb_usb/protocol/lufa/lufa-abcminiuser/LUFA/Drivers/USB/Class/Common/HIDParser.o obj_usb_usb/common/host.o obj_usb_usb/common/keyboard.o obj_usb_usb/common/matrix.o obj_usb_usb/common/action.o obj_usb_usb/common/action_tapping.o obj_usb_usb/common/action_macro.o obj_usb_usb/common/action_layer.o obj_usb_usb/common/action_util.o obj_usb_usb/common/print.o obj_usb_usb/common/debug.o obj_usb_usb/common/util.o obj_usb_usb/common/hook.o obj_usb_usb/common/avr/suspend.o obj_usb_usb/common/avr/xprintf.o obj_usb_usb/common/avr/bootloader.o obj_usb_usb/common/unimap.o obj_usb_usb/common/mousekey.o --output usb_usb.elf -Wl,-Map=usb_usb.map,--cref -Wl,--gc-sections     -lm -Wl,-L../../tmk_core,-Tldscript_keymap_avr5.x
/usr/lib/gcc/avr/5.4.0/../../../avr/bin/ld: section .keymap loaded at [0000000000006800,00000000000069ff] overlaps section .data loaded at [00000000000067ac,0000000000006847]
collect2: error: ld returned 1 exit status
make: *** [../../tmk_core/rules.mk:552: usb_usb.elf] Error 1


The content of the file Makefile.8mhz :

Code: [Select]
F_CPU = 8000000
F_USB = 16000000
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
include Makefile

So, commenting the lines "KEYMAP_SECTION_ENABLE" and "UNIMAP_ENABLE",  I am able to compile. So I uploaded the hex file into my "pro micro 3.3v 8mhz". But when I plug it into my laptop, it returns "Unknown device ..." =>  NOK  :(
I tried on 2 different "pro micro 3.3v 8mhz", so I assume that it is not a hardware issue.

Any idea ?

Thanks for your help :)

Fabrice
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Mon, 11 July 2022, 21:15:45
Your firmware build runs out of flash space.

Code: [Select]
/usr/lib/gcc/avr/5.4.0/../../../avr/bin/ld: section .keymap loaded at [0000000000006800,00000000000069ff] overlaps section .data loaded at [00000000000067ac,0000000000006847]


You will have to make firmware smaller in some way

1) Give up some feature and disable build options in Makefile.

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


2) Or try other version of GCC. I confirmed that default 'Makefile.8mhz' firmware can be compiled with  7.3.0.

Code: [Select]
$ avr-gcc --version
avr-gcc (AVR_8_bit_GNU_Toolchain_3.7.0_1796) 7.3.0
[code]
Title: Re: TMK USB to USB keyboard converter
Post by: Fabrice on Fri, 15 July 2022, 04:26:21
Thanks Hasu, it works !

I updated my avr-gcc from 5.4.0 to 12.1.0 and set MOUSEKEY_ENABLE to no.
So it compiled.
But once uploaded into my "pro micro 3.3v 8mhz", it is seen as "unknown device" when my "pro micro 5.5v 16 mhz" works.
This is another issue I have to investiguate.

Thanks again for your help !

Fabrice
Title: Re: TMK USB to USB keyboard converter
Post by: nahuel on Wed, 17 August 2022, 09:10:57
I'm evaluating using this converter with the Tex Shinobi Keyboard. This keyboard has a trackpoint in it. Is Hasu compatible? I doubt if the mouse events coming from the trackpoint will be passed to the PC.
Title: Tapping term question
Post by: Lucky_Marsupial on Fri, 02 September 2022, 21:02:52
I have a converter working with my keyboard. I'm trying to use home row modifiers, which I was using successfully before with an Atreus, but I got the converter so I could try home row modifiers with my Unicomp buckling spring. They are not working well, and I want to adjust the tapping term as described here: https://github.com/tmk/tmk_keyboard/wiki/FAQ-Keymap#tap-keydual-role-key-doesnt-work-for-me The problem is that I am really out of my depth on most keyboard things (think old man / non-programmer / Win 10 / MS Office user) and I am programming the layout using the TMK Keymap Editor page to create the hex file. I don't see a place to adjust the tapping term there, and I can't imagine figuring out how to compile the hex file from a text file layout. Is it possible to increase the tapping term using the editor web site? Or is it actually easy to create the hex file on my Win 10 machine without installing a Linux VM or doing lots of command line stuff? Or am I just out of luck? Thanks for any help.
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Fri, 02 September 2022, 22:26:40
I have a converter working with my keyboard. I'm trying to use home row modifiers, which I was using successfully before with an Atreus, but I got the converter so I could try home row modifiers with my Unicomp buckling spring. They are not working well, and I want to adjust the tapping term as described here: https://github.com/tmk/tmk_keyboard/wiki/FAQ-Keymap#tap-keydual-role-key-doesnt-work-for-me The problem is that I am really out of my depth on most keyboard things (think old man / non-programmer / Win 10 / MS Office user) and I am programming the layout using the TMK Keymap Editor page to create the hex file. I don't see a place to adjust the tapping term there, and I can't imagine figuring out how to compile the hex file from a text file layout. Is it possible to increase the tapping term using the editor web site? Or is it actually easy to create the hex file on my Win 10 machine without installing a Linux VM or doing lots of command line stuff? Or am I just out of luck? Thanks for any help.

I'll look into how to change the setting without recompilation when I have some time, but currently you have to build firmware yourself unfrotunately.

Installling VM looks to me the easisest way but other option for windows is 'Windows Subsystem for Linux'(WSL). But you can't avoid command line interface. I don't know much about and didn't try other options and possibilities myself.

See these for firmware build.
https://github.com/tmk/tmk_keyboard/wiki/Build-on-Ubuntu-On-Windows10
https://github.com/tmk/tmk_keyboard/wiki#build-on-windows
Title: Re: Tapping term question
Post by: suicidal_orange on Sat, 03 September 2022, 05:58:37
I've just compiled the default usb_usb firmaware with the tapping term change as it seemed like an easy way for Lucky_Marsupial to solve his problem but when I load it on the editor website the keymap is blank.  The keymap loads as expected for the shipped binary version though, so seems I'm doing something wrong?
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Sat, 03 September 2022, 10:32:35
I've just compiled the default usb_usb firmaware with the tapping term change as it seemed like an easy way for Lucky_Marsupial to solve his problem but when I load it on the editor website the keymap is blank.  The keymap loads as expected for the shipped binary version though, so seems I'm doing something wrong?

You can use make file 'Makefile.unimap' to make firmware compatible to the Keymap Editor.
Code: [Select]
$ make -f Makefile.unimap clean
$ make -f Makefile.unimap
Title: Re: TMK USB to USB keyboard converter
Post by: suicidal_orange on Sat, 03 September 2022, 10:44:25
Great!  So if Lucky_Marsupial loads the attached firmware then applies his(?) home row modifiers the tapping term change will still be in effect?  That's much easier than him setting up some way to compile :)
Title: Re: TMK USB to USB keyboard converter
Post by: Lucky_Marsupial on Tue, 06 September 2022, 18:42:25
@suicidal orange, thank you for trying!

Hasu, unfortunately I'm not going to be able to set up a VM or WSL for this—just seems beyond my skill set. But I'm wondering—since the website is somehow compiling the hex file on the backend, is there a way you could have a form on that page that would allow users to add variable settings like tapping term that would overwrite the defaults, and the site could just check for those before compiling? I really don't know how the compiling aspect works, but if I can define keymaps on the website, then maybe it could let users define some variable settings also? Or (and I know this is more work for you) there could be an optional section that lists all of the variable settings in the default and lets users edit them before downloading a compiled version? You could even start by just doing this for tapping term and any other settings that are commonly requested to change.

Lastly, "load keymap from firmware" after uploading a hex file is not working for me and "Keyboard output for debug" is always blank (I assume it is supposed to show something when you have the cursor in the box and type something). This is on Win 10 and Firefox 104. Any ideas on what to try to load the keymap? What is the keyboard output supposed to do/show?

Thanks for the help!
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Wed, 07 September 2022, 20:35:17
Keymap Editor doesn't compile firmware on line, it just replaces keymap portion in prebuilt firmware.
It is difficult or impossible to change the setting on current Keymap Editor.


I think "load keymap from firmware" should work with 'Unimap' firmware somewhat. Default prebuilt firmwares available on Keymap Editor or github are buillt as Unimap firmware by me.
Where does your firmware come from? (TMK firmware can be compilied with 8-bit 'keymap' and actionmap, in addition to unimap.)

And can you describe in detail about "after uploading a hex file is not working"? Screenshots of Keymap Editor would be helpful for me to understand the issue.

And you can upload your hex fire here or other place so that I can try it on Keymap Editor.

Title: Re: TMK USB to USB keyboard converter
Post by: Lucky_Marsupial on Thu, 08 September 2022, 18:41:07
I think "load keymap from firmware" should work with 'Unimap' firmware somewhat. Default prebuilt firmwares available on Keymap Editor or github are buillt as Unimap firmware by me.
Where does your firmware come from? (TMK firmware can be compilied with 8-bit 'keymap' and actionmap, in addition to unimap.)

Sorry if I am not following, but I am using the USB to USB converter. I didn't try to load firmware specific to my keyboard, because I thought that was only for keyboards that had the ability to be programmed directly. I just plug my keyboard (Unicomp) into the converter. For the TMK hex file and keymap editor, I chose the usb-usb converter firmware. I don't know what "unimap" is even though I see it mentioned on the editor page.

And can you describe in detail about "after uploading a hex file is not working"? Screenshots of Keymap Editor would be helpful for me to understand the issue.

And you can upload your hex fire here or other place so that I can try it on Keymap Editor.

I use the Keymap editor, dowloaded a firmware hex file, and used it to flash my usb-usb converter successfully. Later I closed the browser and restarted the computer. I opened the Keymap editor page and selected the radio button "File" under "Base Firmware File". I chose the hex file that I downloaded earlier and clicked "Load keymap from firmware". I expected to see the keymap that I created earlier appear on the Keymap Editor webpage so I could change a few key mappings. But, the keymap that I see on the Editor is the default map that the usb-usb converter ships with, rather than the new layout I created and flashed to the converter.

I will attach the hex file here. Thanks for the help.

Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Thu, 08 September 2022, 19:30:53
Hi,
Yes, you are using correct firmware file. Firmware file that you attached is valid (unimap firmware) file for Keymap Editor.
I confirmed Keymap Editor loaded keymap from your firmware, see pictures below. I used Chrome(105) and Firefox(104) on ubuntu Linux to test it. In the pictures Chrome is shown on left and Firefox on right.

[attach=2] [attach=3]


Quote
I opened the Keymap editor page and selected the radio button "File" under "Base Firmware File". I chose the hex file that I downloaded earlier and clicked "Load keymap from firmware".
This seems to me be correct procedure to load keymap from your firmware file. And this is exactly what I did for the test.

[attach=1]

I don't know why this doesn't work on your site. This may be specific to Windows?


Title: Re: TMK USB to USB keyboard converter
Post by: Lucky_Marsupial on Thu, 08 September 2022, 20:09:39
Thanks for testing it. I was able to get it to work on Chrome (too many Firefox extensions perhaps).

Keymap Editor doesn't compile firmware on line, it just replaces keymap portion in prebuilt firmware.
It is difficult or impossible to change the setting on current Keymap Editor.

So the keymap doesn't need to be compiled, but the tap time setting does? And the keymap can be replaced in prebuilt firmware, but the tap time setting cannot? Is that right?
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Thu, 08 September 2022, 22:15:51
Right. 'Tapping Term' value is embeded in core system and needs compilation of its source codes. Keymap is simple data(array of key action code) and can be replaced easily even after the compilation.




Quote
I have a converter working with my keyboard. I'm trying to use home row modifiers, which I was using successfully before with an Atreus, but I got the converter so I could try home row modifiers with my Unicomp buckling spring. They are not working well,

Can you describe more details about difference between TMK and Atreus implementation of 'tap key'?
And can you share your keymap of 'home row modifiers' so that I can test on my site?


TMK tap key was implemented heavily depending on my taste and fingering habits. I'm a slow typist(50wpm) and don't type so much day to day. I mean, TMK tap key doesn't suit for you even with changing Tapping Term, perhaps.

There is other (hard-coded)parameters of tap key implementation and I can improve hopefully.



Title: Re: TMK USB to USB keyboard converter
Post by: suicidal_orange on Fri, 09 September 2022, 04:12:00
@Lucky_Marsuipial - have you confirmed if it's a timing issue or something else?  Easiest way is probably to change the modifier to a different letter so you can see which types when you double tap at your normal speed.  I've attached two more hexes with tapping term of 100 and 500, maybe one of them will work better?
Title: Re: TMK USB to USB keyboard converter
Post by: Lucky_Marsupial on Sun, 11 September 2022, 20:18:19
I'm not sure exactly why the Atreus worked for me and TMK currently isn't. The TMK problem is that I am constantly having keys act as modifiers when I intend to just tap (type) them. With the Atreus, I was able to slightly alter my typing to hold down the home row keys for shorter periods when typing, and that solved the problem. I am wondering if the TMK issue is that the setting for IGNORE_MOD_TAP_INTERRUPT is not active in my firmware. According to the page https://precondition.github.io/home-row-mods, that setting not being on causes similar problems—accidental activation of the mod key when the 1st key is not released until after the 2nd key is pressed. Does TMK include this option?

I am ok with pausing my normal typing style to hold the tap/mod key a bit longer to make it a mod, and then deliberately tap the 2nd key that I want to combine with the mod, if that will help. In other words, I am ok acting more like a hunt-and-peck typist when using the tap/hold keys as mods to invoke keyboard shortcuts. I just need to avoid them acting as mods when I don't want them to, when typing normal text.

I don't care about the ability to hold down a key and get a bunch of them auto-typed (like holding to produce "aaaaaaaaaa"). I'm willing to lose that ability to get home row mods.

Despite my ignorance of the low-level parts of this, I think I can understand the explanations on the "home row mods" webpage linked above, so feel free to ask about things referenced there in helping me troubleshoot. Thanks again for your help!
Title: Re: TMK USB to USB keyboard converter
Post by: Lucky_Marsupial on Sun, 18 September 2022, 18:42:32
@hasu, I know this isn't an easy fix, so I'm just curious if IGNORE_MOD_TAP_INTERRUPT is implemented in TMK and is ON by default? If not, would you recommend that if I want to try home row mods that I attempt to use QMK with the usb-usb converter instead? I assume that the process is pretty similar—use the web config page, download a file, flash it to the converter—is that right? I know you maintain TMK and not QMK but I would like to try to move forward on this issue in some way if I can. Thanks!
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Tue, 20 September 2022, 01:51:58
TMK doesn't has the option and I'm not sure how it works.
Yes, try QMK and let me know your result. I don't know much about QMK firmware, you better consult its documents. I believe that you can't mess up your converter with trying QMK.
Title: Re: TMK USB to USB keyboard converter
Post by: apastuszak on Wed, 12 October 2022, 19:49:46
1upkeyboards is out of stock on these.  Any idea when they'll be getting more in?
Title: Re: TMK USB to USB keyboard converter
Post by: KHAANNN on Fri, 16 December 2022, 02:51:54
I had to erase and reprogram my usb_usb converter today, for some reason it was recognized, it powered the keyboard, yet it didn't deliver any keystrokes before I reprogrammed - luckily I had the commands logged in a file:

dfu-programmer atmega32u4 erase --force
dfu-programmer atmega32u4 flash usb_usb.hex --force --debug 99999

Interesting event, and small chance it could be because I left the device with a faulty firmware (its connected to my tactile endgame, so shame on me if I did)
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Tue, 24 January 2023, 22:56:45
Just updated source code repository and default firmware on Keymap Editor.

Apple Magic Keyboard First gen.(A1644/A1843) is supported by default firmware now.

 https://github.com/tmk/tmk_keyboard/commit/8fd2ba90e7f3bf87b2b634e5b9bd990ff89f42f2
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Tue, 31 January 2023, 19:52:39
Just updated firmware for Ducky One 2 Mini(DKON2061ST / DKME2061ST).

https://github.com/tmk/tmk_keyboard/issues/697
Title: Re: TMK USB to USB keyboard converter
Post by: Ko$tello on Tue, 04 July 2023, 01:56:04
Hi Hasu,

I recently got a converter from you and it works fine with my quite old "A4Tech KV-300H" keyboard. So, please add it to the list of compatible keyboards.

I also tried to make it work with Rapoo 9300M. This is a wireless keyboard and it doesn't work, so I followed your troubleshooting steps:

Debug Output:
Code: [Select]
Waiting for device:
Listening:
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
Ci read:0012
left:0000
vid:24AE
pid:2013
klass:00
subklass:00
AC1
AC2
A2 driver:00
BM Init
Ci read:0008
left:0000
Addr:01
Ci read:0012
left:0000
NC:01
HID_PROTOCOL_KEYBOARD
[gC]Ci read:0009
left:0000
Cl:0054
Ci [xE1][xE++]read:0040
left:0014
[xE1]read:0014
left:0000
bNumEP:02
Cnf:01
bIfaceNum:01
bNumIface:00

Interface:01
SET_PROTOCOL: 00
SET_IDLE: 00
Ci read:0040
left:0040
read:001E
left:0022
RPIPE: 00
BM configured
Init:00
AttemptConfig2:00
Configuring:00
host.Task: 2325
usb_state: 90
speed: full
Co

USB Descriptor Data:
Code: [Select]
Waiting for device:
Listening:
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
usb_state: 90

//////////////////////////////////////////////////////////////////////
// USB_desc_dump
// Address: 01
// Lowspeed: 00

// Devicer dump:
12 01 00 02 00 00 00 40 AE 24 13 20 10 01 01 02
00 01

// Device:
bLength:                12
bDescriptorType:        01
bcdUSB:                 0200
bDeviceClass:           00
bDeviceSubClass:        00
bDeviceProtocol:        00
bMaxPacketSize0:        40
idVendor:               24AE
idProduct:              2013
bcdDevice:              0110
iManufacturer:          01
iProduct:               02
iSerialNumber:          00
bNumConfigurations:     01

// String Zero: len: 04
// 04 03 09 04
// LangId: 0409

// iManufacturer: String1(0409): len: 0C
// 0C 03 52 00 41 00 50 00 4F 00 4F 00
// RAPOO

// iProduct: String2(0409): len: 36
// 36 03 52 00 61 00 70 00 6F 00 6F 00 20 00 32 00
// 2E 00 34 00 47 00 20 00 57 00 69 00 72 00 65 00
// 6C 00 65 00 73 00 73 00 20 00 44 00 65 00 76 00
// 69 00 63 00 65 00
// Rapoo 2.4G Wireless Device

// Config0 dump:        len: 0054
09 02 54 00 03 01 00 A0 32 09 04 00 00 01 03 01
02 00 09 21 10 01 00 01 22 40 00 07 05 81 03 40
00 0A 09 04 01 00 01 03 01 01 00 09 21 10 01 00
01 22 5E 00 07 05 82 03 40 00 0A 09 04 02 00 01
03 01 01 00 09 21 10 01 00 01 22 40 00 07 05 83
03 40 00 0A

// Config:
bLength:                09
bDescriptorType:        02
wTotalLength:           0054
bNumInterfaces:         03
bConfigurationValue:    01
iConfiguration:         00
bmAttributes:           A0
bMaxPower:              32

// Interface0.0:
bLength:                09
bDescriptorType:        04
bInterfaceNumber:       00
bAlternateSetting:      00
bNumEndpoints:          01
bInterfaceClass:        03
bInterfaceSubClass:     01
bInterfaceProtocol:     02
iInterface:             00

// HID:
bLength:                09
bDescriptorType:        21
bcdHID:                 0110
bCountryCode:           00
bNumDescriptors:        01
bDescrType:             22
wDescriptorLength:      0040

// Report0 dump:        len: 0040
05 01 09 02 A1 01 09 01 A1 00 05 09 19 01 29 05
15 00 25 01 95 05 75 01 81 02 95 01 75 03 81 03
05 01 09 30 09 31 16 01 80 26 FF 7F 75 10 95 02
81 06 09 38 15 81 25 7F 75 08 95 01 81 06 C0 C0

// Endpoint:
bLength:                07
bDescriptorType:        05
bEndpointAddress:       81
bmAttributes:           03
wMaxPacketSize:         0040
bInterval:              0A

// Interface1.0:
bLength:                09
bDescriptorType:        04
bInterfaceNumber:       01
bAlternateSetting:      00
bNumEndpoints:          01
bInterfaceClass:        03
bInterfaceSubClass:     01
bInterfaceProtocol:     01
iInterface:             00

// HID:
bLength:                09
bDescriptorType:        21
bcdHID:                 0110
bCountryCode:           00
bNumDescriptors:        01
bDescrType:             22
wDescriptorLength:      005E

// Report0 dump:        len: 005E
06 00 FF 09 0E A1 01 85 BA 95 1F 75 08 26 FF 00
15 00 09 01 91 02 85 BA 95 1F 75 08 26 FF 00 15
00 09 01 81 02 C0 05 01 09 80 A1 01 85 02 05 01
19 81 29 83 15 00 25 01 95 03 75 01 81 06 95 01
75 05 81 01 C0 05 0C 09 01 A1 01 85 03 15 00 26
80 03 19 00 2A 80 03 75 10 95 01 81 00 C0

// Endpoint:
bLength:                07
bDescriptorType:        05
bEndpointAddress:       82
bmAttributes:           03
wMaxPacketSize:         0040
bInterval:              0A

// Interface2.0:
bLength:                09
bDescriptorType:        04
bInterfaceNumber:       02
bAlternateSetting:      00
bNumEndpoints:          01
bInterfaceClass:        03
bInterfaceSubClass:     01
bInterfaceProtocol:     01
iInterface:             00

// HID:
bLength:                09
bDescriptorType:        21
bcdHID:                 0110
bCountryCode:           00
bNumDescriptors:        01
bDescrType:             22
wDescriptorLength:      0040

// Report0 dump:        len: 0040
05 01 09 06 A1 01 05 07 19 E0 29 E7 15 00 25 01
75 01 95 08 81 02 95 01 75 08 81 03 95 05 75 01
05 08 19 01 29 05 91 02 95 01 75 03 91 03 95 06
75 08 15 00 26 FF 00 05 07 19 00 29 FF 81 00 C0

// Endpoint:
bLength:                07
bDescriptorType:        05
bEndpointAddress:       83
bmAttributes:           03
wMaxPacketSize:         0040
bInterval:              0A

// Parse data here: http://eleccelerator.com/usbdescreqparser/

I was wondering if it's possible to make it work.
Any help would be highly appreciated.
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Tue, 04 July 2023, 22:48:34
Thanks for your report.

Rapoo 9300M has two boot keyboard interfaces, that is irregular case, methink. The second one is what we need to handle.
USB descriptor:
https://gist.github.com/tmk/20e2a574dc45ce7789b93e15e9ca9eb6?permalink_comment_id=4619261#gistcomment-4619261

But current revision of USB-USB converter can handle the first inteface only. I'll let you know if I can fixed this limitation.

I also filed the issue on github.
https://github.com/tmk/tmk_keyboard/issues/764
Title: Re: TMK USB to USB keyboard converter
Post by: Ko$tello on Wed, 05 July 2023, 18:45:47
Thanks a lot Hasu!
Hopefully, you can address this issue.
I really like your product and was hoping to deploy it on all PCs in our office.
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Wed, 05 July 2023, 19:47:59
Ko$tello,
Can you try multimedia keys(Fn+[F1-F12]) with the debug firmware?
The converter does not handle them correctly but shows something on debug console, perhaps.
Title: Re: TMK USB to USB keyboard converter
Post by: Ko$tello on Wed, 05 July 2023, 20:47:24
Thanks for your prompt reply, Hasu!
I tried Fn+[F1-F12] in debug mode and it catches some input. Please see it below.
It works kind of unstable though. Sometimes it sees the input, others it doesn't.

Code: [Select]
Waiting for device:
Listening:
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
Ci read:0012
left:0000
vid:24AE
pid:2013
klass:00
subklass:00
AC1
AC2
A2 driver:00
BM Init
Ci read:0008
left:0000
Addr:01
Ci read:0012
left:0000
NC:01
HID_PROTOCOL_KEYBOARD
[gC]Ci read:0009
left:0000
Cl:0054
Ci [xE1][xE++]read:0040
left:0014
[xE1]read:0014
left:0000
bNumEP:02
Cnf:01
bIfaceNum:01
bNumIface:00

Interface:01
SET_PROTOCOL: 00
SET_IDLE: 00
Ci read:0040
left:0040
read:001E
left:0022
RPIPE: 00
BM configured
Init:00
AttemptConfig2:00
Configuring:00
host.Task: 2325
usb_state: 90
speed: full
Co input 1: 03 30 03
03 30 03
input 1: 03 00 00
03 00 00
input 1: 03 24 02
03 24 02
input 1: 03 00 00
03 00 00
input 1: 03 25 02
03 25 02
input 1: 03 00 00
03 00 00
input 1: 03 23 02
03 23 02
input 1: 03 00 00
03 00 00
input 1: 03 8A 01
Rollover error: ignored
03 8A 01
input 1: 03 00 00
03 00 00

Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Sun, 09 July 2023, 03:46:56
Ko$tello,
Can you try attached firmware and post its debug log?

The Rapoo USB dongle seems to be designed maily for mouse and it looks weird for a keyboard.

[attachmini=1]
Title: Re: TMK USB to USB keyboard converter
Post by: Ko$tello on Fri, 14 July 2023, 00:53:25
Hi Hasu,

Sorry for the late reply. This week has been a bit hectic.
I tried usb_usb_debug.hex you provided, please see the output below.
Windows has some issues recognising USB dongle with this firmware and didn't work every time.
The keyboard also doesn't respond to Fn+[F1-F12].
Code: [Select]
Waiting for device:....
Listening:

TMK:002537/LUFA:d6a7df/UHS2:c2a2bb

USB configured.

Loop start.
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
bNumEP:03
Cnf:01
bIfaceNum:02
bNumIface:00

Interface:01
SET_PROTOCOL: 00
SET_IDLE: 00
RPIPE: 00

Interface:02
SET_PROTOCOL: 00
SET_IDLE: 00
RPIPE: 00
BM configured
host.Task: 2322
usb_state: 90
speed: fu
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Sun, 16 July 2023, 02:20:45
Thanks for testing.

I found a bug and fixed. Try this one.

[attachurl=1]

Title: Re: TMK USB to USB keyboard converter
Post by: Ko$tello on Sun, 16 July 2023, 16:25:11
Hi Hasu,
I tested the latest debug firmware and it seems to be working fine. Please see the output below.

Would you be able to create hex files with F24, F23 and F22 hooks, with and without modifiers that work with this keyboard?
Your help on this would be highly appreciated 🙏

Code: [Select]
Waiting for device:
Listening:
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
bNumEP:03
Cnf:01
bIfaceNum:02
bNumIface:00

Interface:01
SET_PROTOCOL: 00
SET_IDLE: 00
RPIPE: 00

Interface:02
SET_PROTOCOL: 00
SET_IDLE: 00
RPIPE: 00
BM configured
host.Task: 2322
usb_state: 90
speed: full
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 29 00 00 00 00 00
00 00 29 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 3A 00 00 00 00 00
00 00 3A 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 3B 00 00 00 00 00
00 00 3B 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 3C 00 00 00 00 00
00 00 3C 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 3D 00 00 00 00 00
00 00 3D 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 3E 00 00 00 00 00
00 00 3E 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 3F 00 00 00 00 00
00 00 3F 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 40 00 00 00 00 00
00 00 40 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 41 00 00 00 00 00
00 00 41 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 42 00 00 00 00 00
00 00 42 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 43 00 00 00 00 00
00 00 43 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 44 00 00 00 00 00
00 00 44 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 44 00 00 00 00 00
00 00 44 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 45 00 00 00 00 00
00 00 45 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 46 00 00 00 00 00
00 00 46 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 49 00 00 00 00 00
00 00 49 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 4C 00 00 00 00 00
00 00 4C 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 4C 00 00 00 00 00
00 00 4C 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 53 00 00 00 00 00
00 00 53 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 57 00 00 00 00 00
00 00 57 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 58 00 00 00 00 00
00 00 58 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 35 00 00 00 00 00
00 00 35 00 00 00 00 00
input 1: 00 00 1E 00 00 00 00 00
00 00 1E 00 00 00 00 00
input 1: 00 00 1F 00 00 00 00 00
00 00 1F 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 20 00 00 00 00 00
00 00 20 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 21 00 00 00 00 00
00 00 21 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 22 00 00 00 00 00
00 00 22 00 00 00 00 00
input 1: 00 00 23 00 00 00 00 00
00 00 23 00 00 00 00 00
input 1: 00 00 24 00 00 00 00 00
00 00 24 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 25 00 00 00 00 00
00 00 25 00 00 00 00 00
input 1: 00 00 26 00 00 00 00 00
00 00 26 00 00 00 00 00
input 1: 00 00 26 27 00 00 00 00
00 00 26 27 00 00 00 00
input 1: 00 00 27 00 00 00 00 00
00 00 27 00 00 00 00 00
input 1: 00 00 2D 00 00 00 00 00
00 00 2D 00 00 00 00 00
input 1: 00 00 2E 00 00 00 00 00
00 00 2E 00 00 00 00 00
input 1: 00 00 2E 2A 00 00 00 00
00 00 2E 2A 00 00 00 00
input 1: 00 00 2A 00 00 00 00 00
00 00 2A 00 00 00 00 00
input 1: 00 00 2A 54 00 00 00 00
00 00 2A 54 00 00 00 00
input 1: 00 00 54 00 00 00 00 00
00 00 54 00 00 00 00 00
input 1: 00 00 54 55 00 00 00 00
00 00 54 55 00 00 00 00
input 1: 00 00 55 00 00 00 00 00
00 00 55 00 00 00 00 00
input 1: 00 00 55 56 00 00 00 00
00 00 55 56 00 00 00 00
input 1: 00 00 56 00 00 00 00 00
00 00 56 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 2B 00 00 00 00 00
00 00 2B 00 00 00 00 00
input 1: 00 00 14 00 00 00 00 00
00 00 14 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 1A 00 00 00 00 00
00 00 1A 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 08 00 00 00 00 00
00 00 08 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 15 00 00 00 00 00
00 00 15 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 17 00 00 00 00 00
00 00 17 00 00 00 00 00
input 1: 00 00 1C 00 00 00 00 00
00 00 1C 00 00 00 00 00
input 1: 00 00 18 00 00 00 00 00
00 00 18 00 00 00 00 00
input 1: 00 00 0C 00 00 00 00 00
00 00 0C 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 12 00 00 00 00 00
00 00 12 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 13 00 00 00 00 00
00 00 13 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 2F 00 00 00 00 00
00 00 2F 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 30 00 00 00 00 00
00 00 30 00 00 00 00 00
input 1: 00 00 30 28 00 00 00 00
00 00 30 28 00 00 00 00
input 1: 00 00 28 00 00 00 00 00
00 00 28 00 00 00 00 00
input 1: 00 00 28 5F 00 00 00 00
00 00 28 5F 00 00 00 00
input 1: 00 00 5F 00 00 00 00 00
00 00 5F 00 00 00 00 00
input 1: 00 00 5F 60 00 00 00 00
00 00 5F 60 00 00 00 00
input 1: 00 00 60 00 00 00 00 00
00 00 60 00 00 00 00 00
input 1: 00 00 61 00 00 00 00 00
00 00 61 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 39 00 00 00 00 00
00 00 39 00 00 00 00 00
input 1: 00 00 39 04 00 00 00 00
00 00 39 04 00 00 00 00
input 1: 00 00 04 00 00 00 00 00
00 00 04 00 00 00 00 00
input 1: 00 00 16 00 00 00 00 00
00 00 16 00 00 00 00 00
input 1: 00 00 16 07 00 00 00 00
00 00 16 07 00 00 00 00
input 1: 00 00 07 00 00 00 00 00
00 00 07 00 00 00 00 00
input 1: 00 00 07 09 00 00 00 00
00 00 07 09 00 00 00 00
input 1: 00 00 09 00 00 00 00 00
00 00 09 00 00 00 00 00
input 1: 00 00 09 0A 00 00 00 00
00 00 09 0A 00 00 00 00
input 1: 00 00 0A 00 00 00 00 00
00 00 0A 00 00 00 00 00
input 1: 00 00 0A 0B 00 00 00 00
00 00 0A 0B 00 00 00 00
input 1: 00 00 0B 00 00 00 00 00
00 00 0B 00 00 00 00 00
input 1: 00 00 0D 00 00 00 00 00
00 00 0D 00 00 00 00 00
input 1: 00 00 0D 0E 00 00 00 00
00 00 0D 0E 00 00 00 00
input 1: 00 00 0E 00 00 00 00 00
00 00 0E 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 0F 00 00 00 00 00
00 00 0F 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 33 00 00 00 00 00
00 00 33 00 00 00 00 00
input 1: 00 00 34 00 00 00 00 00
00 00 34 00 00 00 00 00
input 1: 00 00 31 00 00 00 00 00
00 00 31 00 00 00 00 00
input 1: 00 00 28 00 00 00 00 00
00 00 28 00 00 00 00 00
input 1: 00 00 28 5C 00 00 00 00
00 00 28 5C 00 00 00 00
input 1: 00 00 5C 00 00 00 00 00
00 00 5C 00 00 00 00 00
input 1: 00 00 5C 5D 00 00 00 00
00 00 5C 5D 00 00 00 00
input 1: 00 00 5D 00 00 00 00 00
00 00 5D 00 00 00 00 00
input 1: 00 00 5D 5E 00 00 00 00
00 00 5D 5E 00 00 00 00
input 1: 00 00 5E 00 00 00 00 00
00 00 5E 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 02 00 00 00 00 00 00 00
02 00 00 00 00 00 00 00
input 1: 02 00 64 00 00 00 00 00
02 00 64 00 00 00 00 00
input 1: 00 00 64 00 00 00 00 00
00 00 64 00 00 00 00 00
input 1: 00 00 64 1D 00 00 00 00
00 00 64 1D 00 00 00 00
input 1: 00 00 1D 00 00 00 00 00
00 00 1D 00 00 00 00 00
input 1: 00 00 1D 1B 00 00 00 00
00 00 1D 1B 00 00 00 00
input 1: 00 00 1B 00 00 00 00 00
00 00 1B 00 00 00 00 00
input 1: 00 00 1B 06 00 00 00 00
00 00 1B 06 00 00 00 00
input 1: 00 00 06 00 00 00 00 00
00 00 06 00 00 00 00 00
input 1: 00 00 06 19 00 00 00 00
00 00 06 19 00 00 00 00
input 1: 00 00 19 00 00 00 00 00
00 00 19 00 00 00 00 00
input 1: 00 00 05 00 00 00 00 00
00 00 05 00 00 00 00 00
input 1: 00 00 05 11 00 00 00 00
00 00 05 11 00 00 00 00
input 1: 00 00 11 00 00 00 00 00
00 00 11 00 00 00 00 00
input 1: 00 00 11 10 00 00 00 00
00 00 11 10 00 00 00 00
input 1: 00 00 10 00 00 00 00 00
00 00 10 00 00 00 00 00
input 1: 00 00 10 36 00 00 00 00
00 00 10 36 00 00 00 00
input 1: 00 00 36 00 00 00 00 00
00 00 36 00 00 00 00 00
input 1: 00 00 36 37 00 00 00 00
00 00 36 37 00 00 00 00
input 1: 00 00 37 00 00 00 00 00
00 00 37 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 38 00 00 00 00 00
00 00 38 00 00 00 00 00
input 1: 20 00 38 00 00 00 00 00
20 00 38 00 00 00 00 00
input 1: 20 00 00 00 00 00 00 00
20 00 00 00 00 00 00 00
input 1: 20 00 52 00 00 00 00 00
20 00 52 00 00 00 00 00
input 1: 00 00 52 00 00 00 00 00
00 00 52 00 00 00 00 00
input 1: 00 00 59 00 00 00 00 00
00 00 59 00 00 00 00 00
input 1: 00 00 5A 00 00 00 00 00
00 00 5A 00 00 00 00 00
input 1: 00 00 5A 5B 00 00 00 00
00 00 5A 5B 00 00 00 00
input 1: 00 00 5B 00 00 00 00 00
00 00 5B 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 01 00 00 00 00 00 00 00
01 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
input 1: 08 00 00 00 00 00 00 00
08 00 00 00 00 00 00 00
input 1: 0C 00 00 00 00 00 00 00
0C 00 00 00 00 00 00 00
input 1: 04 00 00 00 00 00 00 00
04 00 00 00 00 00 00 00
input 1: 00 00 2C 00 00 00 00 00
00 00 2C 00 00 00 00 00
input 1: 40 00 2C 00 00 00 00 00
40 00 2C 00 00 00 00 00
input 1: 40 00 00 00 00 00 00 00
40 00 00 00 00 00 00 00
input 1: 40 00 65 00 00 00 00 00
40 00 65 00 00 00 00 00
input 1: 00 00 65 00 00 00 00 00
00 00 65 00 00 00 00 00
input 1: 10 00 65 00 00 00 00 00
10 00 65 00 00 00 00 00
input 1: 10 00 00 00 00 00 00 00
10 00 00 00 00 00 00 00
input 1: 10 00 50 00 00 00 00 00
10 00 50 00 00 00 00 00
input 1: 00 00 50 00 00 00 00 00
00 00 50 00 00 00 00 00
input 1: 00 00 51 00 00 00 00 00
00 00 51 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 4F 00 00 00 00 00
00 00 4F 00 00 00 00 00
input 1: 00 00 62 00 00 00 00 00
00 00 62 00 00 00 00 00
input 1: 00 00 62 63 00 00 00 00
00 00 62 63 00 00 00 00
input 1: 00 00 63 00 00 00 00 00
00 00 63 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Sun, 16 July 2023, 22:27:34
Just updated github repo and Keymap Editor.


You can get firmware compatible to TaranVH/2nd-keyboard F24-prefix here temporarily.
https://github.com/tmk/tmk_keyboard/tree/master/converter/usb_usb/binary

You can refer this code and build firmware for other versions if needed.
https://github.com/tmk/tmk_keyboard/blob/master/converter/usb_usb/unimap_TaranVH_F24.c

Thanks
Title: Re: TMK USB to USB keyboard converter
Post by: Ko$tello on Mon, 17 July 2023, 01:25:44
Thanks a lot for your help, Hasu.
I tried the firmware from your last post and it works  :thumb:
There are two keys that don't work: "Fn" and the second "\" located next to "Z" (for some reason this keyboard has two "\" keys)

I would definitely try to create F23 and F22 versions (with and without modifiers). Not sure if I'm capable of doing that ;D Taran's tutorial looked like a foreign language to me.
Anyway, thanks again. I will email you to order more converters.

P.S.
If someone is looking for a compact wireless marco keyboard at an affordable price, I highly recommend Rapoo 9300M. Build quality is great and you can buy it for $20 USD.
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Wed, 19 July 2023, 07:39:51
Thanks a lot for your help, Hasu.
I tried the firmware from your last post and it works  :thumb:
There are two keys that don't work: "Fn" and the second "\" located next to "Z" (for some reason this keyboard has two "\" keys)

This converter can't handle Fn key, see 'Limitation' section in the first post.


Post debug prints when the "\" key is pressed. And post pic of your keyboard, I can't find Rapoo 9300M with the key.

What's your keyboard layout on your computer? Try setting UK layout or any european layout.

Title: Re: TMK USB to USB keyboard converter
Post by: Ko$tello on Wed, 19 July 2023, 17:20:15
Thanks for your reply, Hasu.
Both "\" keys seem to be working fine with debug firmware. Please see the output below:
Code: [Select]
Waiting for device:....
Listening:

TMK:002537/LUFA:d6a7df/UHS2:8be20f

USB configured.

Loop start.
usb_state: 12
usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
bNumEP:03
Cnf:01
bIfaceNum:02
bNumIface:00

Interface:01
SET_PROTOCOL: 00
SET_IDLE: 00
RPIPE: 00

Interface:02
SET_PROTOCOL: 00
SET_IDLE: 00
RPIPE: 00
BM configured
host.Task: 2323
usb_state: 90
speed: full
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 31 00 00 00 00 00
00 00 31 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 64 00 00 00 00 00
00 00 64 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 31 00 00 00 00 00
00 00 31 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
input 1: 00 00 64 00 00 00 00 00
00 00 64 00 00 00 00 00
input 1: 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00

The issue appears when I use "usb_usb_unimap_TaranVH_F24.hex" and launch Taran's AHK script.
The right "\" key shows the tooltip, and the left one just sends "\". Please see the photo of the keyboard below.
I have two layouts on my PC: English(Australia) and Russian. I've been testing in English(Australia) layout.
[attach=1]
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Wed, 19 July 2023, 18:28:14
Yes, the keys works as expected in USB/HID level.

That keyboard layout looks strange to me.
I don't know much but it does not seem to be standard for Russian/Cyrillic layout. Does normal Russian keyboard have the keys?
(If you are Russian you should know)

The keys are specific to ISO keyboard layout and Russian is not ISO as far as know. https://en.wikipedia.org/wiki/Keyboard_layout#Physical_layouts
As said before you should use european layout like UK, German, French... English and Russian layout won't recognize the keys.

If you don't care original key behaviour you can remap the key to F13 and F14 for example.
https://github.com/tmk/tmk_keyboard/wiki/FAQ-Keymap-Editor#how-to-edit-firmware-not-officially-suppored
Title: Re: TMK USB to USB keyboard converter
Post by: Ko$tello on Thu, 20 July 2023, 21:59:32
Hi Hasu,

This isn't a standard Cyrillic layout, but all good I ordered a purely English version of the same keyboard. It's not going to have that key.

As I mentioned earlier I need F22-F24 versions of HEX file with and without modifiers. So I was trying to make them over the last two days.
Initially, I was following Taran's manual from here:
https://github.com/TaranVH/2nd-keyboard/tree/master/HASU_USB
on the last step, I realised that it doesn't work that way anymore.

Then I found QMK docs here:
https://docs.qmk.fm/#/newbs_getting_started?id=linux
while I was able to compile the default "keymap.c", I didn't have success with "unimap_TaranVH_F24.c" I found in your GitHub.

Then, I found some instructions here:
https://github.com/tmk/tmk_keyboard/tree/master/converter/usb_usb
but they also don't work for me.

It all gets so confusing with most of the documentation not being up to date.
I was wondering if you can point me to the right way of compiling HEX files from a keymap file.

Thanks in advance. 
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Fri, 21 July 2023, 00:06:58
 I have not tried TaranVH's setup and not used QMK build system closely. I don't know the both much, to be honest.

I can support TMK firmware build only.

See this wiki for general info.
https://github.com/tmk/tmk_keyboard/wiki#build-firmware

You can build TMK firmware with unimap_TaranVH_F24.c with commands below, as the file indicates.
https://github.com/tmk/tmk_keyboard/blob/master/converter/usb_usb/unimap_TaranVH_F24.c#L5-L6


Code: [Select]
$ make -f Makefile.unimap KEYMAP=TaranVH_F24 clean
$ make -f Makefile.unimap KEYMAP=TaranVH_F24

You need to just replace 'F24' with 'F23' in the file for F23 firmwares, I think.


Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Fri, 21 July 2023, 01:05:49
Ko$tello,
Let me know if you still have a trouble with building firmware with the instruction.
I'll build F23 and F22 firmware for you some later.

I think the fix will be back ported to QMK later in the end.  You can wait for it if you prefer QMK.
Title: Re: TMK USB to USB keyboard converter
Post by: Ko$tello on Fri, 21 July 2023, 01:20:40
I don't really have any preferences. Just want to make it work.
I tried using the two "make" commands you just mentioned. The first one works, the second one gives me the following error:
Code: [Select]
sh: 1: avr-gcc: not found
make: *** [../../tmk_core/rules.mk:410: gccversion] Error 127

Do you happen to know what this could be?
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Fri, 21 July 2023, 21:32:17
You need to setup biuld environment for compiling source codes.
AVR GCC is should be installed on your computer, it includes avr-gcc and many commands.
https://github.com/tmk/tmk_keyboard/wiki#build-environment
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Tue, 01 August 2023, 22:43:55
Ko$tello,

You can find prebuilt firmware files for TaranVH keymap with prefix F22, F23 and F24 now.
https://github.com/tmk/tmk_keyboard/tree/master/converter/usb_usb/binary
Title: Re: TMK USB to USB keyboard converter
Post by: whereami on Mon, 14 August 2023, 18:29:10
Interesting having to read what everyone is saying
Title: Re: TMK USB to USB keyboard converter
Post by: Ko$tello on Mon, 28 August 2023, 18:06:28
Ko$tello,

You can find prebuilt firmware files for TaranVH keymap with prefix F22, F23 and F24 now.
https://github.com/tmk/tmk_keyboard/tree/master/converter/usb_usb/binary

Thanks a lot, Hasu! Much appreciated 🙏.
I wasn't notified about your reply on this topic for some reason.
Title: Re: TMK USB to USB keyboard converter
Post by: DirtyGingy on Wed, 06 September 2023, 15:09:29
I know these hit 1up keyboards a few years back, are they ever coming back?
Title: Re: TMK USB to USB keyboard converter
Post by: qk6339zmdm on Fri, 15 September 2023, 22:58:15
Hello and thanks, the Insignia Wireless Ergonomic keyboard works.

https://www.bestbuy.ca/en-ca/product/insignia-wireless-ergonomic-keyboard-english-only-at-best-buy/16493437 (https://www.bestbuy.ca/en-ca/product/insignia-wireless-ergonomic-keyboard-english-only-at-best-buy/16493437)
Title: Re: TMK USB to USB keyboard converter
Post by: undofen on Fri, 09 February 2024, 06:34:23

I'm trying the converter on the keymouse (https://keymouse.com/), but it doesn't work, which I knew was very likely since there is no mouse support.

It also seems, the keymouse isn't 'boot' protocol.

hid_listen:
Code: [Select]
////////////////////////////
// USB_desc_dump
// Address: 01
// Lowspeed: 00

// Devicer dump:
12 01 00 02 00 00 00 40 C4 10 33 8D 03 02 01 02
03 01

// Device:
bLength: 12
bDescriptorType: 01
bcdUSB: 0200
bDeviceClass: 00
bDeviceSubClass: 00
bDeviceProtocol: 00
bMaxPacketSize0: 40
idVendor: 10C4
idProduct: 8D33
bcdDevice: 0203
iManufacturer: 01
iProduct: 02
iSerialNumber: 03
bNumConfigurations: 01

// String Zero: len: 04
// 04 03 09 04
// LangId: 0409

// iManufacturer: String1(0409): len: 14
// 14 03 5A 00 5A 00 2C 00 20 00 49 00 6E 00 63 00
// 2E 00 00 00
// ZZ, Inc..

// iProduct: String2(0409): len: 2C
// 2C 03 4B 00 65 00 79 00 4D 00 6F 00 75 00 73 00
// 65 00 20 00 41 00 6C 00 70 00 68 00 61 00 20 00
// 2D 00 20 00 4C 00 65 00 66 00 74 00
// KeyMouse Alpha - Left

// iSerialNumber: String3(0409): len: 14
// 14 03 4B 00 4D 00 2D 00 32 00 32 00 33 00 39 00
// 2D 00 4C 00
// KM-2239-L

// Config0 dump: len: 0029
09 02 29 00 01 01 00 A0 32 09 04 00 00 02 03 00
00 00 09 21 01 01 00 01 22 E7 00 07 05 81 03 40
00 01 07 05 01 03 40 00 01

// Config:
bLength: 09
bDescriptorType: 02
wTotalLength: 0029
bNumInterfaces: 01
bConfigurationValue: 01
iConfiguration: 00
bmAttributes: A0
bMaxPower: 32

// Interface0.0:
bLength: 09
bDescriptorType: 04
bInterfaceNumber: 00
bAlternateSetting: 00
bNumEndpoints: 02
bInterfaceClass: 03
bInterfaceSubClass: 00
bInterfaceProtocol: 00
iInterface: 00

// HID:
bLength: 09
bDescriptorType: 21
bcdHID: 0101
bCountryCode: 00
bNumDescriptors: 01
bDescrType: 22
wDescriptorLength: 00E7

// Report0 dump: len: 00E7
05 01 09 06 A1 01 85 03 75 01 95 08 05 07 19 E0
29 E7 15 00 25 01 81 02 95 01 75 08 81 03 95 05
75 01 05 08 19 01 29 05 91 02 95 01 75 03 91 03
95 0A 75 08 15 00 26 FF 00 05 07 19 00 29 FF 81
00 C0 05 01 09 02 A1 01 85 04 09 01 A1 00 05 09
19 01 29 08 15 00 25 01 75 01 95 08 81 02 05 01
09 30 09 31 16 01 80 26 FF 7F 75 10 95 02 81 06
09 38 15 81 25 7F 75 08 95 01 81 06 05 0C 0A 38
02 15 81 25 7F 75 08 81 06 C0 C0 06 00 FF 09 01
A1 01 85 02 95 3A 75 08 15 00 26 FF 00 09 01 81
02 85 01 95 3A 75 08 15 00 26 FF 00 09 01 91 02
C0 05 0C 09 01 A1 01 85 05 95 04 75 10 15 00 27
FF FF 00 00 19 00 2A FF FF 81 00 C0 05 01 09 80
A1 01 85 06 95 04 75 10 15 00 27 FF FF 00 00 19
00 2A FF FF 81 00 C0

// Endpoint:
bLength: 07
bDescriptorType: 05
bEndpointAddress: 81
bmAttributes: 03
wMaxPacketSize: 0040
bInterval: 01

// Endpoint:
bLength: 07
bDescriptorType: 05
bEndpointAddress: 01
bmAttributes: 03
wMaxPacketSize: 0040
bInterval: 01

https://eleccelerator.com/usbdescreqparser/ output:
Code: [Select]
0x05, 0x01,        // Usage Page (Generic Desktop Ctrls)
0x09, 0x06,        // Usage (Keyboard)
0xA1, 0x01,        // Collection (Application)
0x85, 0x03,        //   Report ID (3)
0x75, 0x01,        //   Report Size (1)
0x95, 0x08,        //   Report Count (8)
0x05, 0x07,        //   Usage Page (Kbrd/Keypad)
0x19, 0xE0,        //   Usage Minimum (0xE0)
0x29, 0xE7,        //   Usage Maximum (0xE7)
0x15, 0x00,        //   Logical Minimum (0)
0x25, 0x01,        //   Logical Maximum (1)
0x81, 0x02,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x95, 0x01,        //   Report Count (1)
0x75, 0x08,        //   Report Size (8)
0x81, 0x03,        //   Input (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x95, 0x05,        //   Report Count (5)
0x75, 0x01,        //   Report Size (1)
0x05, 0x08,        //   Usage Page (LEDs)
0x19, 0x01,        //   Usage Minimum (Num Lock)
0x29, 0x05,        //   Usage Maximum (Kana)
0x91, 0x02,        //   Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x95, 0x01,        //   Report Count (1)
0x75, 0x03,        //   Report Size (3)
0x91, 0x03,        //   Output (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x95, 0x0A,        //   Report Count (10)
0x75, 0x08,        //   Report Size (8)
0x15, 0x00,        //   Logical Minimum (0)
0x26, 0xFF, 0x00,  //   Logical Maximum (255)
0x05, 0x07,        //   Usage Page (Kbrd/Keypad)
0x19, 0x00,        //   Usage Minimum (0x00)
0x29, 0xFF,        //   Usage Maximum (0xFF)
0x81, 0x00,        //   Input (Data,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0,              // End Collection
0x05, 0x01,        // Usage Page (Generic Desktop Ctrls)
0x09, 0x02,        // Usage (Mouse)
0xA1, 0x01,        // Collection (Application)
0x85, 0x04,        //   Report ID (4)
0x09, 0x01,        //   Usage (Pointer)
0xA1, 0x00,        //   Collection (Physical)
0x05, 0x09,        //     Usage Page (Button)
0x19, 0x01,        //     Usage Minimum (0x01)
0x29, 0x08,        //     Usage Maximum (0x08)
0x15, 0x00,        //     Logical Minimum (0)
0x25, 0x01,        //     Logical Maximum (1)
0x75, 0x01,        //     Report Size (1)
0x95, 0x08,        //     Report Count (8)
0x81, 0x02,        //     Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x01,        //     Usage Page (Generic Desktop Ctrls)
0x09, 0x30,        //     Usage (X)
0x09, 0x31,        //     Usage (Y)
0x16, 0x01, 0x80,  //     Logical Minimum (-32767)
0x26, 0xFF, 0x7F,  //     Logical Maximum (32767)
0x75, 0x10,        //     Report Size (16)
0x95, 0x02,        //     Report Count (2)
0x81, 0x06,        //     Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0x09, 0x38,        //     Usage (Wheel)
0x15, 0x81,        //     Logical Minimum (-127)
0x25, 0x7F,        //     Logical Maximum (127)
0x75, 0x08,        //     Report Size (8)
0x95, 0x01,        //     Report Count (1)
0x81, 0x06,        //     Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x0C,        //     Usage Page (Consumer)
0x0A, 0x38, 0x02,  //     Usage (AC Pan)
0x15, 0x81,        //     Logical Minimum (-127)
0x25, 0x7F,        //     Logical Maximum (127)
0x75, 0x08,        //     Report Size (8)
0x81, 0x06,        //     Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0xC0,              //   End Collection
0xC0,              // End Collection
0x06, 0x00, 0xFF,  // Usage Page (Vendor Defined 0xFF00)
0x09, 0x01,        // Usage (0x01)
0xA1, 0x01,        // Collection (Application)
0x85, 0x02,        //   Report ID (2)
0x95, 0x3A,        //   Report Count (58)
0x75, 0x08,        //   Report Size (8)
0x15, 0x00,        //   Logical Minimum (0)
0x26, 0xFF, 0x00,  //   Logical Maximum (255)
0x09, 0x01,        //   Usage (0x01)
0x81, 0x02,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x85, 0x01,        //   Report ID (1)
0x95, 0x3A,        //   Report Count (58)
0x75, 0x08,        //   Report Size (8)
0x15, 0x00,        //   Logical Minimum (0)
0x26, 0xFF, 0x00,  //   Logical Maximum (255)
0x09, 0x01,        //   Usage (0x01)
0x91, 0x02,        //   Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0xC0,              // End Collection
0x05, 0x0C,        // Usage Page (Consumer)
0x09, 0x01,        // Usage (Consumer Control)
0xA1, 0x01,        // Collection (Application)
0x85, 0x05,        //   Report ID (5)
0x95, 0x04,        //   Report Count (4)
0x75, 0x10,        //   Report Size (16)
0x15, 0x00,        //   Logical Minimum (0)
0x27, 0xFF, 0xFF, 0x00, 0x00,  //   Logical Maximum (65534)
0x19, 0x00,        //   Usage Minimum (Unassigned)
0x2A, 0xFF, 0xFF,  //   Usage Maximum (0xFFFF)
0x81, 0x00,        //   Input (Data,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0,              // End Collection
0x05, 0x01,        // Usage Page (Generic Desktop Ctrls)
0x09, 0x80,        // Usage (Sys Control)
0xA1, 0x01,        // Collection (Application)
0x85, 0x06,        //   Report ID (6)
0x95, 0x04,        //   Report Count (4)
0x75, 0x10,        //   Report Size (16)
0x15, 0x00,        //   Logical Minimum (0)
0x27, 0xFF, 0xFF, 0x00, 0x00,  //   Logical Maximum (65534)
0x19, 0x00,        //   Usage Minimum (Undefined)
0x2A, 0xFF, 0xFF,  //   Usage Maximum (0xFFFF)
0x81, 0x00,        //   Input (Data,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0,              // End Collection

// 231 bytes

// best guess: USB HID Report Descriptor

Anything else to try or is this a no go?
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Sat, 10 February 2024, 00:00:58
According to the descriptor the keyboard does not support 'HID Boot protocol'. It won't work with the converter.
Title: Re: TMK USB to USB keyboard converter
Post by: pupmonster on Sat, 17 February 2024, 07:24:10
I am using a Unicomp Mini M 2023 Japanese keyboard. I have an oldish USB2USB converter from 2018 and it worked without any modification. But then I tried to modify my keyboard layout and all keys stopped working. I am using the converter so that the Japanese keys such as pc_katakana are reported to the non-Japanese Windows operating system (EN UK).

Here is the purchase page for the Unicomp keyboard:

https://www.pckeyboard.com/page/product/MINI_M

The modification was made using the  TMK Keymap Editor and the generated hex file from there. Flashing was done with QMK Toolbox with ATmega32U4 selected.

Subsequently I flashed usb_usb_debug.hex

usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
bNumEP:02
Cnf:01
bIfaceNum:00
bNumIface:00

Interface:00
SET_PROTOCOL: 00
SET_IDLE: 00
RPIPE: 00
RWU: 00
BM configured
host.Task: 2318
usb_state: 90
speed: full

and see that "ignored" on all keypresses is reported.

Finally, I tried to flash usb_desc_dump.hex via QMK Toolbox, but I got an Error reading line 1.

The information about the keyboard itself :

$ lsusb -d 17f6:1862 -v

Bus 001 Device 004: ID 17f6:1862 Unicomp, Inc. U AP1_4_87k_Kbrd_v7_53
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 [unknown]
  bDeviceSubClass         0 [unknown]
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x17f6 Unicomp, Inc.
  idProduct          0x1862 U AP1_4_87k_Kbrd_v7_53
  bcdDevice            7.53
  iManufacturer           1 Unicomp Inc
  iProduct                2 U AP1_4_87k_Kbrd_v7_53
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0022
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          3
    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
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode           33 US
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      63
          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     0x000c  1x 12 bytes
        bInterval               2


Oh, and one more thing: The converter used to light up, and now it does not.

Any help is appreciated.
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Sun, 18 February 2024, 22:01:07
Its debug log and USB descriptors seem to be normal. I don't see any reason why the converter doesn't work.

If old firmware from 2018 worked with the Mini M, one of changes(bug fixes) applied since then can make this problem.

You can find previous versions of prebuilt firmware here.
If you can try some of the firmwares and find the oldest version that doesn't work with the keyboard it would be very helpful.
https://github.com/tmk/tmk_keyboard/commits/master/converter/usb_usb/binary
Title: Re: TMK USB to USB keyboard converter
Post by: pupmonster on Sun, 18 February 2024, 23:56:26
Thanks much, Using this build from 2018 worked:

https://github.com/tmk/tmk_keyboard/commit/d0b91ca319074de9e9640977c7dfae336adfba3e

Which is good. At least the keyboard works.

Do I understand correctly that I will not be able to update the firmware using TMK Keymap Editor, as that will create firmware expecting newer hardware?

Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Mon, 19 February 2024, 02:49:34
Thanks for trying.
Could you find the oldest(first) version that doesn't work?



By default, TMK Keymap Eidtor using the latest version of prebuilt firmware hosted in 'master' branch on github.com( https://github.com/tmk/tmk_keyboard/tree/master/converter/usb_usb/binary ).

But you can use any 'unimap' firmware by selecting a HEX file in 'Base Firmware File:' section on Keymap Editor.
If you download the 'usb_usb_unimap.hex' file on your local computer you can select it using File chooser.

Or just put this URL in 'URL' textarea on Keymap Editor if you want to use the version on github.com.
https://raw.githubusercontent.com/tmk/tmk_keyboard/d0b91ca319074de9e9640977c7dfae336adfba3e/converter/usb_usb/binary/usb_usb_unimap.hex

[attach=1]
Title: Re: TMK USB to USB keyboard converter
Post by: pupmonster on Mon, 19 February 2024, 13:44:47
This is the first oldest version that does not work:

https://github.com/tmk/tmk_keyboard/commit/385ede5722dd6a1c23a27fbb13aa0e274497f54c

Thanks for your help!
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Tue, 27 February 2024, 02:06:04
pupmonster,
Can you try these attached firmwares to narrow possible fault points?
Just let me know whether they work or not.

[attachurl=1]
[attachurl=2]
Title: Re: TMK USB to USB keyboard converter
Post by: pupmonster on Wed, 28 February 2024, 20:30:19
Hasu, both files work. :)   All key presses register.
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Wed, 28 February 2024, 23:15:40
Thanks for testing.
The problem seems to be related to Hub code somewhat at least.

Again, can you try two attached firmwares?

[attachurl=1]
[attachurl=2]
Title: Re: TMK USB to USB keyboard converter
Post by: pupmonster on Thu, 29 February 2024, 00:42:31
Hasu, here are the results:
miniM_ab4b44.hex:  All keys register
miniM_woHubFix.hex: No keys register
Title: Re: TMK USB to USB keyboard converter
Post by: pupmonster on Fri, 01 March 2024, 00:37:34
I continued with my testing of miniM_ab4b44.hex and populated it with my layout.

It solved a problem with the previous last-working version where keystrokes would strangely appear that I had not typed.  Perhaps this information is useful to you.
Title: Re: TMK USB to USB keyboard converter
Post by: pupmonster on Sat, 02 March 2024, 03:20:08
Continuing testing ...
Perhaps it was not the intention of the interim file you provided, but using it, I have not been able to remap the bottom-row control keys, e.g. left-option, japanese_pc_nfer, japanese_pc_xfer, japanese_pc_katakana.
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Sat, 02 March 2024, 03:57:33
This is not what I expected, I missed something probably.
I'll have to start over debug process.

Hasu, here are the results:
miniM_ab4b44.hex:  All keys register
miniM_woHubFix.hex: No keys register



The firmwares I attached before were built only for debug and cannot be remapped with keymap editor.

Use one attached in this post if you need to remap. This firmware is not full-function but should work.

Continuing testing ...
Perhaps it was not the intention of the interim file you provided, but using it, I have not been able to remap the bottom-row control keys, e.g. left-option, japanese_pc_nfer, japanese_pc_xfer, japanese_pc_katakana.


[attachurl=1]
Title: Re: TMK USB to USB keyboard converter
Post by: pupmonster on Sat, 02 March 2024, 07:21:01
Merci! That helps a lot!
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Sat, 02 March 2024, 08:46:51
Can you try these fimwares to when you have time?
And let me know your result.

Thank you

[attachurl=1]

[attachurl=2]
Title: Re: TMK USB to USB keyboard converter
Post by: pupmonster on Sat, 02 March 2024, 22:24:23
Here are my results as tested on Mac and Linux

miniM_35606b.hex:
    all keys register
    behaviour while typing is as desired (no strange extra character inserts)
    capslock light comes on
    numlock light does not come on
    scrolllock light does not come on

miniM_a98e6f.hex:
    all keys register
    behaviour while typing is as desired (no strange extra character inserts)
    capslock light comes on
    numlock light does not come on
    scrolllock light does not come on
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Tue, 05 March 2024, 02:01:07
pupmonster,

I don't find a fault point yet. Can you try these also?
Post debug prints if it fails.

Thank you for your help.

[attachurl=1]
[attachurl=2]
Title: Re: TMK USB to USB keyboard converter
Post by: pupmonster on Tue, 05 March 2024, 10:25:21
Hasu, glad to assist.

Here you go:

miniM_85af76.hex:  no keys register
miniM_df8e64.hex:  no keys register

Tested on MacOS and Linux.
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Wed, 06 March 2024, 00:21:15
Can you post debug prints from miniM_85af76.hex?

This fix affects the issue, perhaps.
https://github.com/tmk/USB_Host_Shield_2.0/commit/9072c34c6fc669d696a8f0a99807e076531a2163
Title: Re: TMK USB to USB keyboard converter
Post by: pupmonster on Wed, 06 March 2024, 09:33:45
I am not sure I did what you need, but this is what I have:

I flashed the keyboard with miniM_85af76.hex, and started hid_listen as root on Linux.   I pressed every key from left to right, top to bottom.

The results are in the next message as an attachment. It is named "out.hex" because when I tried to upload a file with a .txt extension the server gave me an uncaught exception. The same happened when I tried to insert the output into this message.

Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Wed, 06 March 2024, 23:48:31
That log is what I needed. Thank you.

I think I found one of the causes at least and fixed it.

[attachurl=1]

Can you try this and share debug prints?

Use this procedure to get debug prints.
1. run hid_listen
2. plug in the converter first and wait for 5 sec
3. plug in the keyboard then
4. press a few keys
Title: Re: TMK USB to USB keyboard converter
Post by: pupmonster on Thu, 07 March 2024, 03:20:34
Results here inline, as attachment somehow was disallowed by forum:

Code: [Select]
sudo ./hid_listen

Waiting for device:....
Listening:

TMK:5ed16b/LUFA:d6a7df/UHS2:df8e64
u:20
[S][W][W]u:40
u:50
u:51
[W]BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
bNumEP:02
Cnf:01
bIfaceNum:00
bNumIface:00

Interface:00
SET_PROTOCOL: 00
SET_IDLE: 00
RPIPE: 00
RWU: 00
BM configured
u:90
s:f

USB configured.
[i]
Loop start.
usb_state: 90
speed: full
input 1: 00 00 0A 00 00 00 00 00 00 00 00 00
00 00 0A 00 00 00 00 00 00 00 00 00
ginput 1: 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
input 1: 00 00 0B 00 00 00 00 00 00 00 00 00
00 00 0B 00 00 00 00 00 00 00 00 00
hinput 1: 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
input 1: 00 00 12 00 00 00 00 00 00 00 00 00
00 00 12 00 00 00 00 00 00 00 00 00
oinput 1: 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
input 1: 00 00 26 00 00 00 00 00 00 00 00 00
00 00 26 00 00 00 00 00 00 00 00 00
9input 1: 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
input 1: 00 00 49 00 00 00 00 00 00 00 00 00
00 00 49 00 00 00 00 00 00 00 00 00
^[[2~input 1: 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
input 1: 00 00 46 00 00 00 00 00 00 00 00 00
00 00 46 00 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 00 00 00 00 00 00 00 00
·input 1: 00 00 45 00 00 00 00 00 00 00 00 00
00 00 45 00 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 00 00 00 00 00 00 00 00
^C
steveg@fedora-t14:/data/apps$ sudo ./hid_listen
Waiting for device:........
Listening:

TMK:5ed16b/LUFA:d6a7df/UHS2:df8e64
u:20
[S][W][W]u:40
u:50
u:51
[W]BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
bNumEP:02
Cnf:01
bIfaceNum:00
bNumIface:00

Interface:00
SET_PROTOCOL: 00
SET_IDLE: 00
RPIPE: 00
RWU: 00
BM configured
u:90
s:f

USB configured.
[i]
Loop start.
usb_state: 90
speed: full
input 1: 00 00 04 00 00 00 00 00 00 00 00 00
00 00 04 00 00 00 00 00 00 00 00 00
ainput 1: 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
input 1: 00 00 16 00 00 00 00 00 00 00 00 00
00 00 16 00 00 00 00 00 00 00 00 00
sinput 1: 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
input 1: 00 00 52 00 00 00 00 00 00 00 00 00
00 00 52 00 00 00 00 00 0^[[A0 00 00 00
input 1: 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
input 1: 00 00 49 00 00 00 00 00 00 00 00 00
00 00 49 00 00 00 00 00 00 00 00 00
^[[2~input 1: 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
input 1: 00 00 43 00 00 00 00 00 00 00 00 00
00 00 43 00 00 00 00 00 00 00 00 00
^[[21~input 1: 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
input 1: 00 00 33 00 00 00 00 00 00 00 00 00
00 00 33 00 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 00 00 00 00 00 00 00 00
input 1: 00 00 8A 00 00 00 00 00 00 00 00 00
00 00 8A 00 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 00 00 00 00 00 00 00 00
input 1: 01 00 00 00 00 00 00 00 00 00 00 00
01 00 00 00 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 00 00 00 00 00 00 00 00
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Thu, 07 March 2024, 06:25:37
It looks good now according to the log.

Let me know if you still have a problem. I'll update firmware on Keymap Editor soon later if not.


Next time, you can use CODE tag to include debug output in your message on this forum.

https://en.wikipedia.org/wiki/BBCode
https://www.bbcode.org/showing-code-with-bbcode.php

Title: Re: TMK USB to USB keyboard converter
Post by: pupmonster on Thu, 07 March 2024, 10:07:07
Sounds good. Thanks so much. Your service is outstanding.

However, I do not quite understand how you intend to proceed or what I should ideally be doing on my end.

Should I use  miniM_fix_5ed16b.hex  as the basis of any adaptations to my keyboard layout in TMK Keymap Editor?

And ... I also just received the newest USB-USB adapter today in the mail. Thanks. Should I also use miniM_fix_5ed16b.hex there as well?

Or ... should I just start TMK Keyboard editor without first uploading a base hex file, in the understanding that the latest and greatest is being used automatically there?

Thanks much for the clarification!
Title: Re: TMK USB to USB keyboard converter
Post by: hasu on Thu, 07 March 2024, 18:03:02
miniM_fix_5ed16b.hex was built just for debug/test and it can be used with Keymap Editor.
With the fix the converter doesn't seem to have obvious problem with Mini M now.

I just updated firmware on github and Keymap Editor for Mini M support. Now you can edit keymap and download the fixed firmware on Keymap Editor.

https://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb

Thank you for your help.
Title: Re: TMK USB to USB keyboard converter
Post by: pupmonster on Fri, 08 March 2024, 10:20:30
Thanks, Hasu!

I thought you would like to know that I used the TMK Layout Editor to modify my layout of the Japanese Mini M using both my older USB-USB adapter and the brand-new adapter just received, and everything looks good.