Author Topic: TMK keyboard firmware  (Read 826548 times)

0 Members and 4 Guests are viewing this topic.

Offline Dwarlorf

  • Posts: 100
  • Location: NL
Re: TMK keyboard firmware
« Reply #1600 on: Tue, 13 September 2016, 11:02:31 »
Now I still have these errors left:
Quote
keyboards/gh30/keymaps/default/keymap.c:91: error: expected expression before '=' token
keyboards/gh30/keymaps/default/keymap.c:95: error: too few arguments to function 'timer_elapsed'

Could you upload your full keymap to gist.github.com, or somewhere similar where it is easier to see line numbers? (bonus points if I can clone it too, to see it locally).

Dropbox

Github

If you need more please let me know. Thank you for your help once again.  :thumb:
  
E5XKBP10140                 GH60 Iso/Ansi hybrid, cherry mx red

Offline IBNobody

  • Posts: 113
Re: TMK keyboard firmware
« Reply #1601 on: Tue, 13 September 2016, 12:09:21 »
So... Obvious question... Why do you need MACRO_ONE defined when your keymap isn't calling it? If you deleted lines 87-104, your code would compile.

As to the errors. You need to define key_timer with a variable definition like "uint_16 key_timer;" on line 85 rather than a #define on 18. #defines are used to tell the compiler to do some magic code processing before the code actually gets compiled. For more info, google C preprocessor.

Note that I don't know the data type that timer_read returns. It could be uint_8 or int. You'd have to look up the timer_read function.


Also, you don't need persistant_default_layer_set(1UL<<LAYER_ONE);. That is only used to set the current layer and layer at power-on. As long as you never call persistant_default_layer_set, your QWERTY layer will always be the lowest default layer.

Offline algernon

  • Posts: 311
  • A tiny mouse, a hacker.
    • Diaries of a Madman
Re: TMK keyboard firmware
« Reply #1602 on: Tue, 13 September 2016, 16:28:42 »
Note that I don't know the data type that timer_read returns. It could be uint_8 or int. You'd have to look up the timer_read function.

It's uint16_t, fwiw.

Offline Dwarlorf

  • Posts: 100
  • Location: NL
Re: TMK keyboard firmware
« Reply #1603 on: Tue, 13 September 2016, 21:53:11 »
So... Obvious question... Why do you need MACRO_ONE defined when your keymap isn't calling it? If you deleted lines 87-104, your code would compile.

As to the errors. You need to define key_timer with a variable definition like "uint_16 key_timer;" on line 85 rather than a #define on 18. #defines are used to tell the compiler to do some magic code processing before the code actually gets compiled. For more info, google C preprocessor.

Note that I don't know the data type that timer_read returns. It could be uint_8 or int. You'd have to look up the timer_read function.

Also, you don't need persistant_default_layer_set(1UL<<LAYER_ONE);. That is only used to set the current layer and layer at power-on. As long as you never call persistant_default_layer_set, your QWERTY layer will always be the lowest default layer.

Its not so obvious to me.  I have little to no experience with programming. This is all new to me. I've been looking on the internet but one of the big problems with all those explanations is that they're all so cryptic because they're written by programmers for programmers and not for total inexperienced people like me.

But once again thank you for your help.

Note that I don't know the data type that timer_read returns. It could be uint_8 or int. You'd have to look up the timer_read function.

It's uint16_t, fwiw.

Thanks again. Ill look into it some more later.

« Last Edit: Tue, 13 September 2016, 21:57:44 by Dwarlorf »
  
E5XKBP10140                 GH60 Iso/Ansi hybrid, cherry mx red

Offline IBNobody

  • Posts: 113
Re: TMK keyboard firmware
« Reply #1604 on: Tue, 13 September 2016, 22:00:26 »
Haha, it's all good. We'll get you there.

Offline Dwarlorf

  • Posts: 100
  • Location: NL
Re: TMK keyboard firmware
« Reply #1605 on: Tue, 13 September 2016, 22:08:17 »
Haha, it's all good. We'll get you there.

I have no doubt!  :thumb:
  
E5XKBP10140                 GH60 Iso/Ansi hybrid, cherry mx red

Offline splicepoint

  • Posts: 8
Re: TMK keyboard firmware
« Reply #1606 on: Tue, 13 September 2016, 22:48:03 »
Hi all,

First time posting here. I'm working through my first mech build using a Phantom PCB and I'm having some trouble when trying to compile the file for flashing to my Teensy 2.0. I'm fairly inexperienced at programming other than some basics and looking for a hand, if someone doesn't mind having a look.

I know that my issue is occurring in the keymap.c file line 148 and that I'm missing an expression. I can get that much, but not so sure how to solve the issue. Any help would be greatly appreciated.

Edit: While the screenshot says otherwise (I was trying everything to get this to work) I've been using the "make -f Makefile.pjrc ansi" command via the console. The same error exists either way.

