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

0 Members and 2 Guests are viewing this topic.

Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1000 on: Thu, 21 January 2021, 14:00:51 »
the apple keyboards numpad enter is different than the normal "enter/return" in the alpha block. but on a PC they probably show up the same way. so you could substitute it for the normal "enter" (from the alpha block) if it doesn't understand the mac number-pad "enter"

i don't know if it actually sends a shifted "return" key scan code but that's how the keypad "enter" acts on apples. (like a shifted "return")

or plug in a hungarian usb membrane keyboard and see what code you get for the numberpad enter and use that.... sorry, don't know the specifics... i'm on a mac (not a PC) and in the us.

you can refer to
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/keycode.txt
and try the couple noted there
Code: [Select]
KC_PENT key Pad ENTer
or
Code: [Select]
KC_ENT the regular alpha block ENTer
« Last Edit: Thu, 21 January 2021, 14:10:15 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 casualdehid

  • Posts: 32
  • Location: Hungary
Re: ADB to USB keyboard converter
« Reply #1001 on: Thu, 21 January 2021, 14:53:34 »
The Numpad Enter works flawlessly. I've got problems with this:
If I press this, it spits out a "00_59: Unknown" scancode, which in Notepad (or wherever) prints a 5 out.
« Last Edit: Thu, 21 January 2021, 14:56:33 by casualdehid »
M0116, Model M, AEK II

Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1002 on: Thu, 21 January 2021, 15:05:55 »
there's
Code: [Select]
KC_PEQL         67 Keypad =and
Code: [Select]
KC_EQL          2E Keyboard = and +and
Code: [Select]
KC_KP_EQUAL_AS400                   86 Keypad Equal Sign29 which sounds like it's specific to the AS400
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 casualdehid

  • Posts: 32
  • Location: Hungary
Re: ADB to USB keyboard converter
« Reply #1003 on: Fri, 22 January 2021, 12:57:35 »
there's
Code: [Select]
KC_PEQL         67 Keypad =and
Code: [Select]
KC_EQL          2E Keyboard = and +and
Code: [Select]
KC_KP_EQUAL_AS400                   86 Keypad Equal Sign29 which sounds like it's specific to the AS400


How can I make it output that scancode?
M0116, Model M, AEK II

Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1004 on: Fri, 22 January 2021, 13:32:39 »
you can change them in the configurator
did you buy your converter? which version 1 or 2?
or did you make a converter? teensy? promicro?

let me know what converter you have, so you get the correct configurator for your converter
you can see the whole list here:
http://www.tmk-kbd.com/tmk_keyboard/editor/index.html

from there, it's just clicking on the key you want to change in the layout, and clicking the corresponding key below in the tabs you want to change it to.

it looks like it's keypad equals, you could try changing it to number row equal 1 2 3 4 5 6 7 8 9 0 - (=) if it's not understanding keypad equals (as this is not on a typical PC numberpad).

260234-0

typical PC numberpad
« Last Edit: Fri, 22 January 2021, 13:40:01 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 casualdehid

  • Posts: 32
  • Location: Hungary
Re: ADB to USB keyboard converter
« Reply #1005 on: Fri, 22 January 2021, 16:02:26 »
I've built it with a Teensy 2.0 myself.
M0116, Model M, AEK II

Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1006 on: Fri, 22 January 2021, 16:46:37 »
ok. then you want this one
TMK Converter rev.1(ATmega32U4)
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1
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: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #1007 on: Fri, 22 January 2021, 18:12:43 »
nevin,
Thank you for your help!


casualdehid,
The key is assigned to keycode 'PEQL'(keypad equal) on default keymap. The keycode(USB usage 0x67) works on Linux and MacOS but doesn't on Windows.
If you are on Windows you need to remap the key with 'EQL'(equal) or anything you want on TMK Keymap Editor, as nevin already suggested.



Instead of 'PEQL', using 'EQL' on the default keymap would be useful for Windows users as long as it doesn't cause problems for other OSes. I'll check this some later.

Offline casualdehid

  • Posts: 32
  • Location: Hungary
Re: ADB to USB keyboard converter
« Reply #1008 on: Sat, 23 January 2021, 16:01:39 »
I'm using this, and built at least 30 firmwares with it trying to get the layers to work properly. I'll need help when I'll get my M0118 early next month.
« Last Edit: Sat, 23 January 2021, 16:22:15 by casualdehid »
M0116, Model M, AEK II

Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1009 on: Sat, 23 January 2021, 17:16:15 »
what are you having trouble with?
are you on discord? (little easier to quickly chat there)

