Author Topic: Alternative Controller for HHKB  (Read 227889 times)

0 Members and 2 Guests are viewing this topic.

Offline hasu

  • Thread Starter
  • Posts: 2501
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #550 on: Wed, 14 June 2017, 21:58:10 »
hid_listen should displays like below. You will see 'Listenning:' when you get connected to your keyboard and will see 'debug: on' when you press the combo. Did you see those output on hid_listen?

Also refer this FAQ entry. https://github.com/tmk/tmk_keyboard/wiki/FAQ#debug-console

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

debug: on
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline sodiumjoe

  • Posts: 43
  • Location: Portland, OR
Re: Alternative Controller for HHKB
« Reply #551 on: Fri, 16 June 2017, 01:06:37 »
It's not a big deal, since I got everything working now, but this is what I see when I add a `dprint()` and try to debug:

Code: [Select]
Waiting for device:
Listening:

debug: on
^[^[^[
debug: off

keyboard: on
keyboard: 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 02 00 00 00 00 00 00 00 0^[0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

debug: off

debug: on
^R

debug: off
^[^[jlij^C

Offline hasu

  • Thread Starter
  • Posts: 2501
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #552 on: Fri, 16 June 2017, 01:14:54 »
It's not a big deal, since I got everything working now, but this is what I see when I add a `dprint()` and try to debug:

Code: [Select]
Waiting for device:
Listening:

debug: on
^[^[^[
debug: off

keyboard: on
keyboard: 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 02 00 00 00 00 00 00 00 0^[0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

debug: off

debug: on
^R

debug: off
^[^[jlij^C

Looks like it works well so you can use dprintf() in your code when you need to debug some later :D
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline sodiumjoe

  • Posts: 43
  • Location: Portland, OR
Re: Alternative Controller for HHKB
« Reply #553 on: Fri, 16 June 2017, 12:49:32 »
But that's *with* debug statements in the code, on keys that I was pressing. Where are the debug messages supposed to show up?

Offline sinegav

  • Posts: 10
  • Location: Norway
  • love keybaords
Re: Alternative Controller for HHKB
« Reply #554 on: Sat, 17 June 2017, 18:03:04 »
I've had someone ask where I got the USB plugs for the empty holes left in the rear of my HHKB after installing Hasu's controller (which doth rock, BTW. Thanks, Hasu!).

I just did a search on Ebay for "USB port (cover,plug)" and found these:
(Attachment Link)

They are a little undersize because they are designed for hardware inside the holes, not just an empty hole. I just wrapped some Kapton tape around the body to add a little dimension and they're now a nice press fit. I used Kapton tape because it's very thin, allowing very fine "adjustment" by layering, and also because it has an adhesive which won't weep out over time.

...and it looks like this:
(Attachment Link)

Just as another point of reference, I opt'd for a slightly more custom approach. Using a design previously uploaded in this thread, saved in github https://github.com/robotmaxtron/HHKB-usb-dust-covers I got some printed for about $10 I think at Shapeways.

Show Image


Hey thank you so much for this!!  ;D I was always wondering what I would use to cover these holes with.
It was a bit hard to find them actually, so if anyone is looking here is a link for it: http://www.ebay.com/itm/10Pcs-Plastic-USB-A-Male-Anti-Dust-Plug-Stopper-Cap-Cover-Black-Clear-SH-E4Y8-/252874131909?hash=item3ae07909c5:g:jAQAAOSwN6JY9NCv

Visit the Typing Test and try!

Offline JunkFace

  • Posts: 84
Re: Alternative Controller for HHKB
« Reply #555 on: Tue, 27 June 2017, 10:50:55 »
I was just wondering if I could restore the function (FN) key to the HHKB after a Hasu Bluetooth controller has been installed.  I don't see any place to set this up in the firmware, only keys to change the layers.  I've gotten so used to the HHKB's layout not having the FN key is a real pain.  I'd be fine with the layers if it worked like a switch but if its going to change the whole keyboard layout that won't do for multi-key commands like ctrl+alt+del or alt+printscreen, ctrl+f5 etc.  Anyone have any insight on this?  I'd really like to avoid remapping several layers, making new macros or doing any kind of software level keybindings.

Please let me know!

Online Atredl

  • Posts: 466
  • Location: SoCal
Re: Alternative Controller for HHKB
« Reply #556 on: Tue, 27 June 2017, 11:30:53 »
I was just wondering if I could restore the function (FN) key to the HHKB after a Hasu Bluetooth controller has been installed.  I don't see any place to set this up in the firmware, only keys to change the layers.  I've gotten so used to the HHKB's layout not having the FN key is a real pain.  I'd be fine with the layers if it worked like a switch but if its going to change the whole keyboard layout that won't do for multi-key commands like ctrl+alt+del or alt+printscreen, ctrl+f5 etc.  Anyone have any insight on this?  I'd really like to avoid remapping several layers, making new macros or doing any kind of software level keybindings.

Please let me know!
Go to the "Layer switching and etc" tab, there you'll find layer switch(momentary) options. You can use L1 and it will act exactly like the original FN key on the stock HHKB as long as you have all your functions on Layer 1.

Offline hasu

  • Thread Starter
  • Posts: 2501
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #557 on: Wed, 28 June 2017, 03:31:11 »
I was just wondering if I could restore the function (FN) key to the HHKB after a Hasu Bluetooth controller has been installed.  I don't see any place to set this up in the firmware, only keys to change the layers.  I've gotten so used to the HHKB's layout not having the FN key is a real pain.  I'd be fine with the layers if it worked like a switch but if its going to change the whole keyboard layout that won't do for multi-key commands like ctrl+alt+del or alt+printscreen, ctrl+f5 etc.  Anyone have any insight on this?  I'd really like to avoid remapping several layers, making new macros or doing any kind of software level keybindings.

Please let me know!
it comes with  FN key similar to stock controller by default, you won't need worry. use keymap editor if you want to change keymap.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline clee290

  • Posts: 42
Re: Alternative Controller for HHKB
« Reply #558 on: Sun, 02 July 2017, 18:10:45 »
Hi everyone!

First I just wanted to thank Hasu for this awesome controller! I've had mine for about a month now and it has been working great!

Right now, the firmware that I've been using was created using the website in the OP (http://www.tmk-kbd.com/tmk_keyboard/editor/). I was just wondering, can I create a QMK firmware and flash that to my HHKB too?

Thanks!

Offline hasu

  • Thread Starter
  • Posts: 2501
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #559 on: Tue, 04 July 2017, 03:04:07 »
Hi everyone!

First I just wanted to thank Hasu for this awesome controller! I've had mine for about a month now and it has been working great!

Right now, the firmware that I've been using was created using the website in the OP (http://www.tmk-kbd.com/tmk_keyboard/editor/). I was just wondering, can I create a QMK firmware and flash that to my HHKB too?

Thanks!

Hi,
Simple answer is no, you can't use QMK firmware with TMK keyboard editor in general. Technically it is still possible with tweaks but I guess its explanation is not what you want.

If you want to use QMK firmware you better build it from source code, they have decent documents and community support. It doesn't seems QMK has support for  bluetooth controller, though.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline clee290

  • Posts: 42
Re: Alternative Controller for HHKB
« Reply #560 on: Tue, 04 July 2017, 10:05:57 »
Hi everyone!

First I just wanted to thank Hasu for this awesome controller! I've had mine for about a month now and it has been working great!

Right now, the firmware that I've been using was created using the website in the OP (http://www.tmk-kbd.com/tmk_keyboard/editor/). I was just wondering, can I create a QMK firmware and flash that to my HHKB too?

Thanks!

Hi,
Simple answer is no, you can't use QMK firmware with TMK keyboard editor in general. Technically it is still possible with tweaks but I guess its explanation is not what you want.

If you want to use QMK firmware you better build it from source code, they have decent documents and community support. It doesn't seems QMK has support for  bluetooth controller, though.

Thank you :) 

Edit: Also, once I build the .hex file, would I just need to flash it to my keyboard like I had done previously? Or would I need to do something differently to prepare it for a different type of firmware?
« Last Edit: Tue, 04 July 2017, 13:30:14 by clee290 »

Offline hasu

  • Thread Starter
  • Posts: 2501
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #561 on: Tue, 04 July 2017, 20:10:30 »
Edit: Also, once I build the .hex file, would I just need to flash it to my keyboard like I had done previously? Or would I need to do something differently to prepare it for a different type of firmware?

Same method should work, there are no diffrence there.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline clee290

  • Posts: 42
Re: Alternative Controller for HHKB
« Reply #562 on: Tue, 04 July 2017, 23:05:44 »
Edit: Also, once I build the .hex file, would I just need to flash it to my keyboard like I had done previously? Or would I need to do something differently to prepare it for a different type of firmware?

Same method should work, there are no diffrence there.

Awesome, thanks Hasu!

Offline ttezz

  • Posts: 1
Re: Alternative Controller for HHKB
« Reply #563 on: Wed, 05 July 2017, 05:43:59 »
Hi, I need some help with the QI wireless charge modification  in this page by [manisteinn]

https://imgur.com/a/9yds3

I know nothing about the hardware / eletronic stuff.. :-[
how is it possible to connect the relay to the pcb ?
I have checked the hw design.. It seems like PPTC, JP0, JP1.. ?
but what pin should I connect with exactly?

and what is the black small parts located right to the jst battery power pin..?
He mentioned only the relay.. but nothing about it...




Offline kenmai9

  • Unicornforce
  • * Exquisite Elder
  • Posts: 2101
  • Location: Orange County, CA
  • Skrrr
Re: Alternative Controller for HHKB
« Reply #564 on: Wed, 05 July 2017, 12:46:41 »
@Hasu or anyone,

Is it possible to add macros to your tmk editor? Or is it possible to use EasyAVR?

http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?hhkb

Thanks

Offline hasu

  • Thread Starter
  • Posts: 2501
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #565 on: Wed, 05 July 2017, 13:33:22 »
no unfortunately at this time. to use macro you have to edit code and compile with command line tools.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline kenmai9

  • Unicornforce
  • * Exquisite Elder
  • Posts: 2101
  • Location: Orange County, CA
  • Skrrr
Re: Alternative Controller for HHKB
« Reply #566 on: Wed, 05 July 2017, 14:09:14 »
no unfortunately at this time. to use macro you have to edit code and compile with command line tools.

Alrighty thanks! I guess I'll start figuring that out. Cheers

Offline online

  • Posts: 29
Re: Alternative Controller for HHKB
« Reply #567 on: Sun, 23 July 2017, 08:02:18 »
I'm thinking to get a JP type-s, and noted drilling is required for Hasu BT.
Can I use USB mode without battery installed? Will the controller fits without drilling holes?
I will most likely use it wired but in case I want to try Bluetooth later.

Offline hasu

  • Thread Starter
  • Posts: 2501
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #568 on: Sun, 23 July 2017, 17:53:16 »
I'm thinking to get a JP type-s, and noted drilling is required for Hasu BT.
Can I use USB mode without battery installed? Will the controller fits without drilling holes?
I will most likely use it wired but in case I want to try Bluetooth later.

no, you need holes to install the TMK bluetooth controller into HHKB JP.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline online

  • Posts: 29
Re: Alternative Controller for HHKB
« Reply #569 on: Mon, 24 July 2017, 12:30:49 »
I'm thinking to get a JP type-s, and noted drilling is required for Hasu BT.
Can I use USB mode without battery installed? Will the controller fits without drilling holes?
I will most likely use it wired but in case I want to try Bluetooth later.

no, you need holes to install the TMK bluetooth controller into HHKB JP.
Thanks for your reply.
oh well, I guess I will settle on the wired one.

Offline 0100010

  • Posts: 1110
  • Location: DFW, TX, US
  • Not Sure
Re: Alternative Controller for HHKB
« Reply #570 on: Fri, 18 August 2017, 11:52:33 »
Dumb question // but if one uses the TMK keymap editor to create the hex file // do you only also need FLIP to program the controller?  Or is there still a need to compile firmware first?
  Quoting me causes a posting error that you need to ignore.

Offline hasu

  • Thread Starter
  • Posts: 2501
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #571 on: Fri, 18 August 2017, 17:10:11 »
Dumb question // but if one uses the TMK keymap editor to create the hex file // do you only also need FLIP to program the controller?  Or is there still a need to compile firmware first?

yes, you don't have to compile if you use keymap editor, from which you can download precomiled firmware. you need just a flash tool(FLIP/dfu-programmer) to program your controller.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline 0100010

  • Posts: 1110
  • Location: DFW, TX, US
  • Not Sure
Re: Alternative Controller for HHKB
« Reply #572 on: Fri, 18 August 2017, 21:32:52 »
Nice - makes it easy.

One more question - the 4 through holes near the USB port, can they be used as break out points for the USB power / data lines (in yellow below)?





If they are, was thinking of using a vertical PCB mount female USB A port, wired to those points, in one of the same locations that the original controller has its USB hub ports (to use a USB A port for the HHKB instead of the mini USB port).


  Quoting me causes a posting error that you need to ignore.

Offline hasu

  • Thread Starter
  • Posts: 2501
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #573 on: Fri, 18 August 2017, 22:26:21 »
Nice - makes it easy.

One more question - the 4 through holes near the USB port, can they be used as break out points for the USB power / data lines (in yellow below)?

Show Image




If they are, was thinking of using a vertical PCB mount female USB A port, wired to those points, in one of the same locations that the original controller has its USB hub ports (to use a USB A port for the HHKB instead of the mini USB port).

Show Image



Hmm, I'm not sure what your intention is.
yes, the 4 pins breakouts USB lines(VUSB, D-, D+ and GND). You will want to use Type-B connector, not Type-A in most cases, to connect to host PC with normal A-B cable.

Just to be sure, my TMK Alt Controller has no USB hub function.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline 0100010

  • Posts: 1110
  • Location: DFW, TX, US
  • Not Sure
Re: Alternative Controller for HHKB
« Reply #574 on: Fri, 18 August 2017, 23:01:41 »
Yes, normally type B port would be best, just not sure there is room.  Know a type A port would fit, since the original controller had a pair there previously.

Goal would be to have a more robust port than USB mini, for connecting the HHKB to the PC.
  Quoting me causes a posting error that you need to ignore.

Offline tinyprawn

  • Posts: 76
Re: Alternative Controller for HHKB
« Reply #575 on: Sun, 20 August 2017, 22:40:43 »
Hasu,

I have an already-modified HHKB that has the programmable controller but it doesn't have the bluetooth components on it. From what I've seen, it looks like the footprint is there for the bluetooth chip. Can I pick up some components from Digikey and solder them on to make it bluetooth?

I have a reflow oven if SMD soldering is necessary.

Thanks for all of your contributions to the community.  I've been enjoying my AEK ALPS64 for a year now and I look forward to this enhanced HHKB.

Offline hasu

  • Thread Starter
  • Posts: 2501
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #576 on: Sun, 20 August 2017, 23:23:37 »
Yes, normally type B port would be best, just not sure there is room.  Know a type A port would fit, since the original controller had a pair there previously.

Goal would be to have a more robust port than USB mini, for connecting the HHKB to the PC.

Ah, it makes sense. Yes, you can uses the breakout pins if mini USB receptacle happens to be broken for some reason.
I believe Hirose receptacle my controller uses is reliable and durable enough for normal uses. I'll offer repair or replacement service at reasonable cost when the connector is messed.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 2501
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #577 on: Sun, 20 August 2017, 23:32:24 »
Hasu,

I have an already-modified HHKB that has the programmable controller but it doesn't have the bluetooth components on it. From what I've seen, it looks like the footprint is there for the bluetooth chip. Can I pick up some components from Digikey and solder them on to make it bluetooth?

I have a reflow oven if SMD soldering is necessary.

Thanks for all of your contributions to the community.  I've been enjoying my AEK ALPS64 for a year now and I look forward to this enhanced HHKB.

Sure, you can. It is Microchip(which merged Roving Networks some ago) RN42-I/RM. And  you can find parmeter of other componets easily in schematic.
https://octopart.com/rn42-i%2Frm630-microchip-70466722

https://github.com/tmk/HHKB_controller

This BOM may be old and not updated but will be still useful. Let me know if you find any incorrectness.
https://github.com/tmk/HHKB_controller/blob/master/BOM.txt
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline tinyprawn

  • Posts: 76
Re: Alternative Controller for HHKB
« Reply #578 on: Mon, 21 August 2017, 11:57:46 »
Hasu,

I have an already-modified HHKB that has the programmable controller but it doesn't have the bluetooth components on it. From what I've seen, it looks like the footprint is there for the bluetooth chip. Can I pick up some components from Digikey and solder them on to make it bluetooth?

I have a reflow oven if SMD soldering is necessary.

Thanks for all of your contributions to the community.  I've been enjoying my AEK ALPS64 for a year now and I look forward to this enhanced HHKB.

Sure, you can. It is Microchip(which merged Roving Networks some ago) RN42-I/RM. And  you can find parmeter of other componets easily in schematic.
https://octopart.com/rn42-i%2Frm630-microchip-70466722

https://github.com/tmk/HHKB_controller

This BOM may be old and not updated but will be still useful. Let me know if you find any incorrectness.
https://github.com/tmk/HHKB_controller/blob/master/BOM.txt

Awesome! Thanks.

Offline tinyprawn

  • Posts: 76
Re: Alternative Controller for HHKB
« Reply #579 on: Tue, 29 August 2017, 13:27:04 »
I remember seeing something about adjusting the actuation sensitivity but I can't find it now. I notice that I occasionally will be resting my pinky on shift and selecting huge numbers of icons or rows or whatever.

I take my pinky off and the key doesn't even move but the shift key is released. I'd like to make the keys just a bit less sensitive.

Offline hasu

  • Thread Starter
  • Posts: 2501
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #580 on: Tue, 29 August 2017, 16:55:44 »
I remember seeing something about adjusting the actuation sensitivity but I can't find it now. I notice that I occasionally will be resting my pinky on shift and selecting huge numbers of icons or rows or whatever.

I take my pinky off and the key doesn't even move but the shift key is released. I'd like to make the keys just a bit less sensitive.

You will find CP1-4 on switch board PCB with which you can access to digital potentiometer  BU9831 using I2C.  Connect the CP to unused pins on your controller. You will be able to configure actuation of whole board, note that you cannot change actuation point key by key.

Datasheet of the chip:
http://pdf.datasheetcatalog.com/datasheets/150/365042_DS.pdf


And this code for FC660C but it would be kind of helpful.
https://geekhack.org/index.php?topic=88439.msg2403275#msg2403275
« Last Edit: Tue, 29 August 2017, 17:08:04 by hasu »
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline tinyprawn

  • Posts: 76
Re: Alternative Controller for HHKB
« Reply #581 on: Thu, 07 September 2017, 10:45:23 »
Another inquiry...

I would like to add a small piezoelectric buzzer to the board the same way it exists on the Planck. My HHKB is not the JP model but there is a component called "JP" which appears to support the larger matrix for that layout. The C6 pin from the atmega controller which has the proper timers and things to support the audio mechanism is used to support one of these extra rows.

Would the JP component malfunction if the trace to PC6 is severed?  From reviewing the code, as long as HHKB_JP is not defined, it shouldn't try to send or read that port.

The physical trace seems easy enough to isolate so if JP component will function without it, I'd probably clip that and jump the buzzer wire to the atmega pin directly.

Offline sinegav

  • Posts: 10
  • Location: Norway
  • love keybaords
Re: Alternative Controller for HHKB
« Reply #582 on: Thu, 07 September 2017, 10:50:33 »
I have a question about the TMK firmware.

There used to be a function layer that could be accessed by holding down the space bar. I think you could get to layer 4, anyway. My concern is that I do not see this feature anymore, and I was wondering if it's called something else now? I need it for my space FN layout. And unfortunately I'm not very good at coding myself. I tried looking at how the TMK works. But a bit out of my reach for now. I need a dual role key.

Thanks!


Visit the Typing Test and try!

Offline hasu

  • Thread Starter
  • Posts: 2501
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #583 on: Tue, 19 September 2017, 15:42:55 »
Another inquiry...

I would like to add a small piezoelectric buzzer to the board the same way it exists on the Planck. My HHKB is not the JP model but there is a component called "JP" which appears to support the larger matrix for that layout. The C6 pin from the atmega controller which has the proper timers and things to support the audio mechanism is used to support one of these extra rows.

Would the JP component malfunction if the trace to PC6 is severed?  From reviewing the code, as long as HHKB_JP is not defined, it shouldn't try to send or read that port.

The physical trace seems easy enough to isolate so if JP component will function without it, I'd probably clip that and jump the buzzer wire to the atmega pin directly.

Sorry for late...
You are rite, C6 is not used on Pro2 controller you can use the pin freely. C6(and C7) are used only for JP controller.

Post pics when you finish buzzer mod! Clicky HHKB is reallly fun :D
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 2501
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #584 on: Tue, 19 September 2017, 15:48:16 »
I have a question about the TMK firmware.

There used to be a function layer that could be accessed by holding down the space bar. I think you could get to layer 4, anyway. My concern is that I do not see this feature anymore, and I was wondering if it's called something else now? I need it for my space FN layout. And unfortunately I'm not very good at coding myself. I tried looking at how the TMK works. But a bit out of my reach for now. I need a dual role key.

Thanks!



Idea of Space FN is generally implemented  with 'dual role' key function.
In TMK the 'dual role' key is called as 'tap' key and you need to refer it with ACTION_LAYER_TAP_KEY() in keymap.

EDIT: This is Space FN in keymap editor, use 'Code edit' tab to see detail of action.
https://goo.gl/xoewce
« Last Edit: Tue, 19 September 2017, 15:56:15 by hasu »
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline donut_sauce

  • Posts: 21
Re: Alternative Controller for HHKB
« Reply #585 on: Fri, 22 September 2017, 18:08:12 »
no unfortunately at this time. to use macro you have to edit code and compile with command line tools.

Alrighty thanks! I guess I'll start figuring that out. Cheers

+1 for this! I would love to have this if at all possible:-)

Offline online

  • Posts: 29
Re: Alternative Controller for HHKB
« Reply #586 on: Wed, 04 October 2017, 11:30:44 »
Hello,

I want to set a winkey lock and mac mode(swapping winkey and alt key position) on my jp

The way I do this is by adding a layer with 'no' key on win key and toggle to the layer. Same goes to mac mode - new layer with swapped alt and win key.

I find this is a bit clumsy to achieve this, and sometime it lock the alt key when it's in mac mode.
Can anyone suggest a smarter way to do this?

In additionto above, is there a way to reset the keyboard back to the layer 0 rather than unplug?
« Last Edit: Wed, 04 October 2017, 13:51:32 by online »

Offline hasu

  • Thread Starter
  • Posts: 2501
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #587 on: Wed, 04 October 2017, 14:24:29 »
share your keymap for start point, first.

when your keymap state is rotten unplug is easy and preferable for recovery. but you can push program button and run 'dfu-programmer launch' to restart controller instead.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline sodiumjoe

  • Posts: 43
  • Location: Portland, OR
Re: Alternative Controller for HHKB
« Reply #588 on: Fri, 13 October 2017, 00:01:16 »
at this point unfortunately you have to write code and compile it.  the code should remove LCTL  before send ESC and restore the modifier state at the end. not easy but still possible.

I have a plan to add action just like ACTION_MODS_KEY except for   removing modifier instead of adding.


I got it to work with:

Code: [Select]
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
    switch (id) {
        case ESCX:
            if (record->event.pressed) {
                unregister_mods(MOD_BIT(KC_LCTL));
                register_code(KC_ESC);
                unregister_code(KC_ESC);
                register_mods(MOD_BIT(KC_LCTL));
                send_keyboard_report();
            }
            break;
    }
}

copying stuff from hhkb/unimap_hasu.c

It appears to be working pretty well, though I don't understand the event lifecycle, so I don't really get why the if (record->event.pressed) is necessary, i just added it because it was registering twice without it.

Please let me know if there's anything I'm missing!

I have a plan to add action just like ACTION_MODS_KEY except for   removing modifier instead of adding.

This would be great!

Hey Hasu, I'm having a weird issue. Again, I'm trying to simulate ctrl-[ (since I've mapped the normal ` key to ` instead of esc, because I actually use the ` key).

Here's the part of my setup that matters:

Code: [Select]
#define AC_L1       ACTION_LAYER_MOMENTARY(1)
#define AC_L2       ACTION_LAYER_MOMENTARY(2)
#define AC_1CTL     ACTION_LAYER_MODS(1, MOD_LCTL)
#define AC_ESCX     ACTION_FUNCTION_TAP(ESCX)

// emulates FC660C default keymap
#ifdef KEYMAP_SECTION_ENABLE
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
#else
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
#endif
    [0] = KMAP(
        GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     VOLU,
        TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS,     VOLD,
        1CTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,
        LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RSFT,UP,
        L2 ,LALT,LGUI,          SPC,                     RGUI,RALT,L2,  LEFT,DOWN,RGHT
    ),
    [1] = KMAP(
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,    TRNS,
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,ESCX,TRNS,TRNS,    MUTE,
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,          CAPS,TRNS,
        TRNS,TRNS,TRNS,          TRNS,                    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS
    ),
};

void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
    switch (id) {
        case ESCX:
            if (record->event.pressed) {
                unregister_mods(MOD_BIT(KC_LCTL));
                register_code(KC_ESC);
                unregister_code(KC_ESC);
                register_mods(MOD_BIT(KC_LCTL));
            }
            break;
    }
}

The problem is that AC_1CTL seems to have some delay before it triggers. I'm used to hitting ctrl-[ pretty quickly, which works natively in terminal emulators. But after applying this code, it often misses the ctrl part and I just end up typing [, which is very frustrating. Is this a known issue? Is there any way I can make ACTION_LAYER_MODS(1, MOD_LCTL) trigger more quickly?

Offline sodiumjoe

  • Posts: 43
  • Location: Portland, OR
Re: Alternative Controller for HHKB
« Reply #589 on: Fri, 13 October 2017, 00:05:13 »
Another option I was thinking about was replacing LBRC on Layer 0 with a custom function that just checks to see if LCTRL is pressed, but I'm not sure how to check that.

Offline hasu

  • Thread Starter
  • Posts: 2501
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #590 on: Fri, 13 October 2017, 00:14:55 »
Try  ACTION_FUNCTION instead of ACTION_FUNCTION_TAP.

Code: [Select]
#define AC_ESCX     ACTION_FUNCTION_TAP(ESCX)
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline sodiumjoe

  • Posts: 43
  • Location: Portland, OR
Re: Alternative Controller for HHKB
« Reply #591 on: Fri, 13 October 2017, 02:24:39 »
Try  ACTION_FUNCTION instead of ACTION_FUNCTION_TAP.

Code: [Select]
#define AC_ESCX     ACTION_FUNCTION_TAP(ESCX)

Thanks, I'll try that tomorrow (my keyboard is at work). Can you explain what the difference is between ACTION_FUNCTION and ACTION_FUNCTION_TAP?

Offline sodiumjoe

  • Posts: 43
  • Location: Portland, OR
Re: Alternative Controller for HHKB
« Reply #592 on: Fri, 13 October 2017, 15:57:51 »
Thanks, it worked! But I still don't really understand why...

Offline hasu

  • Thread Starter
  • Posts: 2501
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #593 on: Mon, 16 October 2017, 16:52:43 »
ACTION_FUNCTION_TAP is used when you wan to define your own tap key and dual role key(tap key) is imposed some delay inherently. In this case you don't need tap key there you can use ACTION_FUNCTION.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline sodiumjoe

  • Posts: 43
  • Location: Portland, OR
Re: Alternative Controller for HHKB
« Reply #594 on: Mon, 16 October 2017, 18:12:21 »
ACTION_FUNCTION_TAP is used when you wan to define your own tap key and dual role key(tap key) is imposed some delay inherently. In this case you don't need tap key there you can use ACTION_FUNCTION.

Got it, makes sense. Thanks so much for the info!

On an unrelated note, have you seen this article: https://danluu.com/keyboard-latency/

Unfortunately, the measurement he did was from beginning of keypress, instead of from actuation. But I was wondering if you've done any measurement/optimization of latency in the controller hardware or the tmk software.

Offline hasu

  • Thread Starter
  • Posts: 2501
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #595 on: Mon, 16 October 2017, 22:02:20 »
ACTION_FUNCTION_TAP is used when you wan to define your own tap key and dual role key(tap key) is imposed some delay inherently. In this case you don't need tap key there you can use ACTION_FUNCTION.

Got it, makes sense. Thanks so much for the info!

On an unrelated note, have you seen this article: https://danluu.com/keyboard-latency/

Unfortunately, the measurement he did was from beginning of keypress, instead of from actuation. But I was wondering if you've done any measurement/optimization of latency in the controller hardware or the tmk software.

Nice reading. It suits better for topre haters thread :p
But I'm not surprised at the result at all,  in fact Topre key scan rate is sloooow at least :D
I don't know but they might improve on newer keyboards like Realforce RGB.

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline sodiumjoe

  • Posts: 43
  • Location: Portland, OR
Re: Alternative Controller for HHKB
« Reply #596 on: Mon, 16 October 2017, 22:43:13 »
Interesting, so does your controller and the tmk firmware add any latency? Is it negligible in comparison with the key scan rate?

Online devoi

  • Posts: 26
  • Location: MA
Re: Alternative Controller for HHKB
« Reply #597 on: Mon, 16 October 2017, 22:53:46 »
IIRC you can change the scan rate in the matrix file - the lowest "stable" I've seen is about 30 micro-seconds per column (I believe it's column)
In addition, I think most topre boards use a timing circuit to find out the capacitance per key, which is a lot slower than the near-instant checks that mechanical boards can do. In any practical use, I feel like people overestimate the purpose of scan rates and update times, since in both typing and in games I really haven't seen a discernible difference between using topre (bluetooth as well) and any mechanical board. It just feels like big "gaming" companies search for advertising points to make up for higher prices and shoddy quality in other areas. Time additions within this firmware itself, however, is probably negligible in comparison to the technical limitations of how topre works.

Offline hasu

  • Thread Starter
  • Posts: 2501
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #598 on: Tue, 17 October 2017, 02:31:40 »
Interesting, so does your controller and the tmk firmware add any latency? Is it negligible in comparison with the key scan rate?

HHKB original controller takes around 15ms to scan keys. TMK simulates original timing by default but as devoi said you can change scan rate and speed up to 7.5ms as twice easily.
I guess firmwares use one or a few milli secs to handle keymap and other things? but not sure.

If you have to avoid latency for some reason traditional mechanical contact switch would be easy and useful.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt