Author Topic: TMK keyboard firmware  (Read 819755 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: TMK keyboard firmware
« Reply #1800 on: Tue, 17 January 2017, 20:22:19 »
hi, i hava a question,  for
example if i want to click the space key, its just space, but i hold it
down,  its shift key.   how can i change the C file?
thanks

You can use ACTION_MODS_TAP_KEY(MOD_RSFT, KC_SPC) for this purpose.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/keymap.md#213-modifier-with-tap-keydual-role

Also you can use keymap editor.
https://goo.gl/HFr1qR

Offline nemo_gh

  • Posts: 14
Re: TMK keyboard firmware
« Reply #1801 on: Tue, 17 January 2017, 21:02:22 »
hi, i hava a question,  for
example if i want to click the space key, its just space, but i hold it
down,  its shift key.   how can i change the C file?
thanks

You can use ACTION_MODS_TAP_KEY(MOD_RSFT, KC_SPC) for this purpose.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/keymap.md#213-modifier-with-tap-keydual-role

Also you can use keymap editor.
https://goo.gl/HFr1qR

hi, i hava a question,  for
example if i want to click the space key, its just space, but i hold it
down,  its shift key.   how can i change the C file?
thanks

You can use ACTION_MODS_TAP_KEY(MOD_RSFT, KC_SPC) for this purpose.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/keymap.md#213-modifier-with-tap-keydual-role

Also you can use keymap editor.
https://goo.gl/HFr1qR


thanks   :D

Offline adam.baranyai

  • Posts: 22
Re: TMK keyboard firmware
« Reply #1802 on: Tue, 17 January 2017, 22:29:21 »
Hey All,

Quite newbie for GH and about a week old with Hasu controller in my HHKB. I've successfully setup the layout I wanted but for some mysterious reason, I can't seem to make oneshot modifier to work with my shift keys.

This is my current setup: https://goo.gl/uIwAtq

I've successfully uploaded it to the keyboard few times already but the feature doesn't work and I'm not sure what am I missing.

After successful firmware upgrade, I've tried to press shift (after releasing shift) then immediately pressing an 'A' character and the result is a small capital 'a' although CAPS LOCK isn't on.

Anyone using oneshot modifier for shift keys on HHKB with Hasu's controller successfully?

Offline ikno

  • Posts: 8
Re: TMK keyboard firmware
« Reply #1803 on: Wed, 18 January 2017, 02:43:37 »
hi, i hava a question,  for
example if i want to click the space key, its just space, but i hold it
down,  its shift key.   how can i change the C file?
thanks

Have a look at https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/keymap.md#213-modifier-with-tap-keydual-role

Offline Hypersphere

  • Posts: 1886
  • Location: USA
Re: TMK keyboard firmware
« Reply #1804 on: Sat, 21 January 2017, 10:46:40 »
I have an Alps64 and I wanted to build the firmware from the ground up without the web configurator. I know how to flash the hex and have already created a keymap in a notepad file but even after reading through the github wiki and toying with a few of the programs I just cannot figure out how to compile the firmware. Can someone point me in the right direction with Windows 10 64bit? What do I need to install?
Windows 10 with the Anniversary Edition upgrade now includes the bash shell and a linux subsystem. There is also the option to install CygWin. Nevertheless, I  prefer to use an actual linux machine or to run linux in a VM using VMware Workstation or VirtualBox. I use Linux Mint 17.3 64-bit with the Xfce desktop on both my dedicated linux workstations and in my VMs.

However, if you don't want to build the firmware, the online configurator makes it very easy to generate your hex file. You can then flash the chip in the Alps64 using Atmel FLIP. I have a laptop running Windows 8.1 that I used for this. I encountered problems getting FLIP to run in Windows 10.



Offline yoobe

  • Posts: 48
  • Location: Rolle, Switzerland
  • Yoobe
Re: TMK keyboard firmware
« Reply #1805 on: Sat, 21 January 2017, 11:49:00 »
I am using RedScarft II+ with TMK firmware.
I am writing here but I am not use if the issue is in the Firmare..


When I use the keyboard on my laptop plugged on the usb port, I have no issue.
When I use it with a DELL docking station, I have a windows USB error : Device unrecognized.


Do you know what could be the issue? Power Consumption? Bootloader? Firmware?


Thanks

if its any of the new kind of docking stations i think thats were the problem lies at my last job everyone were trying all kind of things, updating firmware etc to no avail, people just simply stopped using them. What OS are you using? Logs etc give us da info


We are using windows 7 at work.
When I use my neutrino with a teensy 2.0 + QMK with the same config, I dont have any issue, I only have the issue with the RedScarfII+ VerC.
Yoobe

ErgoDox - Mx Brown
Filco Minila Air - Mx Red
RedScarfII+ VerC - Gateron White

Offline Cortes

  • Posts: 5
Re: TMK keyboard firmware
« Reply #1806 on: Sat, 21 January 2017, 21:32:36 »
Hi people!, I came here asking for some help, because I'm totally lost with my personalized keyboard based on teensy 2.0.

First of all, I do not speak English, and I'm translating all this into Uncle google


The question is that this is my second keyboard based on Teensy 2.0, and the functional part of keyboard works correctly, but the question is that this second keyboard sends it backlight and I'm very lost with it.


My idea is to have 2 independent leds, backlight and leds case, and I would use pins B6 and B7

I have these parts of code backlight.c that gave me the user breh:

Code: [Select]
    /*
    Copyright 2013 Mathias Andersson <wraul@dbox.se>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    */

    #include "backlight.h"
    #include "eeconfig.h"
    #include "debug.h"

    backlight_config_t backlight_config;

    void backlight_init(void)
    {
        //check signature
        if (!eeconfig_is_enabled()) {
            eeconfig_init();
        }
        backlight_config.raw = eeconfig_read_backlight();
        backlight_set(backlight_config.enable ? backlight_config.level : 0);
    }

    void backlight_increase(void)
    {
        if(backlight_config.level < BACKLIGHT_LEVELS)
        {
            backlight_config.level++;
            backlight_config.enable = 1;
            eeconfig_write_backlight(backlight_config.raw);
        }
        dprintf("backlight increase: %u\n", backlight_config.level);
        backlight_set(backlight_config.level);
    }

    void backlight_decrease(void)
    {
        if(backlight_config.level > 0)
        {
            backlight_config.level--;
            backlight_config.enable = !!backlight_config.level;
            eeconfig_write_backlight(backlight_config.raw);
        }
        dprintf("backlight decrease: %u\n", backlight_config.level);
        backlight_set(backlight_config.level);
    }

    void backlight_toggle(void)
    {
        backlight_config.enable ^= 1;
        eeconfig_write_backlight(backlight_config.raw);
        dprintf("backlight toggle: %u\n", backlight_config.enable);
        backlight_set(backlight_config.enable ? backlight_config.level : 0);
    }

    void backlight_step(void)
    {
        backlight_config.level++;
        if(backlight_config.level > BACKLIGHT_LEVELS)
        {
            backlight_config.level = 0;
        }
        backlight_config.enable = !!backlight_config.level;
        eeconfig_write_backlight(backlight_config.raw);
        dprintf("backlight step: %u\n", backlight_config.level);
        backlight_set(backlight_config.level);
    }

    void backlight_level(uint8_t level)
    {
        backlight_config.level ^= level;
        backlight_config.enable = !!backlight_config.level;
        eeconfig_write_backlight(backlight_config.raw);
        backlight_set(backlight_config.level);
    }

    // Plank Code for Backlight

    //#include <avr/io.h>
    //#include "backlight.h"

    #define CHANNEL OCR1B
    // Plank is OCR1C
    void backlight_init_ports()
    {

        // Setup PB7 as output and output low.
        DDRB |= (1<<6);
        PORTB &= ~(1<<6);
       
        // Use full 16-bit resolution.
        ICR1 = 0xFFFF;

        // I could write a wall of text here to explain... but TL;DW
        // Go read the ATmega32u4 datasheet.
        // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on
       
        // Pin PB7 = OCR1C (Timer 1, Channel C)
       // Pin PB6 = OCR1B (Timer 1, Channel B)
        // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0
       // Compare Output Mode = Clear on compare match, Channel C = COM1B1=1 COM1B0=0
        // (i.e. start high, go low when counter matches.)
        // WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0
        // Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1
       
        TCCR1A = _BV(COM1B1) | _BV(WGM11); // = 0b00001010;
        TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001;

        backlight_init();
    }

    void backlight_set(uint8_t level)
    {
        if ( level == 0 )
        {
            // Turn off PWM control on PB6, revert to output low.
            TCCR1A &= ~(_BV(COM1B1));
            CHANNEL = 0x0;
            // Prevent backlight blink on lowest level
            PORTB &= ~(_BV(PORTB6));
        }
        else if ( level == BACKLIGHT_LEVELS )
        {
            // Prevent backlight blink on lowest level
            PORTB &= ~(_BV(PORTB6));
            // Turn on PWM control of PB6
            TCCR1A |= _BV(COM1B1);
            // Set the brightness
            CHANNEL = 0xFFFF;
        }
        else       
        {
            // Prevent backlight blink on lowest level
            PORTB &= ~(_BV(PORTB6));
            // Turn on PWM control of PB6
            TCCR1A |= _BV(COM1B1);
            // Set the brightness
            CHANNEL = 0xFFFF >> ((BACKLIGHT_LEVELS - level) * ((BACKLIGHT_LEVELS + 1) / 2));
        }
    }

I want to do something like breh does on your numeric keypad, have specific keys (the ones above the arrows) for the regular backlight, power on / off / more brightness / less brightness, and in another layer to control the LEDs of the case.

Here also the complete keyboard configuration:

http://Https://dl.dropboxusercontent.com/u/5052546/Shiro.rar


Two pics :D



Offline DreymaR

  • Posts: 184
  • Location: Norway
  • Colemak forum guy
    • DreymaR's Big Bag of Kbd Tricks
Re: TMK keyboard firmware
« Reply #1807 on: Mon, 23 January 2017, 02:58:24 »
Any news on using the new Teensy 3.6 with TMK? It's such a beast from the looks of it, with lots and lots of juicy memory for macros. And it has an on-board USB host!  :cool:
« Last Edit: Mon, 23 January 2017, 06:18:38 by DreymaR »
Better burden you cannot carry than man-wisdom much ~ Hávamál

Offline philipVick

  • Posts: 19
Re: TMK keyboard firmware
« Reply #1808 on: Tue, 31 January 2017, 14:02:54 »
Guys,  I definitely need some help.

I decided to build a custom keyboard, but I am not able to generate the hex file to flash into the teensy 2.0.

When I execute 'make gelo' from the shell, I have the following error message:

.Making gelo with keymap default

avr-gcc (GCC) 4.9.3
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.

Compiling: keyboards/gelo/gelo.c                                                                   /usr/local/Cellar/avr-gcc/4.9.3/avr/include/util/delay.h: In function '_delay_ms':
<command-line>:0:7: error: 'UL' undeclared (first use in this function)
<command-line>:0:7: note: each undeclared identifier is reported only once for each function it appears in
/usr/local/Cellar/avr-gcc/4.9.3/avr/include/util/delay.h: In function '_delay_us':
<command-line>:0:7: error: 'UL' undeclared (first use in this function)
 [ERRORS]
 |
 |
 |
make[1]: *** [.build/obj_gelo_default/keyboards/gelo/gelo.o] Error 1
make: *** [gelo] Error 1

Here the Makefile
"
QUANTUM_DIR=../../quantum

ifndef MAKEFILE_INCLUDED
   include ../../Makefile
endif

"
rule.mk :

ARCH = BOARD_TEENSY2
MCU = atmega32u4
F_USB = $(F_CPU)

gelo .c
#include "gelo.h"

void matrix_init_kb(void) {

   matrix_init_user();
}
 
gelo .h
#ifndef GELO_H
#define GELO_H

#include "quantum.h"

#define KEYMAP( \
   k00, k01, k02, k03, k04, k05, k06,     k07,    k08,    k09,    k0a, k0b, k0c, k0d,  \
   k10, k11, k12, k13, k14, k15,               k16,    k17,    k18, k19, k1a, k1b,  \
   k20, k21, k22, k23, k24, k25, k26,   k27,    k28,    k29,    k2a, k2b, k2c, k2d,  \
   k30, k31, k32, k33,   k34,    k35,   k36,        k37,       k38, k39, k3a, k3b  \
) \
{ \
   { k00, k01, k02, k03, k04, k05,   k06,     k07,    k08,    k09,    k0a, k0b, k0c, k0d }, \
   { k10, k11, k12, k13, k14, k15,   KC_NO, KC_NO,  k16,   k17,    k18, k19, k1a, k1b }, \
   { k20, k21, k22, k23, k24, k25,   k26,   k27,    k28,    k29,    k2a, k2b, k2c, k2d }, \
   { k30, k31, k32, k33, k34, KC_NO, k35,   k36,    k37,    KC_NO,    k38, k39, k3a, k3b }  \
}
#endif

I have no idea how to define this UL variable.

Offline Tactile

  • Posts: 1431
  • Location: Portland, OR
Re: TMK keyboard firmware
« Reply #1809 on: Tue, 31 January 2017, 14:06:21 »
Guys,  I definitely need some help.

I decided to build a custom keyboard, but I am not able to generate the hex file to flash into the teensy 2.0.

When I execute 'make gelo' from the shell, I have the following error message:

.Making gelo with keymap default

avr-gcc (GCC) 4.9.3
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.

Compiling: keyboards/gelo/gelo.c                                                                   /usr/local/Cellar/avr-gcc/4.9.3/avr/include/util/delay.h: In function '_delay_ms':
<command-line>:0:7: error: 'UL' undeclared (first use in this function)

...

I have no idea how to define this UL variable.

Have you installed avr-libc?
« Last Edit: Tue, 31 January 2017, 14:08:49 by Tactile »
REΛLFORCE

Offline philipVick

  • Posts: 19
Re: TMK keyboard firmware
« Reply #1810 on: Tue, 31 January 2017, 15:40:13 »
yes, I did.

Offline kentt

  • Posts: 5
Re: TMK keyboard firmware
« Reply #1811 on: Mon, 06 February 2017, 21:50:23 »
hasu,

I bought your controller from 1upkeyboards.  I'm assuming it will not work with the new hhkb bluetooth version that came out.  Is that correct?

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1812 on: Mon, 06 February 2017, 22:17:32 »
hasu,

