Author Topic: TMK USB to USB keyboard converter  (Read 521895 times)

0 Members and 1 Guest are viewing this topic.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #650 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.


Offline Lunatique

  • Posts: 292
  • Writer, Composer, Artist, Photographer, Gamer
Re: USB to USB keyboard converter
« Reply #651 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:

« Last Edit: Tue, 11 May 2021, 01:02:50 by Lunatique »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #652 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'.

Offline nevin

  • Posts: 1646
  • Location: US
Re: USB to USB keyboard converter
« Reply #653 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.
« Last Edit: Tue, 11 May 2021, 08:45:59 by nevin »
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline Lunatique

  • Posts: 292
  • Writer, Composer, Artist, Photographer, Gamer
Re: USB to USB keyboard converter
« Reply #654 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.

Offline clexp

  • Posts: 1
  • Location: Derby, UK
Re: USB to USB keyboard converter
« Reply #655 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
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.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #656 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.


Offline nevin

  • Posts: 1646
  • Location: US
Re: USB to USB keyboard converter
« Reply #657 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:
268915-0
268917-1
268919-2

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
« Last Edit: Fri, 21 May 2021, 07:47:46 by nevin »
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline pauld

  • Posts: 27
  • Location: Kerry, Ireland
Re: USB to USB keyboard converter
« Reply #658 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

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #659 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.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: USB to USB keyboard converter
« Reply #660 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:
269473-0
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 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?
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline pauld

  • Posts: 27
  • Location: Kerry, Ireland
Re: USB to USB keyboard converter
« Reply #661 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.

Offline nevin

  • Posts: 1646
  • Location: US
Re: USB to USB keyboard converter
« Reply #662 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
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline pauld

  • Posts: 27
  • Location: Kerry, Ireland
Re: USB to USB keyboard converter
« Reply #663 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
$

« Last Edit: Mon, 31 May 2021, 13:59:19 by pauld »

Offline DotMatrixMoe

  • Posts: 18
  • Location: Brooklyn, New York
Re: USB to USB keyboard converter
« Reply #664 on: Mon, 31 May 2021, 14:27:51 »
The name caught me off guard! If only I read the post  ;D

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: USB to USB keyboard converter
« Reply #665 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 :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #666 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


Offline pauld

  • Posts: 27
  • Location: Kerry, Ireland
Re: USB to USB keyboard converter
« Reply #667 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!!
« Last Edit: Tue, 01 June 2021, 10:37:52 by pauld »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: USB to USB keyboard converter
« Reply #668 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 :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline pauld

  • Posts: 27
  • Location: Kerry, Ireland
Re: USB to USB keyboard converter
« Reply #669 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.

Offline garek

  • Posts: 2
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

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #671 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

Offline garek

  • Posts: 2
Re: USB to USB keyboard converter
« Reply #672 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.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #673 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.

Offline nevin

  • Posts: 1646
  • Location: US
Re: USB to USB keyboard converter
« Reply #674 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.
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline nevin

  • Posts: 1646
  • Location: US
Re: USB to USB keyboard converter
« Reply #675 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.
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline shockwave

  • Posts: 18
Re: USB to USB keyboard converter
« Reply #676 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.

Offline nevin

  • Posts: 1646
  • Location: US
Re: USB to USB keyboard converter
« Reply #677 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....
« Last Edit: Wed, 23 June 2021, 01:35:28 by nevin »
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #678 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.

Offline shockwave

  • Posts: 18
Re: USB to USB keyboard converter
« Reply #679 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.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #680 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.



Offline shockwave

  • Posts: 18
Re: USB to USB keyboard converter
« Reply #681 on: Wed, 23 June 2021, 09:14:33 »
Thanks

Offline makeit_mike

  • Posts: 1
Re: USB to USB keyboard converter
« Reply #682 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.

Offline nevin

  • Posts: 1646
  • Location: US
Re: USB to USB keyboard converter
« Reply #683 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
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline shockwave

  • Posts: 18
Re: USB to USB keyboard converter
« Reply #684 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?

Offline shockwave

  • Posts: 18
Re: USB to USB keyboard converter
« Reply #685 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.
« Last Edit: Sun, 27 June 2021, 11:12:41 by shockwave »

Offline nug

  • Posts: 86
Re: USB to USB keyboard converter
« Reply #686 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:

And this is the HID output using HID_listen.exe:
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?

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #687 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

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #688 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.

Offline nug

  • Posts: 86
Re: USB to USB keyboard converter
« Reply #689 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

Offline PicMan

  • Posts: 1
Re: USB to USB keyboard converter
« Reply #690 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.)

Offline shockwave

  • Posts: 18
Re: USB to USB keyboard converter
« Reply #691 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



Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #692 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.
« Last Edit: Mon, 28 June 2021, 21:01:02 by hasu »

Offline shockwave

  • Posts: 18
Re: USB to USB keyboard converter
« Reply #693 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.

Offline shockwave

  • Posts: 18
Re: USB to USB keyboard converter
« Reply #694 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))

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #695 on: Tue, 29 June 2021, 04:17:29 »
great find! I'll update that code in repo soon. Thanks

Offline madison437

  • Posts: 2
Re: USB to USB keyboard converter
« Reply #696 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.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: USB to USB keyboard converter
« Reply #697 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.

Offline madison437

  • Posts: 2
Re: USB to USB keyboard converter
« Reply #698 on: Wed, 07 July 2021, 19:21:21 »
Thank you for this info!

Offline netbike

  • Posts: 19
  • Location: Hong Kong
Re: USB to USB keyboard converter
« Reply #699 on: Sat, 17 July 2021, 14:15:08 »
Hi Hasu,

please update your compatible list.

compatible keyboard report

Arkoncore AR87