148269-0
148271-1
« Last Edit: Tue, 13 September 2016, 22:56:47 by splicepoint »

Offline Dwarlorf

  • Posts: 100
  • Location: NL
Re: TMK keyboard firmware
« Reply #1607 on: Thu, 15 September 2016, 05:02:32 »
Haha, it's all good. We'll get you there.

Well I managed to get it right! It's actually quite simple.
Note to self: stop thinking too complex. Start with the basics.

Code: [Select]
static uint16_t key_timer;

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
      switch(id) {
        case 4: {
            if (record->event.pressed) {
                key_timer = timer_read(); // if the key is being pressed, we start the timer.
            }
            else { // this means the key was just released, so we can figure out how long it was pressed for (tap or "held down").
                if (timer_elapsed(key_timer) > 150) { // 150 being 150ms, the threshhold we pick for counting something as a tap.
return MACRO( D(LSFT), T(D), U(LSFT), END);
                }
                else {
return MACRO( T(D), END);
                }
            }
            break;
        }
      }
    return MACRO_NONE;
};

And in the keymap I assigned M(4) to 'D'. (row 5, column 3)

Code: [Select]
[LAYER_ONE] = {
      { KC_9, KC_6, KC_3, KC_0, KC_UNDS, KC_ASTR, KC_BSPC },
      { KC_8, KC_5, KC_2, KC_SCOLON, KC_LPRN, KC_DOT, KC_ENT },
      { KC_7, KC_4, KC_1, KC_O, KC_N, KC_S, KC_SPACE },
      { XXXXXXX, XXXXXXX , XXXXXXX , KC_T, KC_E, KC_I, KC_TRNS },
      { XXXXXXX, KC_RIGHT, XXXXXXX, M(4), KC_A, KC_R, KC_DEL},
      { KC_UP, KC_LEFT, KC_DOWN, XXXXXXX, M_TWO, M_THREE, XXXXXXX  }

Now I'm wondering if there's a shorter way to program all this because now I need to assign a macro to every letter (and other symbols). That's a lot of code.
« Last Edit: Thu, 15 September 2016, 05:36:41 by Dwarlorf »
  
E5XKBP10140                 GH60 Iso/Ansi hybrid, cherry mx red

Offline algernon

  • Posts: 311
  • A tiny mouse, a hacker.
    • Diaries of a Madman
Re: TMK keyboard firmware
« Reply #1608 on: Thu, 15 September 2016, 05:37:05 »
Now I'm wondering if there's a shorter way to program all this because now I need to assign a macro every letter (and other symbol). That's a lot of code.

You can: implement `process_record_user`, a function that gets executed for each and every key pressed or released. In that function, you can do something like this (pseudo-code follows, because I don't have the time to write the real code for you):

Code: [Select]
if (!(key >= KC_A && key <= KC_Z))
  return true; // not a key we care about, let the default handler handle it
if (pressed) {
  start_timer_for_key(keycode);
} else {
  if (long_press) {
    register_shift;
    register_key;
    unregister_key;
    unregister_shift;
  } else {
    register_key;
    unregister_key;
  }
}

The downside of this is that you lose the ability to hold a key and have it repeat, and keys will only register on keyup. You could make it support holding too, if you'd hook into `matrix_scan_user`, and iterate over the keymap, checking for expired timers. But then you'd have to keep track of held keys too, to not register them twice or change the above logic to have a case for expired keys, too.

Hope this helps.

Offline Dwarlorf

  • Posts: 100
  • Location: NL
Re: TMK keyboard firmware
« Reply #1609 on: Thu, 15 September 2016, 05:59:39 »
Now I'm wondering if there's a shorter way to program all this because now I need to assign a macro every letter (and other symbol). That's a lot of code.

You can: implement `process_record_user`, a function that gets executed for each and every key pressed or released. In that function, you can do something like this (pseudo-code follows, because I don't have the time to write the real code for you):

The downside of this is that you lose the ability to hold a key and have it repeat, and keys will only register on keyup. You could make it support holding too, if you'd hook into `matrix_scan_user`, and iterate over the keymap, checking for expired timers. But then you'd have to keep track of held keys too, to not register them twice or change the above logic to have a case for expired keys, too.

Hope this helps.

I actually want to program as much as possible myself. All I need is being pointed to the right direction, and some help when I'm stuck.  And that's exactly what I'm getting from you guys. :) Thanks again.
Hold and repeat doesn't work now either so that's no problem. I don't think it's a very important feature anyway.
  
E5XKBP10140                 GH60 Iso/Ansi hybrid, cherry mx red

Offline splicepoint

  • Posts: 8
Re: TMK keyboard firmware
« Reply #1610 on: Fri, 16 September 2016, 21:51:48 »
Hi all,

First time posting here. I'm working through my first mech build using a Phantom PCB and I'm having some trouble when trying to compile the file for flashing to my Teensy 2.0. I'm fairly inexperienced at programming other than some basics and looking for a hand, if someone doesn't mind having a look.

I know that my issue is occurring in the keymap.c file line 148 and that I'm missing an expression. I can get that much, but not so sure how to solve the issue. Any help would be greatly appreciated.

Edit: While the screenshot says otherwise (I was trying everything to get this to work) I've been using the "make -f Makefile.pjrc ansi" command via the console. The same error exists either way.

(Attachment Link)
(Attachment Link)

Thanks to help from IBNobody and some others around reddit, I've been able to start compiling. However, now I'm stuck with only 8 functional keys. If spam enough keys at the same time periodically I will get some others that will briefly activate. This makes me think that I could possibly have a ghosting issue? Is this a fair assumption. I thought I checked the direction of each diode but could this be the problem?

Thanks in advance.

Offline IBNobody

  • Posts: 113
Re: TMK keyboard firmware
« Reply #1611 on: Fri, 16 September 2016, 23:31:59 »

Thanks to help from IBNobody and some others around reddit, I've been able to start compiling. However, now I'm stuck with only 8 functional keys. If spam enough keys at the same time periodically I will get some others that will briefly activate. This makes me think that I could possibly have a ghosting issue? Is this a fair assumption. I thought I checked the direction of each diode but could this be the problem?

Thanks in advance.

Glad to help.

In what condition did you receive the PCB. Did you have to populate the diodes? And how did you check their direction? What happens if you place a short across the switch? What happens when you place a short across the diode AND the switch? Could your diodes be reversed? Have any pics of the board?

Offline ctm

  • Posts: 424
  • Location: Seattle, WA
  • Hello, world!
Re: TMK keyboard firmware
« Reply #1612 on: Sat, 17 September 2016, 15:48:18 »
Is there a ACTION_FN_TAP_KEY? I would like to have Shift+Esc to produce ~, but my right shift has already been used as a ACTION_MODS_TAP_KEY(MOD_RSFT, KC_UP). Is it possible to have tapping Shift produces up arrow and holding the key produces ACTION_LAYER_MODS(3, MOD_RSFT)?
TMK Alps64 w/ Matias Quiet Switches in KBP V60 case.
Infinity60 with SKCM Orange Switches w/ TMK.
CM Storm QRF w/ Frosty Flake controller, Cherry MX Blue Switches and TMK firmware.


Coming:
Ellipse Model F F62.

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1613 on: Sat, 17 September 2016, 17:25:16 »
Is there a ACTION_FN_TAP_KEY? I would like to have Shift+Esc to produce ~, but my right shift has already been used as a ACTION_MODS_TAP_KEY(MOD_RSFT, KC_UP). Is it possible to have tapping Shift produces up arrow and holding the key produces ACTION_LAYER_MODS(3, MOD_RSFT)?

you need to write your own action in  action_function() and define it with ACTION_FUNCTION_TAP().

Offline ctm

  • Posts: 424
  • Location: Seattle, WA
  • Hello, world!
Re: TMK keyboard firmware
« Reply #1614 on: Sat, 17 September 2016, 18:26:09 »
Is there a ACTION_FN_TAP_KEY? I would like to have Shift+Esc to produce ~, but my right shift has already been used as a ACTION_MODS_TAP_KEY(MOD_RSFT, KC_UP). Is it possible to have tapping Shift produces up arrow and holding the key produces ACTION_LAYER_MODS(3, MOD_RSFT)?

you need to write your own action in  action_function() and define it with ACTION_FUNCTION_TAP().
Cool. Thanks!
TMK Alps64 w/ Matias Quiet Switches in KBP V60 case.
Infinity60 with SKCM Orange Switches w/ TMK.
CM Storm QRF w/ Frosty Flake controller, Cherry MX Blue Switches and TMK firmware.


Coming:
Ellipse Model F F62.

Offline splicepoint

  • Posts: 8
Re: TMK keyboard firmware
« Reply #1615 on: Sun, 18 September 2016, 22:15:03 »
In what condition did you receive the PCB. Did you have to populate the diodes? And how did you check their direction? What happens if you place a short across the switch? What happens when you place a short across the diode AND the switch? Could your diodes be reversed? Have any pics of the board?

The PCB looks great. I did have the populate the diodes, that's where I suspect the issue is. I can sometimes get keys working if I spam the whole keyboard at once. I tested the diodes using a multimeter to make sure they had a reading one direction but not the other; I installed all the diodes with the black line towards the square contact point on the PCB. Nothing is impossible and I'm wondering if I messed one up at some point, there are a few that have to be reversed based on location on the PCB.

I have not tried shorting the diode & switch (and then pressing the switch I assume?).

Here's an imgur album: http://imgur.com/gallery/jFj0p of some photos. Unfortunately I did an dumb thing and put the diodes on the underside so I'll need to desolder every switch to get back to that side of the PCB. As I mentioned, this is a first time for me so I'm learning as I go. I will likely desolder each switch at some point and get back to the top of the board in order to
then test the firmware without the keys in the board so I can adjust on the fly. It'll take me a while to desolder them so it may be a while before I post an update.

Any tips on testing/reworking or any additional insight on firmware vs. hardware I'm tracking this thread. Thanks!

Offline a-c

  • Posts: 196
  • Location: USA
Re: TMK keyboard firmware
« Reply #1616 on: Mon, 19 September 2016, 04:36:40 »
Is the Teensy soldered to the pins?

Here's an imgur album: http://imgur.com/gallery/jFj0p of some photos. Unfortunately I did an dumb thing and put the diodes on the underside so I'll need to desolder every switch to get back to that side of the PCB. As I mentioned, this is a first time for me so I'm learning as I go. I will likely desolder each switch at some point and get back to the top of the board in order to
then test the firmware without the keys in the board so I can adjust on the fly. It'll take me a while to desolder them so it may be a while before I post an update.

Any tips on testing/reworking or any additional insight on firmware vs. hardware I'm tracking this thread. Thanks!

Offline splicepoint

  • Posts: 8
Re: TMK keyboard firmware
« Reply #1617 on: Mon, 19 September 2016, 09:16:08 »
Is the Teensy soldered to the pins?

It is in indeed, I've tested the connections from each switch contact point on the PCB back to the Teensy with luck. The Teensy shouldn't be the issue.

Offline IBNobody

  • Posts: 113
Re: TMK keyboard firmware
« Reply #1618 on: Tue, 20 September 2016, 09:11:23 »
The PCB looks great. I did have the populate the diodes, that's where I suspect the issue is. I can sometimes get keys working if I spam the whole keyboard at once. I tested the diodes using a multimeter to make sure they had a reading one direction but not the other; I installed all the diodes with the black line towards the square contact point on the PCB. Nothing is impossible and I'm wondering if I messed one up at some point, there are a few that have to be reversed based on location on the PCB.

I have not tried shorting the diode & switch (and then pressing the switch I assume?).

Here's an imgur album: http://imgur.com/gallery/jFj0p of some photos. Unfortunately I did an dumb thing and put the diodes on the underside so I'll need to desolder every switch to get back to that side of the PCB. As I mentioned, this is a first time for me so I'm learning as I go. I will likely desolder each switch at some point and get back to the top of the board in order to
then test the firmware without the keys in the board so I can adjust on the fly. It'll take me a while to desolder them so it may be a while before I post an update.

Any tips on testing/reworking or any additional insight on firmware vs. hardware I'm tracking this thread. Thanks!

Thanks for the pictures.

The code is set up to look for a logic 0 on the rows. Normally, the rows float at 3-5V due to some internal pullup resistors. The code is also set up to drive the active column to 0. When you push a switch and the column that the switch is on is active, it pulls the row line down to 0. If you have diodes backwards, this will not happen.

Without plugging your board in... If you put the + terminal of your DMM (in Diode mode) on a row (B0-B5), put the - terminal on the column with a switch (D5  C7  C6  D4  D0  E6  F0  F1  F4  F5  F6  F7  D7  D6  D1  D2  D3), and press the switch, do you read the diode voltage drop (of around 0.63V)?

Also, have you confirmed that there are no shorts between pins? It looks like you mounted your teensy flush against the PCB. That may be a source of the problem. Whenever I do that, I always put a barrier of nonconductive tape on the bottom of the teensy.

Finally, dumb question... Where did you buy your Teensy?

Offline kekstee

  • Posts: 314
Re: TMK keyboard firmware
« Reply #1619 on: Tue, 20 September 2016, 18:57:09 »
So I got a NerD60 flashed with tmk. And it almost behaves like I would expect it to.
But despite every LED working in backlight mode the caps lock indicator just refuses to do anything. As far as I understand it that should work out of the box, reporting its status through the led_set function.
Or am I missing something obvious?

I tried excluding the caps bit from backlight_init_ports, thinking it might interfere, but that didn't change anything.
https://github.com/tmk/tmk_keyboard/blob/master/orphan/nerd/backlight.c

Also, why does not setting the backlight port as output in DDRB just dim the backlight?
« Last Edit: Tue, 20 September 2016, 19:26:54 by kekstee »

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1620 on: Tue, 20 September 2016, 19:35:58 »
So I got a NerD60 flashed with tmk. And it almost behaves like I would expect it to.
But despite every LED working in backlight mode the caps lock indicator just refuses to do anything. As far as I understand it that should work out of the box, reporting its status through the led_set function.
Or am I missing something obvious?

I tried excluding the caps bit from backlight_init_ports, thinking it might interfere, but that didn't change anything.
https://github.com/tmk/tmk_keyboard/blob/master/orphan/nerd/backlight.c

Also, why does not setting the backlight port as output in DDRB just dim the backlight?


What if with orignial author's repository?
https://github.com/xauser/tmk_keyboard/tree/xauser

Offline kekstee

  • Posts: 314
Re: TMK keyboard firmware
« Reply #1621 on: Wed, 21 September 2016, 04:38:38 »
I did test it again, same result. Then I finally managed to google up the answer I needed in the first place. The caps indicator LED is on the PCB next to it, not the in switch LED :D
Thanks for directing me towards the original author though, I could have asked him if it was a software problem.

Offline axtran

  • Posts: 456
  • Location: Washington, DC, USA
Re: TMK keyboard firmware
« Reply #1622 on: Thu, 22 September 2016, 07:01:56 »
I did test it again, same result. Then I finally managed to google up the answer I needed in the first place. The caps indicator LED is on the PCB next to it, not the in switch LED :D
Thanks for directing me towards the original author though, I could have asked him if it was a software problem.

Glad hasu was able to help. Yeah, the LED pins for "Indicator" are what drive the caps notification. I usually use clear housing switch and a "creatively installed" RGB LED in order to get my desired results with the Caps functionality: http://imgur.com/zz0bXnU
MX Silent > MX Vintage Black > Everything Else

Offline lkong

  • Posts: 78
  • Location: United States
Re: TMK keyboard firmware
« Reply #1623 on: Wed, 28 September 2016, 12:06:26 »
I recently made a hand-wired keyboard using tmk firmware.
it works perfectly on one machine but not the other.
Works on Surface Book, also inside a linux VM:

Pressing f gives f back

But not the other machine

Pressing f gives f and v back

Any ideas why it is happening?

Offline IBNobody

  • Posts: 113
Re: TMK keyboard firmware
« Reply #1624 on: Wed, 28 September 2016, 13:10:47 »
You are firing modifier keys. That's why you see the ribbon menu in Word flash. Grab Switch Hitter. That will help diagnose misfiring keys.

https://elitekeyboards.com/switchhitter.php

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1625 on: Wed, 28 September 2016, 16:37:40 »
 lkong,
What are OS on "Surface Book"  and "the other"?
Smell like NKRO. Are you using NKRO?

Offline lkong

  • Posts: 78
  • Location: United States
Re: TMK keyboard firmware
« Reply #1626 on: Wed, 28 September 2016, 17:09:06 »
lkong,
What are OS on "Surface Book"  and "the other"?
Smell like NKRO. Are you using NKRO?
Surface Book is running Win10
The other is my office computer running Win7.
It also misbehaves on my home computer which is running Win10.

And no, NKRO is turned off.

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1627 on: Wed, 28 September 2016, 17:27:04 »
Then it is likely your hardware or code. Use the tool as IBNobody said.

Sent from my Nexus 5X


Offline lkong

  • Posts: 78
  • Location: United States
Re: TMK keyboard firmware
« Reply #1628 on: Wed, 28 September 2016, 22:54:08 »
Then it is likely your hardware or code. Use the tool as IBNobody said.

Sent from my Nexus 5X

Tested this on my home computer the whole row was firing.
It's connected to B2 pin on the teensy 2.0 Is that the pin I suppose to avoid?
The misfiring occurs even if I desoldered the wire connected to the particular row.
So it's definitely software/code coursing a whole row firing.
« Last Edit: Wed, 28 September 2016, 23:04:46 by lkong »

Offline IBNobody

  • Posts: 113
Re: TMK keyboard firmware
« Reply #1629 on: Wed, 28 September 2016, 23:24:08 »
That's awesome. What key are you hitting in that picture?

B2 is fine to use.

Do you have your diodes backwards maybe?

Offline lkong

  • Posts: 78
  • Location: United States
Re: TMK keyboard firmware
« Reply #1630 on: Wed, 28 September 2016, 23:41:51 »
That's awesome. What key are you hitting in that picture?

B2 is fine to use.

Do you have your diodes backwards maybe?
A whole row:
Alt, z, x, c, v, b, Esc, Num layer.
As shown as the third row and 6th row (they are connected by wire) on the left hand.
    /*  _________________________________________                     _________________________________________  */
    /* |      |      |      |      |      |      |                   |      |      |      |      |      |      | */
    /* | SHFT |  Q   |  W   |  E   |  R   |  T   |                   |  Y   |  U   |  I   |  O   |  P   | SHFT | */
    /* |______|______|______|______|______|______|                   |______|______|______|______|______|______| */
    /* |      |      |      |      |      |      |                   |      |      |      |      |      |      | */
    /* | CTRL |  A   |  S   |  D   |  F   |  G   |                   |  H   |  J   |  K   |  L   |  ;   |  CMD | */
    /* |______|______|______|______|______|______|                   |______|______|______|______|______|______| */
    /* |      |      |      |      |      |      |                   |      |      |      |      |      |      | */
    /* |  ALT |  Z   |  X   |  C   |  V   |  B   |                   |  N   |  M   |  ,   |  .   |  /   |  ALT | */
    /* |______|______|______|______|______|______|_                 _|______|______|______|______|______|______| */
    /*                               |      |      |               |      |      |                               */
    /*                               | BSPC | CMD  |               | CTRL | SPC  |                               */
    /*                               |      |      |               |      |      |                               */
    /*                               |______|______|_             _|______|______|                               */
    /*                                 |      |      |           |      |      |                                 */
    /*                                 | TAB  | SYM  |           | SYM  |  ENT |                                 */
    /*                                 |______|_LYR__|_         _|_LYR__|______|                                 */
    /*                                   |      |      |       |      |      |                                   */
    /*                                   |  ESC | NUM  |       | AROW | ALT  |                                   */
    /*                                   |______|_LYR__|       |__LYR_|______|                                   */
    /*                                                                                                           */
    /*                                                                                                           */
    /*                                                                                                           */

Offline lkong

  • Posts: 78
  • Location: United States
Re: TMK keyboard firmware
« Reply #1631 on: Wed, 28 September 2016, 23:42:28 »
That's awesome. What key are you hitting in that picture?

B2 is fine to use.

Do you have your diodes backwards maybe?
Diodes are fine.
It's firing the whole row:
Alt, z, x, c, v, b, Esc, Num layer.
As shown as the third row and 6th row (they are connected by wire) on the left hand.
    /*  _________________________________________                     _________________________________________  */
    /* |      |      |      |      |      |      |                   |      |      |      |      |      |      | */
    /* | SHFT |  Q   |  W   |  E   |  R   |  T   |                   |  Y   |  U   |  I   |  O   |  P   | SHFT | */
    /* |______|______|______|______|______|______|                   |______|______|______|______|______|______| */
    /* |      |      |      |      |      |      |                   |      |      |      |      |      |      | */
    /* | CTRL |  A   |  S   |  D   |  F   |  G   |                   |  H   |  J   |  K   |  L   |  ;   |  CMD | */
    /* |______|______|______|______|______|______|                   |______|______|______|______|______|______| */
    /* |      |      |      |      |      |      |                   |      |      |      |      |      |      | */
    /* |  ALT |  Z   |  X   |  C   |  V   |  B   |                   |  N   |  M   |  ,   |  .   |  /   |  ALT | */
    /* |______|______|______|______|______|______|_                 _|______|______|______|______|______|______| */
    /*                               |      |      |               |      |      |                               */
    /*                               | BSPC | CMD  |               | CTRL | SPC  |                               */
    /*                               |      |      |               |      |      |                               */
    /*                               |______|______|_             _|______|______|                               */
    /*                                 |      |      |           |      |      |                                 */
    /*                                 | TAB  | SYM  |           | SYM  |  ENT |                                 */
    /*                                 |______|_LYR__|_         _|_LYR__|______|                                 */
    /*                                   |      |      |       |      |      |                                   */
    /*                                   |  ESC | NUM  |       | AROW | ALT  |                                   */
    /*                                   |______|_LYR__|       |__LYR_|______|                                   */
    /*                                                                                                           */
    /*                                                                                                           */
    /*                                                                                                           */

Offline Dwarlorf

  • Posts: 100
  • Location: NL
Re: TMK keyboard firmware
« Reply #1632 on: Thu, 29 September 2016, 00:01:59 »
That's awesome. What key are you hitting in that picture?

B2 is fine to use.

Do you have your diodes backwards maybe?
A whole row:
Alt, z, x, c, v, b, Esc, Num layer.

I had a similar problem with a column and it turned out I forgot a pin in the col init function in the matrix .c file. Maybe it's a similar problem with your row? I'm guessing here since I'm by no means an expert.
  
E5XKBP10140                 GH60 Iso/Ansi hybrid, cherry mx red

Offline lkong

  • Posts: 78
  • Location: United States
Re: TMK keyboard firmware
« Reply #1633 on: Thu, 29 September 2016, 00:41:06 »
That's awesome. What key are you hitting in that picture?

B2 is fine to use.

Do you have your diodes backwards maybe?
A whole row:
Alt, z, x, c, v, b, Esc, Num layer.

I had a similar problem with a column and it turned out I forgot a pin in the col init function in the matrix .c file. Maybe it's a similar problem with your row? I'm guessing here since I'm by no means an expert.
Fixed the problem is B2 is used in led.c.
So that it gets all funky to trigger the whole row.
Still have no idea why it works on Surface Book but nothing else.

Offline XenGi

  • Posts: 1
  • Location: Berlin, Germany
    • blog
Re: TMK keyboard firmware
« Reply #1634 on: Sun, 02 October 2016, 17:54:19 »
Hi,

I'm a bit confused. I made my own keyboard with a custom layout. Next step is the firmware. It would be cool to use the tmk one but I'm not sure if this is possible.

Here's my layout for keyboard layout editor: gist

Here's the hardware: http://imgur.com/a/Vwe7P

Is it possible to use the tmk firmware for this? Because I can only find 40% keyboards or ergodox. I thought I could just put my layout in a config file, define some pins and done. Can anyone point me in the right directions? I can't find a step by step guide how to get started with this.

PS:
I have 9 more plates with this layout. My brother made these with a big laser cnc at work. It's 5 different types of steel. I can make pictures if your interested.
So if anyone likes the layout and wants a plate I can ship them basically anywhere in exchange for something nice or interesting. Candy is always a good choice. ;)
"CM Storm Quickfire TK White" title="CM Storm Quickfire TK White" "meckbd_v1" title="meckbd_v1"

XG_

Offline ideus

  • * Exalted Elder
  • Posts: 8123
  • Location: In the middle of nowhere.
  • Björkö.
Re: TMK keyboard firmware
« Reply #1635 on: Wed, 05 October 2016, 08:54:45 »
What the code is to get double functionality for an ESC and ~' key, combined.

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1636 on: Wed, 05 October 2016, 20:33:46 »
What the code is to get double functionality for an ESC and ~' key, combined.

I don't know how these two keys can be combined. You have a idea?

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1637 on: Wed, 05 October 2016, 20:37:29 »
Checked ****ing FAQ and found this. You may be interested.
https://github.com/tmk/tmk_keyboard/wiki/FAQ-Keymap#esc-and--on-a-key

Offline ideus

  • * Exalted Elder
  • Posts: 8123
  • Location: In the middle of nowhere.
  • Björkö.
Re: TMK keyboard firmware
« Reply #1638 on: Wed, 05 October 2016, 22:59:53 »
Checked ****ing FAQ and found this. You may be interested.
https://github.com/tmk/tmk_keyboard/wiki/FAQ-Keymap#esc-and--on-a-key


This is it, you are a life saver Sir Hasu. Thank you very much.

Offline SirFabular

  • Posts: 3
  • Location: Finland
Re: TMK keyboard firmware
« Reply #1639 on: Fri, 07 October 2016, 10:26:34 »
Hi,
I've previously with success used this firmware for two custom keyboards without any problems, but this time cant find the error even when comparing against my earlier builds. The error is keymap_poker.c:16: error: expected '}' before 'KC_NO'

This is my keymap_common.h
Code: [Select]
#define KEYMAP( \
    K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
    K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
    K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, \
    K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, \
    K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, \
    K50, K51, K52,                         K56,                         K5A, \
    K60, K61, K62, K63, K64, K65, K66, K67, K68, K69, K6A, \
    K70, K71,         K73, K74, K75, K76, K77, K78, K79, K7A, \
    K80, K81,         K83, K84, K85, K86, K87, K88, K89, K8A, \
    K90, K91,                 K94, K95, K96, K97, K98, K99,      \
    KA0,         KA2,         KA4, KA5, KA6, KA7, KA8, KA9, KAA, \
    KB0, KB1,         KB3, KB4, KB5, KB6,         KB8, KB9       \
) { \
    { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A }, \
    { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A }, \
    { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A }, \
    { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A }, \
{ KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47, KC_##K48, KC_##K49, KC_##K4A }, \
    { KC_##K50, KC_##K51, KC_##K52, KC_NO,   KC_NO,    KC_NO,    KC_##K56  KC_NO,    KC_NO,    KC_NO,    KC_##K5A }, \
{ KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67, KC_##K68, KC_##K69, KC_##K6A }, \
    { KC_##K70, KC_##K71, KC_NO,    KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77, KC_##K78, KC_##K79, KC_##K7A }, \
    { KC_##K80, KC_##K81, KC_NO,    KC_##K83, KC_##K84, KC_##K85, KC_##K86, KC_##K87, KC_##K88, KC_##K89, KC_##K8A }, \
    { KC_##K90, KC_##K91, KC_NO,    KC_NO,    KC_##K94, KC_##K95, KC_##K96, KC_##K97, KC_##K98, KC_##K99, KC_NO    }, \
{ KC_##KA0, KC_NO,    KC_##KA2, KC_NO,    KC_##KA4, KC_##KA5, KC_##KA6, KC_##KA7, KC_##KA8, KC_##KA9, KC_##KAA }, \
{ KC_##KB0, KC_##KB1, KC_NO,    KC_##KB3, KC_##KB4, KC_##KB5, KC_##KB6, KC_NO,    KC_##KB8, KC_##KB9, KC_NO    }  \
}

#endif

And this is the keymap_poker.c
Code: [Select]
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

 KEYMAP(ESC,    F1,     F2,     F3,     F4,     F5,     F6,     F7,     F8,     F9,     F10,    \
        GRV,    1,      2,      3,      4,      5,      6,      7,      8,      9,      0,      \
        TAB,    Q,      W,      E,      R,      T,      Y,      U,      I,      O,      P,      \
        CAPS,   A,      S,      D,      F,      G,      H,      J,      K,      L,      SCLN,   \
        LSFT,   NUBS,   Z,      X,      C,      V,      B,      N,      M,      COMM,   DOT,    \
        LCTL,   LGUI,   LALT,                           SPC,                            RALT,   \
        F11,    F12,    F13,    F14,    PSCR,   SLCK,   PAUS,   CALC,   MYCM,   WHOM,   PWR,    \
        MINS,   EQL,            BSPC,   INS,    HOME,   PGUP,   NLCK,   PSLS,   PAST,   PMNS,   \
        LBRC,   RBRC,           ENT,    DELETE, END,    PGDN,   P7,     P8,     P9,     PPLS,   \
        QUOT,   BSLS,                   VOLU,   MUTE,   NO,     P4,     P5,     P6,             \
        SLSH,           RSFT,           VOLD,   UP,     NO,     P1,     P2,     P3,     PENT,   \
        RGUI,   NO,             RCTL,   LEFT,   DOWN,   RGHT,           P0,     PDOT)
};

Any help is appreciated since I'm stuck here.

Offline Tactile

  • Posts: 1433
  • Location: Portland, OR
Re: TMK keyboard firmware
« Reply #1640 on: Fri, 07 October 2016, 10:36:35 »
I think "PDOT)" should be "PDOT),"
REΛLFORCE

Offline SirFabular

  • Posts: 3
  • Location: Finland
Re: TMK keyboard firmware
« Reply #1641 on: Fri, 07 October 2016, 10:43:25 »
Thanks, but that comma seems to have no impact on the error message.

Offline SirFabular

  • Posts: 3
  • Location: Finland
Re: TMK keyboard firmware
« Reply #1642 on: Fri, 07 October 2016, 13:07:30 »
Nevermind. I still dont have any idea what caused the error, but it works now after rewriting everything. :thumb:

Offline kalmlikabohm

  • Posts: 13
Re: TMK keyboard firmware
« Reply #1643 on: Fri, 07 October 2016, 15:54:24 »
First time posting!

I have a switch tester on the way and I wanted to hand wire it, so I figured I would try the OneKey keyboard folder within the TMK project with my Teensy 2.0

However, I get the same linker error on both Ubuntu and OS X.

Does anyone have any idea what is going on? I just wanted to make sure I can compile and download a simple firmware before going forward.


Code: [Select]
obj_onekey_lufa/common/keymap.o: In function `keymap_key_to_keycode':
/Users/mhiggins/projects/tmk_keyboard/keyboard/onekey/../../tmk_core/common/keymap.c:236: undefined reference to `keymaps'
/Users/mhiggins/projects/tmk_keyboard/keyboard/onekey/../../tmk_core/common/keymap.c:236: undefined reference to `keymaps'
obj_onekey_lufa/common/keymap.o: In function `keymap_fn_to_action':
/Users/mhiggins/projects/tmk_keyboard/keyboard/onekey/../../tmk_core/common/keymap.c:246: undefined reference to `fn_actions'
/Users/mhiggins/projects/tmk_keyboard/keyboard/onekey/../../tmk_core/common/keymap.c:246: undefined reference to `fn_actions'
collect2: error: ld returned 1 exit status
make: *** [onekey_lufa.elf] Error 1




Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1644 on: Fri, 07 October 2016, 16:00:36 »
Did you edit any files? Or do you still get the error with default codes?

Sent from my Nexus 5X


Offline kalmlikabohm

  • Posts: 13
Re: TMK keyboard firmware
« Reply #1645 on: Fri, 07 October 2016, 16:04:42 »
Did you edit any files? Or do you still get the error with default codes?

Sent from my Nexus 5X

I didn't edit any files, just git clone and make!


Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1646 on: Fri, 07 October 2016, 16:06:56 »
OK. I'll check recent commits later which might break existent codes.

Sent from my Nexus 5X


Offline kalmlikabohm

  • Posts: 13
Re: TMK keyboard firmware
« Reply #1647 on: Fri, 07 October 2016, 16:08:22 »
OK. I'll check recent commits later which might break existent codes.

Sent from my Nexus 5X

Awesome! Thanks for the quick reply. I'm excited to get into TMK.

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1648 on: Fri, 07 October 2016, 17:15:20 »
OK. I'll check recent commits later which might break existent codes.

Sent from my Nexus 5X

Awesome! Thanks for the quick reply. I'm excited to get into TMK.

Remove 'static' keywords from keymap.c. It will update in repository later.

https://github.com/tmk/tmk_keyboard/issues/56#issuecomment-252373646

Offline Eszett

  • Posts: 543
  • Supporting the communities Geekhack & Deskthority
Re: TMK keyboard firmware
« Reply #1649 on: Sat, 08 October 2016, 09:48:54 »
The keycodes KC_COPY and KC_PASTE doesn't seem to work for me, anyone got an idea what might be the issue?