I bought your controller from 1upkeyboards.  I'm assuming it will not work with the new hhkb bluetooth version that came out.  Is that correct?

Hi,
That is correct. If you have any other question specific to HHKB Alt controller this thread is proper.
https://geekhack.org/index.php?topic=71517.0

Thanks

Offline rsadek

  • Posts: 207
  • Location: Columbia, Maryland
  • raging keyboard monkey
HHKB-JP settings on OSX
« Reply #1813 on: Sun, 12 February 2017, 14:05:53 »
I'm working to set up an HHKB-JP w/ Hasu's controller and am confused by the OS settings. It lets me set the input source to US or JP, and under JP there are several options. The board appears to do nothing unless I set these properly. But what do these different settings mean, and how do they relate to how I configure my keymap? For example, if I want to use Hasu's keymap, what is the best OS setting to use?


-R
❤️Keeboardz
---------------

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1814 on: Sun, 12 February 2017, 17:06:50 »
Just use US layout, it is one and real masta race! heh
In fact I use US layout for my keyboards, not JP one.

You may need to select JP layout only if you want to use JIS specific keys in Japanese input method.

Offline rsadek

  • Posts: 207
  • Location: Columbia, Maryland
  • raging keyboard monkey
Re: TMK keyboard firmware
« Reply #1815 on: Sun, 12 February 2017, 20:51:06 »
Just use US layout, it is one and real masta race! heh
In fact I use US layout for my keyboards, not JP one.

You may need to select JP layout only if you want to use JIS specific keys in Japanese input method.

When I set it to US, I don't get any output from the board.
❤️Keeboardz
---------------

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1816 on: Sun, 12 February 2017, 20:56:36 »
Just use US layout, it is one and real masta race! heh
In fact I use US layout for my keyboards, not JP one.

You may need to select JP layout only if you want to use JIS specific keys in Japanese input method.

When I set it to US, I don't get any output from the board.

Hmm, I never experienced that. Which os are you using?
And how did you set layout? Screen shots would be useful to explain your settings.


EDIT: Most of keys on Japanese keyboard still should work even with US or any other layouts, except for Japanese specific keys like henkan, muhenkan, kana(extra keys on bottom row), keys on left of Backspace and left of Right Shift.
https://en.wikipedia.org/wiki/File:KB_Japanese.svg

EDIT: Ah, found subject of your post says OSX. I don't have any OSX unfortunately and don't know much about how OSX handle keyboard layout. I confirmed Linux and WIndows have no problem there.
« Last Edit: Sun, 12 February 2017, 21:11:40 by hasu »

Offline rsadek

  • Posts: 207
  • Location: Columbia, Maryland
  • raging keyboard monkey
Re: TMK keyboard firmware
« Reply #1817 on: Tue, 14 February 2017, 09:09:55 »
Just use US layout, it is one and real masta race! heh
In fact I use US layout for my keyboards, not JP one.

You may need to select JP layout only if you want to use JIS specific keys in Japanese input method.

When I set it to US, I don't get any output from the board.

Hmm, I never experienced that. Which os are you using?
And how did you set layout? Screen shots would be useful to explain your settings.


EDIT: Most of keys on Japanese keyboard still should work even with US or any other layouts, except for Japanese specific keys like henkan, muhenkan, kana(extra keys on bottom row), keys on left of Backspace and left of Right Shift.
https://en.wikipedia.org/wiki/File:KB_Japanese.svg

EDIT: Ah, found subject of your post says OSX. I don't have any OSX unfortunately and don't know much about how OSX handle keyboard layout. I confirmed Linux and WIndows have no problem there.


I am a big dummy. I wasn't waiting long enough for the board to boot up. In fact, I do receive output from the board and everything is just fine with it. So now I can ask you the questions I really want to know about configuring the keymap.