i can help you with layers, just let me know what you're looking to do.
PM sent
« Last Edit: Sat, 23 January 2021, 18:16:55 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: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #1010 on: Tue, 26 January 2021, 17:38:40 »
casualdehid,
Quote
Also, saw the remapping of Num = in the changelog. Today, I downloaded a firmware from the TMK Version 1 editor, and it still just outputs a "5", even if I set it to ENG ANSI layout in Windows.


Post 'hid_listen' log when pressing the key.
It should look like this.


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


TMK:a36eff92/LUFA


Scan:
 addr:2, reg3:6C01

Keyboard:
handler: 01, ISO: no

Scan:
 addr:2, reg3:6201

USB configured.

Keyboard start.
51FF D1FF 51FF D1FF 51FF D1FF 51FF D1FF 51FF D1FF


Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1011 on: Tue, 26 January 2021, 19:39:16 »
i was talking to casualdehid (discord voice chat), and for his hungarian layout, to get "=" from the number row, he presses "shift" + "7"

i was telling him about how the layers & such work. he was hoping to use the power key on the AEKII to cycle toggle through the layers... something like, tap once for layer 1, tap twice for layer 2, etc.... i said i didn't think that was an option, and suggested the "action_layer_tap_key" to get dual function keys so he didn't have a handful of dedicated Fn/layer keys.

i believe he is starting to figure out what all the different options are and how to use the configurator.

@hasu, with international layouts, is there a way to specify a specific character that's not already in the keycodes?
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/keycode.txt

instead of "KC_" could you specify the scancode instead? or would that not parse correctly because it's a different format or not a variable the firmware is expecting?
Hungarian layout   http://kbdlayout.info/kbdhu
the Hungarian scancodes    http://kbdlayout.info/kbdhu/scancodes+scancodes
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: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #1012 on: Tue, 26 January 2021, 21:15:10 »
i was talking to casualdehid (discord voice chat), and for his hungarian layout, to get "=" from the number row, he presses "shift" + "7"

Interesting. He can't get  '=' with the key in Hungarian layout perhaps, but I beleive he can get it in US layout.

I updated prebuilt firmware and changed default keymap a few days ago, the key is assigned to keycode  '='(EQL) instead of 'keypad ='(PEQL) now.
With the latest firmware he can get character '=' on Windows, as long as he use US layout on the OS at least.
I guess the '='(EQL) emits character 'ü' in Hungarian layout, though.

But I still don't understant why he get character '5' with the key.
Debug prints and more detailed info from him would be needed.



Quote
i was telling him about how the layers & such work. he was hoping to use the power key on the AEKII to cycle toggle through the layers... something like, tap once for layer 1, tap twice for layer 2, etc.... i said i didn't think that was an option, and suggested the "action_layer_tap_key" to get dual function keys so he didn't have a handful of dedicated Fn/layer keys.

i believe he is starting to figure out what all the different options are and how to use the configurator.

In default ADB covnerter firmware Power key is used for special function 'Magic keys', you will have to build firmware to chage the configuration if this prevents you.


Quote
@hasu, with international layouts, is there a way to specify a specific character that's not already in the keycodes?
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/keycode.txt

instead of "KC_" could you specify the scancode instead? or would that not parse correctly because it's a different format or not a variable the firmware is expecting?
Hungarian layout   http://kbdlayout.info/kbdhu
the Hungarian scancodes    http://kbdlayout.info/kbdhu/scancodes+scancodes

Probably you can do both but I think it is not that good idea.
I don' t have plan to add code names specific to international layouts. As you know USB specification uses QWERTY US layout by default.
In French AZERTY you should use KC_Q for 'a' key and KC_A for 'q' with TMK, for example.

You can swap definitions of KC_Q and KC_A with C-preprocessor trick probably, but I think it is just confusing for people who already know how USB keyboard works correctly.



Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1013 on: Tue, 26 January 2021, 21:37:41 »
thanks hasu!

yes, i noticed the change form "pequal" to "equal" should be fine on either OS.

this is definitely a unique case.