I would like to make the key left of space bar mean that LGUI and LALT have been pressed. What is the correct way to do this? Can it be done so that 3 keys are pressed (LGUI, LALT, LCTRL)?


-R
❤️Keeboardz
---------------

Offline a-c

  • Posts: 196
  • Location: USA
Re: TMK keyboard firmware
« Reply #1818 on: Tue, 14 February 2017, 10:26:15 »

I would like to make the key left of space bar mean that LGUI and LALT have been pressed. What is the correct way to do this? Can it be done so that 3 keys are pressed (LGUI, LALT, LCTRL)?


-R

ACTION_MODS

https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#213-multiple-modifiers

Offline xandwich

  • Posts: 10
Re: TMK keyboard firmware
« Reply #1819 on: Thu, 23 February 2017, 11:49:09 »
Just compiled onekey_lufa and threw it on a 32u4 pro micro clone, and I've got a question:  lsusb will show the vendor/device IDs that I set in config.h, but not the manufacturer/product strings.  I've tried changing the lufa/descriptor.c lines where ManufacturerString.UnicodeString and ProductString.UnicodeString are specified, but can't get anything to show up in my lsusb output.

Is this a known bug or am I just doing something wrong? 

Offline xandwich

  • Posts: 10
Re: TMK keyboard firmware
« Reply #1820 on: Thu, 23 February 2017, 12:55:58 »
Problem solvedlsusb uses a builtin table to look up vendor/product strings.  usb-devices gives the correct values.

Offline tjweir

  • * Exquisite Elder
  • Posts: 1039
  • Location: Toronto
Re: TMK keyboard firmware
« Reply #1821 on: Mon, 27 February 2017, 19:18:24 »
I just wanted to thank @hasu for TMK. I just finished a hand-made board and TMK made it simple to get working.

It's a split spacebar, green Alps, KMAC Mini inspired board.

Thanks @hasu!

 

Offline Ngt

  • * Elevated Elder
  • Posts: 2346
  • Location: Lyon, France
Re: TMK keyboard firmware
« Reply #1822 on: Sun, 02 April 2017, 09:53:57 »
Hello everyone!


I read through the Github documentation for TMK and it states that GH60 rev.A and rev.B have been both tested and I wonder if rev.C is compatible as well. Is it?


I feel like I already asked this here but I can't find it though. Please, forgive me if that's a duplicate.


Thanks for your time.

Silenced Novatouch w/ Hack'd by Geeks

Sold: Ducky Zero Shine (Brown) | Poker 2 (Blue) | HHKB 55g Type-S

Offline Tactile

  • Posts: 1431
  • Location: Portland, OR
Re: TMK keyboard firmware
« Reply #1823 on: Sun, 02 April 2017, 12:14:39 »
Hello everyone!


I read through the Github documentation for TMK and it states that GH60 rev.A and rev.B have been both tested and I wonder if rev.C is compatible as well. Is it?


I feel like I already asked this here but I can't find it though. Please, forgive me if that's a duplicate.


Thanks for your time.

It works on the GH60 Rev C for programming the keyboard but I had trouble controlling the LEDs. I mean the LEDs on the WASD group, the arrow key group in the lower right corner, the FN key LED on the split right shift, etc.. I wanted to control these LEDs for layer indicators, Num Lock status, and stuff like that, and I had problems figuring out how to control them so I went with QMK instead. I'm not saying you can't do that in TMK, I'm saying it was easier for a dummy like me to do it in QMK.

As far as programming the keys, adding layers, etc. that all works perfectly as far as I can tell.
REΛLFORCE

Offline Ngt

  • * Elevated Elder
  • Posts: 2346
  • Location: Lyon, France
Re: TMK keyboard firmware
« Reply #1824 on: Sun, 02 April 2017, 12:44:48 »
Hello everyone!


I read through the Github documentation for TMK and it states that GH60 rev.A and rev.B have been both tested and I wonder if rev.C is compatible as well. Is it?


I feel like I already asked this here but I can't find it though. Please, forgive me if that's a duplicate.


Thanks for your time.

It works on the GH60 Rev C for programming the keyboard but I had trouble controlling the LEDs. I mean the LEDs on the WASD group, the arrow key group in the lower right corner, the FN key LED on the split right shift, etc.. I wanted to control these LEDs for layer indicators, Num Lock status, and stuff like that, and I had problems figuring out how to control them so I went with QMK instead. I'm not saying you can't do that in TMK, I'm saying it was easier for a dummy like me to do it in QMK.

As far as programming the keys, adding layers, etc. that all works perfectly as far as I can tell.


Great thank you for your clarification.

Silenced Novatouch w/ Hack'd by Geeks

Sold: Ducky Zero Shine (Brown) | Poker 2 (Blue) | HHKB 55g Type-S

Offline leizzer

  • Posts: 10
Re: TMK keyboard firmware
« Reply #1825 on: Tue, 04 April 2017, 14:40:57 »
Hello,

I did a desktop app to generate keymaps for homemade keyboards and I'm sharing it to give something back to the community.

Github repo: https://github.com/leizzer/electroboard

Here is the post with more info https://geekhack.org/index.php?topic=88700.0

Cheers~

Offline comblups

  • Posts: 11
Re: TMK keyboard firmware
« Reply #1826 on: Sat, 15 April 2017, 10:21:08 »
I wanted to change the equals sign on the Numpad of an ISO AEK2 to ».«, so I changed the file converter/adb_usb/keymap_iso.c to this (don’t mind the FN0):

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


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

That works fine, but now I have an M0118 (ISO) as well and wanted to use the Power Key as FN-Key and the keys 1 through 0 and the next two as F-Keys, F1 to F12, and swap Arrow Down and Arrow Right to come closer to a T-Nav, so I did this:

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


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

const action_t PROGMEM fn_actions[] = {
    ACTION_LAYER_MOMENTARY(1)
};

When I hit the Power Key, everything’s a mess (a lot of keys don’t do anything, the others produce wrong characters) and I have to unplug the Teensy and plug it back in again. Apart from that, the arrow keys are not swapped. What am I doing wrong?
« Last Edit: Sat, 15 April 2017, 10:26:11 by comblups »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1827 on: Sat, 15 April 2017, 14:55:37 »
Power key is magic key in ADB converter, so you can remap it very limitedly.
https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb#magic-command