will keep you posted on any progress.
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 casualdehid

  • Posts: 32
  • Location: Hungary
Re: ADB to USB keyboard converter
« Reply #1014 on: Wed, 27 January 2021, 12:12:28 »
It outputs this when I press Num Equal.

Waiting for device:
Listening:
51FF D1FF


Layerwise, I want to achive the following: I need at least 4 layers, since I want to use my M3501 and M0118.
Layer 0->1, and 2->3 I need as momentary
Layer 1->2 5 tap.

What I can see, is that I'm stuck at the highest (in this case Layer 3), and can't get back to Layer 0.
I only want to sacrafise the Power On key for this porpuse, to toggle between the layers.

Building my own firmware is out of my capabilities sincs I know nothing about programming that'd be requried to start understanding how to do so.
M0116, Model M, AEK II

Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1015 on: Wed, 27 January 2021, 13:01:04 »
there was something else i forgot which hasu reminded me...
Quote
In default ADB covnerter firmware Power key is used for special function 'Magic keys', you will have to build firmware to change the configuration if this prevents you.

let me mess with it some, then i'll get any changes you are using in your layout and build a hex from source if need be. should also be able to get your "=" outputting the correct code for your language. probably tomorrow at the earliest, very busy.
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 dx7

  • Posts: 2
Re: ADB to USB keyboard converter
« Reply #1016 on: Wed, 27 January 2021, 18:05:00 »
Hello Everyone.

I've been used the adb_usb converter successfully on my AEKII. However it swaps LGUI and LALT keys. I was able to solve this issue remapping those keys on unimap file. However it's weird to see LALT as LGUI and vice versa. Is that normal? Does the keyboard have some problem? It's an ANSI layout.

Offline godzillq25

  • Posts: 34
  • Location: australia
Re: ADB to USB keyboard converter
« Reply #1017 on: Wed, 27 January 2021, 19:19:20 »
maybe i am dumb or something, but i cant find anywhere as to which software to use to flash the unimap.hex on to a promicro. would love top know before i buy a tennsy. im cheap i had these pro micros laying around

Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1018 on: Wed, 27 January 2021, 19:42:38 »
Hello Everyone.

I've been used the adb_usb converter successfully on my AEKII. However it swaps LGUI and LALT keys. I was able to solve this issue remapping those keys on unimap file. However it's weird to see LALT as LGUI and vice versa. Is that normal? Does the keyboard have some problem? It's an ANSI layout.

yes, that's one of the main differences between apple keyboards and PC keyboards. the win (gui) and alt keys are swapped.
where control is the main modifier key on PCs, command (gui) is the main modifier on apple/macs.

maybe i am dumb or something, but i cant find anywhere as to which software to use to flash the unimap.hex on to a promicro. would love top know before i buy a tennsy. im cheap i had these pro micros laying around

what OS are you using?
promicros are catalina so you can use QMK toolbox (Mac, Win),  Atmel FLIP (Win, Linux) or avrdude (command line, most platforms i believe) to flash the hex
teensy uses it's own flash utility




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 godzillq25

  • Posts: 34
  • Location: australia
Re: ADB to USB keyboard converter
« Reply #1019 on: Wed, 27 January 2021, 20:31:03 »
thank you, didn't know you could with qmk toolbox

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #1020 on: Wed, 27 January 2021, 21:17:54 »
It outputs this when I press Num Equal.

Waiting for device:
Listening:
51FF D1FF

Show other part before 'Keyboard start.' as well. It may give useful insight on debug this.
You have to download the latest firmware from Keymap Editor without any keymap edit when testing this.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1

That seems to work as expected, and you should get '=' as long as you use US layout on Windows.

Use US keyobard layout on Windows.
Don't foget to disable or unistall keyboard related software like AHK on Windows.
And you will have to clean registry if you used SharpKeys to remap before.

You still get '5'? Check whether it is normal '5' or keypad '5' with tool like 'Switch Hitter'. Let us know BIOS Code of the '5'.
https://web.archive.org/web/20190413233743/www.elitekeyboards.com/switchhitter.php



As for this keymap topic let's discuss after the problem above is solved.
Quote
Layerwise, I want to achive the following: I need at least 4 layers, since I want to use my M3501 and M0118.
Layer 0->1, and 2->3 I need as momentary
Layer 1->2 5 tap.

What I can see, is that I'm stuck at the highest (in this case Layer 3), and can't get back to Layer 0.
I only want to sacrafise the Power On key for this porpuse, to toggle between the layers.

Building my own firmware is out of my capabilities sincs I know nothing about programming that'd be requried to start understanding how to do so.


Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1021 on: Wed, 27 January 2021, 22:09:48 »
thank you, didn't know you could with qmk toolbox

you're just using QMK toolbox as a way to flash the promicro. it's a little easier than command line especially if you're using the configurator to get the hex file.
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: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #1022 on: Wed, 27 January 2021, 22:18:09 »
Hello Everyone.

I've been used the adb_usb converter successfully on my AEKII. However it swaps LGUI and LALT keys. I was able to solve this issue remapping those keys on unimap file. However it's weird to see LALT as LGUI and vice versa. Is that normal? Does the keyboard have some problem? It's an ANSI layout.

You mean you have the problem after updating the latest firmware and didn't have it before, right?
This problem was introduced accidentally this month at commit 0518db68957e6. It will be fixed soon later.

Default firmware intends to send LGUI with Command(Apple) key and LALT with Opt(Alt) key as you expected.


Offline casualdehid

  • Posts: 32
  • Location: Hungary
Re: ADB to USB keyboard converter
« Reply #1023 on: Thu, 28 January 2021, 16:11:14 »
It outputs this when I press Num Equal.

Waiting for device:
Listening:
51FF D1FF

Show other part before 'Keyboard start.' as well. It may give useful insight on debug this.
You have to download the latest firmware from Keymap Editor without any keymap edit when testing this.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1

That seems to work as expected, and you should get '=' as long as you use US layout on Windows.

Use US keyobard layout on Windows.
Don't foget to disable or unistall keyboard related software like AHK on Windows.
And you will have to clean registry if you used SharpKeys to remap before.

You still get '5'? Check whether it is normal '5' or keypad '5' with tool like 'Switch Hitter'. Let us know BIOS Code of the '5'.
https://web.archive.org/web/20190413233743/www.elitekeyboards.com/switchhitter.php



As for this keymap topic let's discuss after the problem above is solved.
Quote
Layerwise, I want to achive the following: I need at least 4 layers, since I want to use my M3501 and M0118.
Layer 0->1, and 2->3 I need as momentary
Layer 1->2 5 tap.

What I can see, is that I'm stuck at the highest (in this case Layer 3), and can't get back to Layer 0.
I only want to sacrafise the Power On key for this porpuse, to toggle between the layers.

Building my own firmware is out of my capabilities sincs I know nothing about programming that'd be requried to start understanding how to do so.

Now it outputs an "ó" which is literally the equals key in US ANSI xD
If I set it to ANSI, it works flawlessly tho... (which I think is the majority of the user base)
Sorry, the software I found literally only outputs that text that I copied for you. However, here's Switchhitter's output.
New firmware:
48:06.0425 = (0xBB, BIOS 0x0D) DOWN
48:06.0496 = (0xBB, BIOS 0x0D) UP -> 72ms


Original firmware:
50:16.0252  (0x0C, BIOS 0x59) DOWN
50:16.0345  (0x0C, BIOS 0x59) UP -> 104ms

I just got this idea:
Alt+6 1 (you press Alt, and type 61 on numpad). Can I you make it a macro to output "Alt"+"6->1" ? It'd spit out an equals key in every single layout possible, since it's the ASCII Alt code. Tested it on both USA ANSI and HUN layouts. My only question is - would it break compatibilty on Linux/Mac OS?

Can you implement a macro editor into the editor sometimes in the future? Where you literally press buttons (or tell the literal scancodes one by one, key combinations, etc.), or raw ADB data, and you can set it to spit out specific key combinations, etc. I think that could rival even the best macro keyboards out there, it'd make an useful feature to the editor/converter (I think this would be literally the killer app), and it'd solve my issue as well.
It's not like I really need that equals key. My view on this topic was this: if it's there, might as well make use of it. My priority would be to get the layer switching to work to be honest.