Remove this line to disable magic key, your keymap will work.
https://github.com/tmk/tmk_keyboard/blob/master/converter/adb_usb/config.h#L55


Offline comblups

  • Posts: 11
Re: TMK keyboard firmware
« Reply #1828 on: Sat, 15 April 2017, 16:39:11 »
That doesn’t seem to work, I get errors in the make process.

Using the Power Key isn’t very comfortable, so I changed the keymap:

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


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

const action_t PROGMEM fn_actions[] = {
    ACTION_MODS_KEY(MOD_LCTL | MOD_LALT, KC_DEL),
    ACTION_LAYER_TAP_KEY(1, KC_TAB),
    ACTION_LAYER_TAP_KEY(1, KC_RBRC),
    ACTION_LAYER_TOGGLE(1),
};

But that doesn’t work, FN1, FN2 and FN3 are being ignored. The numlock key is still a numlock, the arrow keys are not swapped, only PEQL gives DOT. I think, only the first layer is in use. Do I have to define two seperate const uint8_t PROGMEM keymaps, one for each keyboard model?

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1829 on: Sat, 15 April 2017, 17:39:59 »
That doesn’t seem to work, I get errors in the make process.

Ah, coment out this line, instead of removing line in config.h
https://github.com/tmk/tmk_keyboard/blob/master/converter/adb_usb/Makefile#L77

Layer0 defined with KEYMAP_EXT_ISO() is used regardless of which keyboard you are using. You have to place FN3 on layer0(KEYMAP_EXT_ISO) even if your keyboard is M0118.

You can't have two different keymaps for both AEK and M0118 in one firmware.

Offline comblups

  • Posts: 11
Re: TMK keyboard firmware
« Reply #1830 on: Sat, 15 April 2017, 18:18:31 »
Does that mean, I can’t swap the arrow keys on the M0118 without swapping them on the AEKII?

PS: I just noticed, the right most column on the M0118 from top to bottom is *, +, -, Enter, but *, -, +, Enter on the AEKII. Apple really liked to change layouts …

PPS: And Enter has to be one row down, next to NUHS (hash sign). This is what I’m using at the moment, works perfect:

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


const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    KEYMAP_M0118_ISO(
    FN0,
    ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     FN3, DOT, PSLS,PAST,
    FN1, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,FN2,           P7,  P8,  P9,  PPLS,
    LCAP,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,NUHS,ENT,      P4,  P5,  P6,  PMNS,
    LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT,  UP,     P1,  P2,  P3,
    LCTL,LALT,RALT,          SPC,                          LEFT,DOWN,RGHT,     P0,       PDOT,PENT
    ),
    KEYMAP_M0118_ISO(
    FN0,
    TRNS,F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, TRNS,     FN3, TRNS,TRNS,TRNS,
    FN1, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN2,           INS, HOME,PGUP,TRNS,
    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,      DEL, END, PGDN,TRNS,
    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,TRNS,TRNS,
    TRNS,TRNS,TRNS,          TRNS,                         TRNS,TRNS,TRNS,     TRNS,TRNS     ,TRNS
    ),
};

const action_t PROGMEM fn_actions[] = {
    ACTION_MODS_KEY(MOD_LCTL | MOD_LALT, KC_DEL),
    ACTION_LAYER_TAP_KEY(1, KC_TAB),
    ACTION_LAYER_TAP_KEY(1, KC_RBRC),
    ACTION_LAYER_TOGGLE(1),
};

Arrows swapped, F-keys and proper nav cluster instead of deactivated numpad.

PPPS: No, there’s one flaw, of course …

This is better:

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


const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    KEYMAP_M0118_ISO(
    FN0,
    ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     FN1, DOT, PSLS,PAST,
    FN2, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,FN3,           P7,  P8,  P9,  PPLS,
    LCAP,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,NUHS,ENT,      P4,  P5,  P6,  PMNS,
    LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT,  UP,     P1,  P2,  P3,
    LCTL,LALT,RALT,          SPC,                          LEFT,DOWN,RGHT,     P0,       PDOT,PENT
    ),
    KEYMAP_M0118_ISO(
    FN0,
    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     FN1, TRNS,TRNS,TRNS,
    FN2, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN3,           INS, HOME,PGUP,TRNS,
    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     DEL, END, PGDN,TRNS,
    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,TRNS,TRNS,
    TRNS,TRNS,TRNS,          TRNS,                         TRNS,TRNS,TRNS,     TRNS,TRNS     ,TRNS
    ),
    KEYMAP_M0118_ISO(
    FN0,
    TRNS,F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, TRNS,     TRNS,TRNS,TRNS,TRNS,
    FN2, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN3,           TRNS,TRNS,TRNS,TRNS,
    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,TRNS,TRNS,TRNS,
    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,TRNS,TRNS,
    TRNS,TRNS,TRNS,          TRNS,                         TRNS,TRNS,TRNS,     TRNS,TRNS     ,TRNS
    ),
};

const action_t PROGMEM fn_actions[] = {
    ACTION_MODS_KEY(MOD_LCTL | MOD_LALT, KC_DEL),
    ACTION_LAYER_TOGGLE(1),
    ACTION_LAYER_TAP_KEY(2, KC_TAB),
    ACTION_LAYER_TAP_KEY(2, KC_RBRC),
};
« Last Edit: Sat, 15 April 2017, 19:00:04 by comblups »

Offline Bucake

  • Posts: 945
  • Location: The Netherlands
Re: TMK keyboard firmware
« Reply #1831 on: Mon, 08 May 2017, 13:11:47 »
howdy,

i would really appreciate some direction / feedback on my first attempt at making fn_functions.
so far, i've just been going through the documentation, used google, and used existing files as references.
this is for the hhkb with hasu's alt controller.


to keep things small for now, i'm trying to create a key(function) that acts as a toggle for a small, simple loop:
the idea is to press an fn key and have it repeat a keycode at a given rate, and when the button is pressed again i want this loop to stop.
by concept it's obviously very simple, but as a newb and possibly idiot, i'm currently not having an easy time :<

below i've pasted my current keymap.c (removed the layers for readability).
in action_function i've made two loops and below that, the function id's that call the loops.


- mostly, i just want to know if i'm on the right track at all?
- are both functions possible, or is wait_ms not something that can be used like this (or at all)?
- is it necessary to #include <stdbool.h> in this file in order to use bool?
- should it be void bool?


i'm sure i am doing a lot wrong, sorry about that

Code: [Select]
#include <stdbool.h>
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// layers removed
};

enum function_id
{
SPAM_A,
SPAM_B,
};

static uint16_t loopa_start;

void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {

bool spama_on = false;

void aloop() {
while spama_on = true {
sendchar(KC_A);
loopa_start = timer_read();
while spama_on = true {
if (timer_elapsed(loopa_start) < 1000) {
// do nothing
} else {
break;
}
}
break;
}
break;
}

bool spamb_on = false;

void bloop() {
do {
sendchar(KC_B);
wait_ms(1000);
} while spamb_on = true;
break;
}

switch (id) {
case SPAM_A:
if spama_on = false {
spama_on = true;
aloop();
} else {
spama_on = false;
}
break;
case SPAM_B:
if spamb_on = false {
spamb_on = true;
bloop();
} else {
spamb_on = false;
}
break;

}
}

const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), // F1 - F8 Left
[1] = ACTION_LAYER_MOMENTARY(2), // F9 - F12 and Navigation Left
[2] = ACTION_LAYER_MOMENTARY(3), // Numpad Right
[3] = ACTION_FUNCTION(SPAM_A), // Spam A
[4] = ACTION_FUNCTION(SPAM_B), // Spam B
};
« Last Edit: Mon, 08 May 2017, 14:01:00 by Bucake »
IBM Model F XT // Realforce 87U 55g Type-S // HHKBP2 45g Type-S // KBT Pure Pro Cherry MX Red

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1832 on: Tue, 09 May 2017, 00:27:20 »
To implement key repeat in firmeare is not so simple. With USB keyboard key repetition should be handled on host and keyboard doesn't have the function generally so you will need some hassles.

TMK also doesn't handle key repetition and you get only two events when press and release  a key and no event during holding it. And basically you cannot use loop code in  action_function() it will stop all other keyboard tasks and make your keyboard unresponsive.

You can probably use timer interrupt for your purpose instead of loop, controller has unused timer, iirc. Google AVR timer and consult with datasheet to learn.

Offline sadchi

  • Posts: 1
Re: TMK keyboard firmware
« Reply #1833 on: Sun, 14 May 2017, 08:40:32 »
SOLVED
« Last Edit: Sun, 14 May 2017, 11:31:17 by sadchi »

Offline mrbishop

  • * Maker
  • Posts: 799
  • Location: South Carolina USA
  • Evil Genius
    • Bishop Computer Design web
Re: TMK keyboard firmware
« Reply #1834 on: Fri, 19 May 2017, 11:12:01 »
probably already been answered but i'll ask anyway . i have a TMK compatible board that i want the led back light to be on all the time.  how and where do i program that?
Projects
Build to give back, 40% | Alps/Matias Removal ToolUltraHack 67% Hackdura  | ErgoDox case
                             
    

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1835 on: Fri, 19 May 2017, 17:48:26 »
probably already been answered but i'll ask anyway . i have a TMK compatible board that i want the led back light to be on all the time.  how and where do i program that?


No universal answer and it depends on keyboard design and firmware writer but I guess you can use these hooks.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/hook.h#L28-L34

And see this also.
https://github.com/tmk/tmk_keyboard/issues/304

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1836 on: Tue, 30 May 2017, 20:47:38 »
Now fixed Modifier/Layer key stuck problem finally.
https://github.com/tmk/tmk_keyboard/tree/master/tmk_core#20170530

See this wiki entry. https://github.com/tmk/tmk_keyboard/wiki/FAQ-Keymap#modifierlayer-stuck If you need old keymap behaviour for some reason define NO_TRACK_KEY_PRESS in your config.h. This is virtually equivalent to QMK's PREVENT_STUCK_MODIFIERS. https://github.com/qmk/qmk_firmware/pull/182

With this fix the biggest limitaiotn of TMK keymap were removed. Modifier and layer switch keys cannot be stuck virtually even if you want to have very strange keymap :D You have to compile to get this fix worked, keymap editor is not updated yet.

Report if you have any problem with this fix.

Offline tapinos

  • Posts: 2
Re: TMK keyboard firmware
« Reply #1837 on: Sun, 25 June 2017, 05:27:43 »
Hi,
I've almost finished programming my Minorca and everything is (sort of) working apart from the backslash (i.e. the \| character). Before it drives me completely crazy, I hope you could help me...
I'm using my Minorca attached to a MacBook Air running macOS Sierra 10.12.5. When I attached the keyboard the first time, I tried to have it recognized but the process failed: it asked me to press the key next to the left shift and it worked but then it asked me to press the key next to the right shift and it didn't work. So I manually chose the ISO layout given that I'm Italian.
In the keymap_minorca.c file, I tried the following keycodes with no success:

- NUBS prints <
- BSLS prints ù
- COMM prints ,

Anyway, here it's the complete file:

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

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* 0: default
* ,-----------------------------------------------.
* |ESC|  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|BPS|
    * |-----------------------------------------------|
    * |TAB |  A|  S|  D|  F|  G|  H|  J|  K|  L|   ENT|
    * |-----------------------------------------------|
    * |LSFT  |  Z|  X|  C|  V|  B|  N|  M|  ,|  .| RSF|
    * `-----------------------------------------------'
    * |LCTL|LALT|LGUI|SPC     |     FN2| FN3|   -| FN1|
    * `-----------------------------------------------'
    */
   