And I'd take this opportunity to express my gratitude to this community. I'm blown away by the support that I get from you guys and this is just simply very amazing. You are heros! I did not expect any of you to go above and beyond to help me out like this. I was like... I'll simply report theese bugs to help this project out. And wow... You guys are just so helpful and so nice... I'm unbeliveably thankful.
M0116, Model M, AEK II

Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1024 on: Thu, 28 January 2021, 16:32:48 »
 :thumb:
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: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #1025 on: Thu, 28 January 2021, 17:56:41 »
Now it outputs an "ó" which is literally the equals key in US ANSI xD
If I set it to ANSI, it works flawlessly tho... (which I think is the majority of the user base)
Sorry, the software I found literally only outputs that text that I copied for you. However, here's Switchhitter's output.
New firmware:
48:06.0425 = (0xBB, BIOS 0x0D) DOWN
48:06.0496 = (0xBB, BIOS 0x0D) UP -> 72ms


Original firmware:
50:16.0252  (0x0C, BIOS 0x59) DOWN
50:16.0345  (0x0C, BIOS 0x59) UP -> 104ms

Those are exactly what is expected and confirmed that the converter works as expected.
New firmeware sends USB code of '=' and Original one sends code of 'keypad  ='.

I'm still curious and don't understand why you get '5' with Original firmware('keypad =') when you are on Hungarian layout.
I guess it may be caused by glitch of Windows Hungarian layout or other key configuration. Let me know if you find something.



Quote
I just got this idea:
Alt+6 1 (you press Alt, and type 61 on numpad). Can I you make it a macro to output "Alt"+"6->1" ? It'd spit out an equals key in every single layout possible, since it's the ASCII Alt code. Tested it on both USA ANSI and HUN layouts. My only question is - would it break compatibilty on Linux/Mac OS?

You can define a macro like that with writing user keymap code but not with Keymap Editor. Alt-Code works only on Windows.

Quote
Can you implement a macro editor into the editor sometimes in the future? Where you literally press buttons (or tell the literal scancodes one by one, key combinations, etc.), or raw ADB data, and you can set it to spit out specific key combinations, etc. I think that could rival even the best macro keyboards out there, it'd make an useful feature to the editor/converter (I think this would be literally the killer app), and it'd solve my issue as well.
I have had a plan for years but it has not that high priority in my list.

Quote
It's not like I really need that equals key. My view on this topic was this: if it's there, might as well make use of it. My priority would be to get the layer switching to work to be honest.

OK. Lets start discussing that layer switching.
I'd like to check if layer switch problem on your keymap is specific to 'power key'.
Share your keymap URL using 'URL Shortener' button on Keymap editor or you can just attach hex file here.




Offline dx7

  • Posts: 2
Re: ADB to USB keyboard converter
« Reply #1026 on: Thu, 28 January 2021, 22:11:01 »
Hello Everyone.

I've been used the adb_usb converter successfully on my AEKII. However it swaps LGUI and LALT keys. I was able to solve this issue remapping those keys on unimap file. However it's weird to see LALT as LGUI and vice versa. Is that normal? Does the keyboard have some problem? It's an ANSI layout.

You mean you have the problem after updating the latest firmware and didn't have it before, right?
This problem was introduced accidentally this month at commit 0518db68957e6. It will be fixed soon later.

Default firmware intends to send LGUI with Command(Apple) key and LALT with Opt(Alt) key as you expected.

That's great! Thanks hasu!

Offline casualdehid

  • Posts: 32
  • Location: Hungary
Re: ADB to USB keyboard converter
« Reply #1027 on: Fri, 29 January 2021, 05:30:55 »
OK. Lets start discussing that layer switching.
I'd like to check if layer switch problem on your keymap is specific to 'power key'.
Share your keymap URL using 'URL Shortener' button on Keymap editor or you can just attach hex file here.
I filmed my issue:
* unimap (20).hex (65.8 kB - downloaded 98 times.)
M0116, Model M, AEK II

Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1028 on: Fri, 29 January 2021, 07:20:16 »
ok. been messing with it for a little.