KEYMAP(ESC,   Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P, BSPC, \
TAB,   A,   S,   D,   F,   G,   H,   J,   K,   L,   ENT, \
LSFT,  Z,   X,   C,   V,   B,    N,   M,   COMM,DOT, RSFT, \
LCTL,  LALT, LGUI,   SPC,     FN2,      FN3, SLSH, FN1),
   
    /* 1: arrow + numfunc (FN1)
* ,-----------------------------------------------.
* |\  |  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  '|
    * |-----------------------------------------------|
    * |TRN |TRN|TRN|TRN|TRN|INS|HOM|PGU|TRN|UP |   ENT|
    * |-----------------------------------------------|
    * |<     |TRN|TRN|TRN|TRN|DEL|END|PGD|LFT|RGH| RSF|
    * `-----------------------------------------------'
    * |TRN |TRN |TRN |TRN     |     TRN| TRN| DWN| FN1|
    * `-----------------------------------------------'
    */
   
KEYMAP(NUBS,   1,   2,   3,   4,   5,   6,   7,   8,   9,   0, MINS, \
TRNS,  TRNS,TRNS,TRNS,TRNS,INS,HOME,PGUP,TRNS,UP, ENT, \
NUBS,  TRNS, TRNS, TRNS, TRNS, DEL,  END, PGDN, LEFT,RIGHT, RSFT, \
TRNS,   TRNS,TRNS,    TRNS,         TRNS,      TRNS, DOWN, FN1),

    /* 2: italian accents (FN2)
* ,-----------------------------------------------.
* |TRN|TRN|TRN|èé |TRN|TRN|TRN|ù  |ì  |ò  |TRN|TRN|
    * |-----------------------------------------------|
    * |TRN |à  |TRN|TRN|TRN|TRN|TRN|TRN|TRN|TRN|   TRN|
    * |-----------------------------------------------|
    * |TRN   |TRN|TRN|TRN|TRN|TRN|TRN|TRN|TRN|TRN| TRN|
    * `-----------------------------------------------'
    * |TRN |TRN |TRN |TRN     |     FN2| TRN| TRN| FN1|
    * `-----------------------------------------------'
    */

KEYMAP(TRNS, TRNS, TRNS, LBRC,TRNS,TRNS,TRNS,BSLS,EQL,SCLN,TRNS,TRNS, \
TRNS, QUOT,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,  \
TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,   TRNS,TRNS,TRNS,TRNS, TRNS, \
TRNS,  TRNS,TRNS,   TRNS,      FN2,  TRNS, TRNS, FN1),

    /* 3: layout (FN3)
* ,-----------------------------------------------.
* |TRN|PRV|PLY|NXT|MU |VD |VU |TRN|TRN|ì  |TRN|PWR|
    * |-----------------------------------------------|
    * |TRN |TRN|TRN|LSF|RSF|PAU|TRN|TRN|è  |+  |   TRN|
    * |-----------------------------------------------|
    * |TRN   |TRN|TRN|TRN|TRN|TRN|TRN|ò  |à  |ù  | TRN|
    * `-----------------------------------------------'
    * |TRN |TRN |TRN |TRN     |     TRN| FN3| TRN| TRN|
    * `-----------------------------------------------'
    */

KEYMAP(TRNS, MRWD, MPLY, MFFD, MUTE, VOLD, VOLU, TRNS, TRNS, EQL, TRNS, PWR, \
TRNS, TRNS,TRNS,LSFT,RSFT,PAUS,TRNS,TRNS,LBRC,RBRC,TRNS,  \
TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,   TRNS,SCLN,QUOT,BSLS, TRNS, \
TRNS,  TRNS,TRNS,   TRNS,      TRNS,  FN3, TRNS, TRNS),
};
const uint16_t PROGMEM fn_actions[] = {
    [1] = ACTION_LAYER_MOMENTARY(1),  // toggle arrow + numfunc overlay
    [2] = ACTION_LAYER_MOMENTARY(2),  // to italian accents
    [3] = ACTION_LAYER_MOMENTARY(3),  // to Layout selector
};

Any advice?

Thanks in advance!

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: TMK keyboard firmware
« Reply #1838 on: Sun, 25 June 2017, 05:43:20 »
everything is (sort of) working apart from the backslash (i.e. the \| character).
[...]
- NUBS prints <
- BSLS prints ù
- COMM prints ,
Try GRV.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline tapinos

  • Posts: 2
Re: TMK keyboard firmware
« Reply #1839 on: Sun, 25 June 2017, 10:28:53 »
It worked! Thanks a lot! It was driving me crazy!

Offline Hypersphere

  • Posts: 1886
  • Location: USA
Re: TMK keyboard firmware
« Reply #1840 on: Sun, 25 June 2017, 15:49:41 »
Now fixed Modifier/Layer key stuck problem finally.
https://github.com/tmk/tmk_keyboard/tree/master/tmk_core#20170530

See this wiki entry. https://github.com/tmk/tmk_keyboard/wiki/FAQ-Keymap#modifierlayer-stuck If you need old keymap behaviour for some reason define NO_TRACK_KEY_PRESS in your config.h. This is virtually equivalent to QMK's PREVENT_STUCK_MODIFIERS. https://github.com/qmk/qmk_firmware/pull/182

With this fix the biggest limitaiotn of TMK keymap were removed. Modifier and layer switch keys cannot be stuck virtually even if you want to have very strange keymap :D You have to compile to get this fix worked, keymap editor is not updated yet.

Report if you have any problem with this fix.
Hasu, thanks so much for your ongoing dedication to this great project!

Offline xauser

  • Posts: 97
Re: TMK keyboard firmware
« Reply #1841 on: Wed, 28 June 2017, 12:02:17 »
I face a serious problem with my latest tmk build. TMK crashes for me on my production keyboard and I have to reconnect usb connection. I'm not yet sure what is causing my keymap/firmware to crash but I can reproduce it.

* Use a keymap with space fn
* Press and hold space

In my terminal app (urxvt) I don't get a single whitespace nor repeating spaces
In vi I get some whitespaces and then an usb disconnect with keyboard booting to bootloader
Even on windows in vi I get the usb disconnect.

I don't have more debug information as of yet but my daily workflow is affected by this bug so I have to find
a workaround soon. Will revert back in git history as a next step.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1842 on: Wed, 28 June 2017, 22:04:14 »
I face a serious problem with my latest tmk build. TMK crashes for me on my production keyboard and I have to reconnect usb connection. I'm not yet sure what is causing my keymap/firmware to crash but I can reproduce it.

* Use a keymap with space fn
* Press and hold space

In my terminal app (urxvt) I don't get a single whitespace nor repeating spaces
In vi I get some whitespaces and then an usb disconnect with keyboard booting to bootloader
Even on windows in vi I get the usb disconnect.

I don't have more debug information as of yet but my daily workflow is affected by this bug so I have to find
a workaround soon. Will revert back in git history as a next step.

I don't have problem like that so far on my HHKB Alt at least. I've also used kindof space fn daily.
let us know if you find clue.


Offline xauser

  • Posts: 97
Re: TMK keyboard firmware
« Reply #1843 on: Thu, 29 June 2017, 11:29:19 »
I did some more tests today and identified commit

commit ba2883fd9ab040fc670ad729e6cddd4c67c8188c
Author: tmk <hasu@tmk-kbd.com>
Date:   Fri May 26 12:03:30 2017 +0900

    core: Fix for stuck key problem #441

being the culprit. The commit message says ....

Define NO_TRACK_KEY_PRESS to get old behaviour

And doing this gives me normal behaviour back without crashes.

For the moment I will test this setup to prove it's really stable for my daily work.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1844 on: Thu, 29 June 2017, 16:26:04 »
I did some more tests today and identified commit

commit ba2883fd9ab040fc670ad729e6cddd4c67c8188c
Author: tmk <hasu@tmk-kbd.com>
Date:   Fri May 26 12:03:30 2017 +0900

    core: Fix for stuck key problem #441

being the culprit. The commit message says ....

Define NO_TRACK_KEY_PRESS to get old behaviour

And doing this gives me normal behaviour back without crashes.

For the moment I will test this setup to prove it's really stable for my daily work.

Ah, good catch! I thought this #441 fix doesn't affect most of users... but a few still suffer.
With this fix builtin keymap actions should work as before but user defined actions may not work.

Can you post your keymap when you get time? I'm interested.

Offline Eugene94

  • Posts: 26
Re: TMK keyboard firmware
« Reply #1845 on: Sat, 08 July 2017, 12:38:56 »
Hello everyone! I have recently bought a HHKB Type-S along with a USB-USB Converter. I would like to have my "Fn" key switched with my "Caps" key, but I cannot seem to find where the "Fn" key is located on the TMK Keymap Editor...
172691-0
This is a shortened link https://goo.gl/tNGHBK to the TMK Keymap Editor with my desired layout. I hope there is a way to configure the layout that would switch the keys :thumb:

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1846 on: Sat, 08 July 2017, 17:23:17 »
Hi Eugene94,
First, you cannot remap 'Fn' key with USB-USB converter because the key doesn't send out keycode. This is one of limitation of the converter described in first post, check 'Limitation' section. https://geekhack.org/index.php?topic=69169.0
You need HHKB Alt controller to remap 'Fn' key. https://geekhack.org/index.php?topic=12047.0

Second, use 'L1' action to validate Layer 1, it is located in 'Layer Switching and etc.' tab of Keymap Editor.


Try this. I'd recommed to retain F1-F12, navigation and arrow key on Layer 0 to make original 'Fn' usable. With this keymap you can still use Fn+L for PageUp for example.
https://goo.gl/3CXUZf

Offline Eugene94

  • Posts: 26
Re: TMK keyboard firmware
« Reply #1847 on: Sat, 08 July 2017, 18:35:32 »
Hi Eugene94,
First, you cannot remap 'Fn' key with USB-USB converter because the key doesn't send out keycode. This is one of limitation of the converter described in first post, check 'Limitation' section. https://geekhack.org/index.php?topic=69169.0
You need HHKB Alt controller to remap 'Fn' key. https://geekhack.org/index.php?topic=12047.0

Second, use 'L1' action to validate Layer 1, it is located in 'Layer Switching and etc.' tab of Keymap Editor.


Try this. I'd recommed to retain F1-F12, navigation and arrow key on Layer 0 to make original 'Fn' usable. With this keymap you can still use Fn+L for PageUp for example.
https://goo.gl/3CXUZf

This worked perfectly! Thank you. I am also curious what difference does it make to make a key "NO" or "TRNS"?
« Last Edit: Sat, 08 July 2017, 18:37:25 by Eugene94 »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1848 on: Sun, 09 July 2017, 01:38:18 »
Hi Eugene94,
First, you cannot remap 'Fn' key with USB-USB converter because the key doesn't send out keycode. This is one of limitation of the converter described in first post, check 'Limitation' section. https://geekhack.org/index.php?topic=69169.0
You need HHKB Alt controller to remap 'Fn' key. https://geekhack.org/index.php?topic=12047.0

Second, use 'L1' action to validate Layer 1, it is located in 'Layer Switching and etc.' tab of Keymap Editor.


Try this. I'd recommed to retain F1-F12, navigation and arrow key on Layer 0 to make original 'Fn' usable. With this keymap you can still use Fn+L for PageUp for example.
https://goo.gl/3CXUZf

This worked perfectly! Thank you. I am also curious what difference does it make to make a key "NO" or "TRNS"?

Great. you can refer this for 'TRNS' and layer precedence.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/keymap.md#02-layer-precedence-and-transparency

Offline pabile

  • Posts: 158
  • Location: Southeast Asia
    • pabile online
Re: TMK keyboard firmware
« Reply #1849 on: Sun, 09 July 2017, 23:00:23 »
hi hasu & GH. i created firmware yesterday using the online editor. it has four layers. flashed to alps64 and work fine for a several minutes. after i restart my pc, the default layer became L3 (4th layer). i tried to reflash the firmware but still same result. i tried to generate another copy several times but still the same. i tried to generate 2 layers and it worked. i tried to recreate my 4-layer layout, flash to alps64 but still no good, 4th layer is still default.

does anyone experience this? this is my 2nd alps64 and not the first time to flash this board, used to work fine at first but need to modify layout/keymap. my first board has 3 layers and working fine for months now.

if it will help, L0 is default with Space FN, Caps Fn and another standard Fn button.