this is how he is trying to use "layer toggle"
- on layer0 (we'll pick "Home") and make it "T1"
- on layer1 we'll change "Home" to "T2"
- on layer2 we'll change "Home" to "T3"
- etc...

using "layer toggle" will ascend the layers: layer0 > layer1 > layer2, etc...
     or skip to a higher layer: layer2 > layer5

but does not want to descend layers: layer3 > layer2
    or skip to a lower layer: layer5 > layer1
in this configuration.

because it is not meant to be used this way.

"layer toggle" is meant to ACTIVATE a layer, then tapping the same key again to DEACTIVATE the layer and go back to the layer you were on previously.
how it's meant to function:
- on layer0 (we'll pick "Home" again) and make it T3
- we tap on "Home" to TOGGLE ON layer3, then we can use the keymap for layer3
- we tap on "Home" again to TOGGLE OFF layer3 and are now back to layer0

i really think the dual role "action_layer_tap_key" is your best option to momentarily (while holding key) access a layer without having a bunch of dedicated layer toggles.
the way "action_layer_tap_key" functions is:
- on layer0 (we'll pick "Home" again) and make it "action_layer_tap_key", "Home", "layer1"
- when you TAP "Home" you get "Home"
- when you HOLD "Home" you get access to layer1
see below:
260755-0

TMK layer switching descriptions
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/keymap.md#3-layer-switching-example
« Last Edit: Fri, 29 January 2021, 07:42:01 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: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #1029 on: Fri, 29 January 2021, 08:10:27 »
casualdehid,
This issue is not specific to ADB converter, so let's move to this general TMK firmware thread.
https://geekhack.org/index.php?topic=41989.msg3007564#msg3007564

Offline casualdehid

  • Posts: 32
  • Location: Hungary
Re: ADB to USB keyboard converter
« Reply #1030 on: Wed, 03 February 2021, 12:43:40 »
Hi there
A small hardware question:
Can I hotplug ADB devices while the Teensy is plugged into USB? Will it damage anything?
M0116, Model M, AEK II

Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1031 on: Wed, 03 February 2021, 12:50:13 »
no, shouldn't damage anything. i just tried it. and it picked up the mouse. (teensy version) and AEKII and A9M0331 mouse on a mac

if it doesn't automatically pick it up. unplug/replug the converter's usb connection to the computer.
« Last Edit: Wed, 03 February 2021, 12:52:18 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 ideable

  • Posts: 1
Re: ADB to USB keyboard converter
« Reply #1032 on: Wed, 03 February 2021, 15:08:21 »
Hi here!
Thank you so much for the work on ADB = to => USB, makes me exited that I can start using an old Apple Keyboard 2.

I do own a Teensy 4.0 but I couldn't find guides for flashing for the ADB -> USB converter. I try to compile the code with arm-none-eabi-gcc but I didn't get that far to resolve all the compilation errors and the libraries missing.

I just notice that the website unimap editor just allows you to download an .hex which I promptly flashed into the Teensy, but I didn't get my keyboard to work.
Now I wonder, would it work? in which pin should I've plug in?

(I know should be PD0 but that seems for Teensy 2, and I plug my data cable on the pin 0, but might not correspond)

Anticipated thanks.

Offline casualdehid

  • Posts: 32
  • Location: Hungary
Re: ADB to USB keyboard converter
« Reply #1033 on: Wed, 03 February 2021, 15:47:20 »
no, shouldn't damage anything. i just tried it. and it picked up the mouse. (teensy version) and AEKII and A9M0331 mouse on a mac

if it doesn't automatically pick it up. unplug/replug the converter's usb connection to the computer.

Yeah..  but it does not like being hotswapped: It swaps ISO 102nd key with Grave when hotplugged.
Also I'm jellaous of your M0331  :thumb:
always loved how that board looks like.
M0116, Model M, AEK II

Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1034 on: Wed, 03 February 2021, 18:00:17 »
Hi here!
Thank you so much for the work on ADB = to => USB, makes me exited that I can start using an old Apple Keyboard 2.

I do own a Teensy 4.0 but I couldn't find guides for flashing for the ADB -> USB converter. I try to compile the code with arm-none-eabi-gcc but I didn't get that far to resolve all the compilation errors and the libraries missing.

I just notice that the website unimap editor just allows you to download an .hex which I promptly flashed into the Teensy, but I didn't get my keyboard to work.
Now I wonder, would it work? in which pin should I've plug in?

(I know should be PD0 but that seems for Teensy 2, and I plug my data cable on the pin 0, but might not correspond)

Anticipated thanks.
Teensy 4 uses a different processor than either of the adb to usb (v1 or v2) protocol converters.

No, it won't work, the teensy 4 is not supported.

The rev1 firmware is for atmega 32u4
The rev2 firmware is for atmega 32u2

Take a look at the 1st post for more info
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: ADB to USB keyboard converter
« Reply #1035 on: Wed, 03 February 2021, 18:04:59 »
no, shouldn't damage anything. i just tried it. and it picked up the mouse. (teensy version) and AEKII and A9M0331 mouse on a mac

if it doesn't automatically pick it up. unplug/replug the converter's usb connection to the computer.

Yeah..  but it does not like being hotswapped: It swaps ISO 102nd key with Grave when hotplugged.
Also I'm jellaous of your M0331  :thumb:
always loved how that board looks like.

i was just plugging in a mouse to an aekII that was already plugged in

if you were trying to swap keyboards without unplugging the converter, that's something totally different. different boards may have different key assignments, which you would have to adjust for in the keymap for that particular keyboard.

it's more typical to have one converter per keyboard or flash a different keymap to match the keyboard you want to switch to before using it.
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: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #1036 on: Wed, 03 February 2021, 21:01:57 »
Hotswap for Extended or ISO keyboard is not supported at this time. You have to connect them with converter first, then plug into USB.

Meanwhile, hotswap is supported for mouses.


Quote
AEK left/right modifiers discrimination, ISO layout and Adjustable keyboard media keys
To use these features you have to connect keyboard to the converter first before plug-in USB port.
Keyboard initilization needed for the features occurs only when the converter powers up with current firmware.
from the first post.
« Last Edit: Wed, 03 February 2021, 21:04:18 by hasu »

Offline ephemeral25

  • Posts: 88
  • Location: Paris, France
Re: ADB to USB keyboard converter
« Reply #1037 on: Sun, 14 February 2021, 11:05:56 »
Hey there,

Thks for sharing everything with the community, it's F nice of you  :thumb:

I can't seem to make my converter works. It automatically disconnects when plugged into the AEKII M0118 ISO.

J1 is jumped and 1K resistor is soldered between PD0 and VCC. I've check everything with a multimeter, it's is 5V and all wiring is correct ( Ground, Data and VCC).

Any idea what could be the problem? In the makefile I only changed MCU to atmega32u4 then compiled and got the stock hex.
http://imgur.com/a/QOFdcv4
« Last Edit: Sun, 14 February 2021, 11:16:38 by ephemeral25 »

Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1038 on: Sun, 14 February 2021, 15:09:02 »
Here's some troubleshooting questions:
- what shape are the adb cables in? (Could be a bad/broken cable) you can use s-video cables as well, same connector & no funny crossovers
- does the converter work with another keyboard, but not with the m0118?
- did you try both adb ports on the keyboard? (Maybe one is not working)
- what does the inside of the m0118 look like?
-Can you see any wires that came loose or broken electrical components
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 ephemeral25

  • Posts: 88
  • Location: Paris, France
Re: ADB to USB keyboard converter
« Reply #1039 on: Sun, 14 February 2021, 15:36:31 »
Here's some troubleshooting questions:
- what shape are the adb cables in? (Could be a bad/broken cable) you can use s-video cables as well, same connector & no funny crossovers
- does the converter work with another keyboard, but not with the m0118?
- did you try both adb ports on the keyboard? (Maybe one is not working)
- what does the inside of the m0118 look like?
-Can you see any wires that came loose or broken electrical components

I am using a custom made cable from ADB to the micro controller which I fully tested with a multimeter.
I do not have any other boards to try it out.
I tried both of the ADB port and both are reacting the exact same way.
The insides of the board were dirty, the board have quite a bit of use into it and I did not notice any broken components.

What I can do is make a full album of pictures of the board so you guys can get an idea. Even if my board was broken, it seems really odd that the converter is turning off.
When I plug the converter only in usb (disconnected from the board) and I open the HID console, it's logs stuff that would make you think it works normally.

Listening:


TMK:a93677cb+/LUFA


Scan:

Keyboard:
handler: 00, ISO: no

Scan:

USB configured.

Keyboard start.

Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1040 on: Sun, 14 February 2021, 17:05:46 »
plug the keyboard into the converter and then plug the converter into the computer.

the only other thing i can think of is you may have the lines mixed up and are creating a short or something when you plug in the keyboard.
see the wiring diagram, the pinout that is shown is for the female adb socket, not the male cable connector
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 ephemeral25

  • Posts: 88
  • Location: Paris, France
Re: ADB to USB keyboard converter
« Reply #1041 on: Sun, 14 February 2021, 18:16:04 »
plug the keyboard into the converter and then plug the converter into the computer.

the only other thing i can think of is you may have the lines mixed up and are creating a short or something when you plug in the keyboard.
see the wiring diagram, the pinout that is shown is for the female adb socket, not the male cable connector

I think you found the problem, I am going to redo the wiring tomorrow and see if it changes anything. I considered the schéma as male connector...
Thks a lot for helping people and retard like me  :confused:

Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1042 on: Sun, 14 February 2021, 19:02:01 »
no problem, and you're not a retard.

hopefully that's all it was and you'll be good.
reply back with results when you get a chance.
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 ephemeral25

  • Posts: 88
  • Location: Paris, France
Re: ADB to USB keyboard converter
« Reply #1043 on: Mon, 15 February 2021, 12:08:20 »
no problem, and you're not a retard.

hopefully that's all it was and you'll be good.
reply back with results when you get a chance.


It's perfectly working, quite happy with the result, looks even dodgier than before but imma try to make a 3d printed enclosure and mod the board now that I know that it's working.

Thks a lot for your help

Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1044 on: Mon, 15 February 2021, 12:16:03 »
glad you got it working.
no problem. some incorporate into the case (if it's to be permanent) and put a female usb port at the one adb port location

this is a different model, but you can see what was done.
262324-0
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 ephemeral25

  • Posts: 88
  • Location: Paris, France
Re: ADB to USB keyboard converter
« Reply #1045 on: Mon, 15 February 2021, 13:29:37 »
Yeah I've seen multiple projects for that. I think for now I'd prefer having the converter on the outside, not modifying anything but switches.

I also need to make a converter for my old Digitran Fortune 32:16 keyboard... Lots of fun ahead  :thumb:

Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1046 on: Mon, 15 February 2021, 15:23:12 »
i'd open up & check the foam/foil on the Digitran before you get too far into the converter. might need to replace a bunch of the foam. there are sources to get replacements. look for Key Tronic replacement foam & foil.
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 Noodloodle

  • Posts: 4
Re: ADB to USB keyboard converter
« Reply #1047 on: Sun, 21 February 2021, 20:14:12 »
Howdy from Texas,

I'm just now getting into really messing with my first mechanical keyboard that hasn't been prebuilt (tough start I know) and was wondering if there was any way to use the Tmk_keyboard files to do an ADB to USB conversion and having it work on Windows 10. I'm not too technologically advanced but I can maneuver around things pretty quick. I'm getting stuck right now on how to flash the Teensy 2.0 to flash the ADB_USB file to the microcontroller. Everything that I've found has referenced using the 'make' command but of course, it doesn't exist plain and simple on windows. I just wanted to know how to bypass this and get this bad boy working.

Thanks, Noodle

Offline nevin

  • Posts: 1646
  • Location: US
Re: ADB to USB keyboard converter
« Reply #1048 on: Mon, 22 February 2021, 07:18:30 »
the make command is if your are building the firmware from source. and you can do it in windows, just make sure you have all the software installed for the build environment.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/build.md

if you're using a teensy, they have their own dedicated flashing utility
https://www.pjrc.com/teensy/loader.html

and hasu has a online configurator so you don't have to build from source (unless you want to)
under the adb to usb converter, you want this variant for teensy 2.0
TMK Converter rev.1(ATmega32U4): [ Full-key ]
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?adb_usb_rev1

make sure you add a pull-up resistor
https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb

and pay attention to the connector pinout. what he has noted on the page is the female adb socket (the connector in the keyboard), not the male cable
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 Noodloodle

  • Posts: 4
Re: ADB to USB keyboard converter
« Reply #1049 on: Mon, 22 February 2021, 08:46:42 »
the make command is if your are building the firmware from source. and you can do it in windows, just make sure you have all the software installed for the build environment.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/build.md

if you're using a teensy, they have their own dedicated flashing utility
https://www.pjrc.com/teensy/loader.html

and hasu has a online configurator so you don't have to build from source (unless you want to)
under the adb to usb converter, you want this variant for teensy 2.0
TMK Converter rev.1(ATmega32U4): [ Full-key ]

While typing that I couldn't find it I found it. Thank you for the help, Ill reply here if anything else comes up as an issue.