Author Topic: TMK keyboard firmware  (Read 641100 times)

0 Members and 2 Guests are viewing this topic.

Offline seattle_ice

  • Posts: 28
Re: TMK keyboard firmware
« Reply #1750 on: Thu, 22 December 2016, 04:36:14 »
Ok, I got to the point where I tried to compile my firmware, and I got the following error. I did install the latest avr gcc just to make sure, but no change:

155892-0

Offline fiete

  • Posts: 11
Re: TMK keyboard firmware
« Reply #1751 on: Thu, 22 December 2016, 04:42:00 »
Hi seattle_ice,

have you also installed the packages: avr-libc binutils-avr gcc-avr avrdude

Regards
Fritz

Offline hasu

  • Thread Starter
  • Posts: 3315
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1752 on: Thu, 22 December 2016, 05:07:10 »
Scenario...
- Default layer on my alps64 uses space to momentary switch to Layer 4 (SpaceFN) and Application key to toggle switch to Layer 1 (T1).
(Attachment Link)

- Layer 4 has my F rows et al
(Attachment Link)

- Layer 1 uses a regular space and uses CapsLock to switch to Layer 4
(Attachment Link)


Now for my question...
In Layer 4, do i need to define CapsLock as L4? How about spacebar as SpaceFN(L4)?
Yes, you need. But I would place spaceFN on later 1 and other on higher layer, with this you can use TRNS instead of L4.

Offline pabile

  • Posts: 157
  • Location: Southeast Asia
    • pabile online
Re: TMK keyboard firmware
« Reply #1753 on: Thu, 22 December 2016, 06:20:57 »
Yes, you need. But I would place spaceFN on later 1 and other on higher layer, with this you can use TRNS instead of L4.

hi hasu! i actually need at least one layer with regular spacebar for gaming purposes. thanks

edit:
i was re-reading your comment and i didnt think i undertood it at first. but now, i think it made sense. instead of T1, may i could use T5 instead. this way, i dont need to re-declare L4 in my spacebar. i hope i understood it correctly. thanks again for everything, hasu!

update: shoot! there's no T5... i think i'll be needing those alps lock switches.

« Last Edit: Thu, 22 December 2016, 08:23:21 by pabile »

Offline seattle_ice

  • Posts: 28
Re: TMK keyboard firmware
« Reply #1754 on: Fri, 23 December 2016, 02:46:52 »
Hi seattle_ice,

have you also installed the packages: avr-libc binutils-avr gcc-avr avrdude

Regards
Fritz

I made sure those were all installed, and I have gotten it to compile now.

I am now getting an error about 'sh: 1: dfu-programmer: not found'

I also do not fully understand the key mapping.  For instance, when I look at the following in the 'keymap_plain.c', I do not understand where the values come from, since it seems like there are about 10 different values used for the same keys in different examples.

Code: [Select]
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* 0: qwerty */
    KEYMAP(ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC, \
           TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS, \
           CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,NO,  ENT,  \
           LSFT,NO,  Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,NO,  RSFT, \
           LCTL,LGUI,LALT,          SPC,                     RALT,RGUI,APP, RCTL),
};
const action_t PROGMEM fn_actions[] = {};

Offline fiete

  • Posts: 11
Re: TMK keyboard firmware
« Reply #1755 on: Fri, 23 December 2016, 02:50:00 »
I am now getting an error about 'sh: 1: dfu-programmer: not found'

just install the package dfu-programmer

Offline fiete

  • Posts: 11
Re: TMK keyboard firmware
« Reply #1756 on: Fri, 23 December 2016, 02:54:40 »
I also do not fully understand the key mapping.  For instance, when I look at the following in the 'keymap_plain.c', I do not understand where the values come from, since it seems like there are about 10 different values used for the same keys in different examples.

Code: [Select]
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* 0: qwerty */
    KEYMAP(ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC, \
           TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS, \
           CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,NO,  ENT,  \
           LSFT,NO,  Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,NO,  RSFT, \
           LCTL,LGUI,LALT,          SPC,                     RALT,RGUI,APP, RCTL),
};
const action_t PROGMEM fn_actions[] = {};

Just take a look at keymap_common.h and keycode.h that should answer that question.

The name for the keycodes are derived from an us keyboard. so COMM sends the keycode of the key that produces a comma on us layout.

Regards Fritz

Offline hasu

  • Thread Starter
  • Posts: 3315
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1757 on: Fri, 23 December 2016, 02:58:31 »
Yes, you need. But I would place spaceFN on later 1 and other on higher layer, with this you can use TRNS instead of L4.

hi hasu! i actually need at least one layer with regular spacebar for gaming purposes. thanks

edit:
i was re-reading your comment and i didnt think i undertood it at first. but now, i think it made sense. instead of T1, may i could use T5 instead. this way, i dont need to re-declare L4 in my spacebar. i hope i understood it correctly. thanks again for everything, hasu!

update: shoot! there's no T5... i think i'll be needing those alps lock switches.



Right, to use T5 is another solution for this.
New keymap editor should have T5, check first post of Alps64 again.

Offline henz

  • * Exquisite Elder
  • Posts: 1284
  • What?
Re: TMK keyboard firmware
« Reply #1758 on: Fri, 23 December 2016, 03:01:32 »
ive updated the KMAC fork, it now supports the kmac mini as well. Havent bothered about the leds though.

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: TMK keyboard firmware
« Reply #1759 on: Fri, 23 December 2016, 03:09:20 »
I am now getting an error about 'sh: 1: dfu-programmer: not found'
Try (re)installing the dfu-programmer

Code: [Select]
sudo apt-get install dfu-programmerReplace apt-get with yum if you're on a Fedora based distribution.


I do not understand where the values come from
If you mean the KC_ constants, You can find them in ./tmk_core/common/keycode.h

it seems like there are about 10 different values used for the same keys in different examples.
There are aliases indeed.


Code: [Select]
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* 0: qwerty */
    KEYMAP(ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC, \
           TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS, \
           CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,NO,  ENT,  \
           LSFT,NO,  Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,NO,  RSFT, \
           LCTL,LGUI,LALT,          SPC,                     RALT,RGUI,APP, RCTL),
};
const action_t PROGMEM fn_actions[] = {};
This is the default layer for a 60% board (GH60?), if you want additional layers, just copy the KEYMAP() block and populate the matrix, every block will count as a layer.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline TheDrsh

  • Posts: 1
Re: TMK keyboard firmware
« Reply #1760 on: Fri, 23 December 2016, 18:43:55 »
Hey,

I read a post before on a different forum about having more columns on a keyboard(I'm making a full keyboard) in the "read_cols" function of matrix.c the it will only return columns less than 8 shifts, so my first 8 columns of the keyboard work but not the rest, I tried using the methods you suggested(1UL<<16), (uint32_t)(1<<16), etc but I cannot seem to get it to work, any suggestions? Also, I've attached my matrix .c file.

EDIT:
Using teensy2.0++
« Last Edit: Fri, 23 December 2016, 18:49:59 by TheDrsh »

Offline 0xBeFa

  • Posts: 2
Re: TMK keyboard firmware
« Reply #1761 on: Sun, 25 December 2016, 10:58:24 »
Hey,

I read a post before on a different forum about having more columns on a keyboard(I'm making a full keyboard) in the "read_cols" function of matrix.c the it will only return columns less than 8 shifts, so my first 8 columns of the keyboard work but not the rest, I tried using the methods you suggested(1UL<<16), (uint32_t)(1<<16), etc but I cannot seem to get it to work, any suggestions? Also, I've attached my matrix .c file.

EDIT:
Using teensy2.0++

is your matrix size set up correct? check it in config.h

Code: [Select]
/* key matrix size */
#define MATRIX_ROWS 8
#define MATRIX_COLS 19

i have 18 colums working on teensy2.0++

Offline 0xBeFa

  • Posts: 2
Re: TMK keyboard firmware
« Reply #1762 on: Sun, 25 December 2016, 11:21:19 »
QWERTY to QWERTZ Keymap

I made a keymap that mimics an US layout on a PC that is set to German (DE) keyboard layout.
This allows the use of an standard US layout witch is way better for programming c-style languages but also german "Umlaute" can be mapped on additional layers.
Following special characters can be input though layer 3 and 4:
Also the degree sign is accessible on layer 3:

I'm using extended keymap instead of macros. Tested on Win7 and Ubuntu 16.04.
I share the code here if anyone else want to use it.

Code: [Select]
#include "extended_keymap_common.h"
#include "../keymap_rapooV500.h"

// QWERTY to QWERTZ:
// ROW 2, no shift
#define EN_GRAVE     S(KC_EQUAL)
#define EN_MINUS     KC_SLASH
#define EN_EQUAL     S(KC_0)
// ROW 3, no shift
#define EN_BRC_SQ_L  RALT(KC_8)
#define EN_BRC_SQ_R  RALT(KC_9)
#define EN_BSLS      RALT(KC_MINUS)
// ROW 4, no shift
#define EN_SCLN      S(KC_COMM)
#define EN_QUOT      S(KC_NONUS_HASH)
// ROW 5, no shift
#define EN_SLSH      S(KC_7)
// ROW 2, shift
#define EN_TILDE     RALT(KC_RBRACKET)
#define EN_AT        RALT(KC_Q)
#define EN_HASH      KC_NONUS_HASH
#define EN_CRCMFLX   KC_GRV
#define EN_ASTRSK    S(KC_RBRACKET)
#define EN_PLUS      KC_RBRACKET
// ROW 3, shift
#define EN_BRC_CU_L  RALT(KC_7)
#define EN_BRC_CU_R  RALT(KC_0)
#define EN_VSTROKE   RALT(KC_NUBS)
// ROW 4, shift     
#define EN_COLON     S(KC_DOT)
#define EN_DQUOTE    S(KC_2)
// ROW 5, shift     
#define EN_BRC_TR_L  KC_NUBS
#define EN_BRC_TR_R  S(KC_NUBS)
#define EN_QMARK     S(KC_MINUS)

// German Umlaute:
#define DE_sz       KC_MINUS
#define DE_OE       KC_SCLN
#define DE_UE       KC_LBRACKET     
#define DE_AE       KC_QUOTE   
#define DE_DEGREE   S(KC_GRAVE)

#define MY_LAYER_SHIFT 1
#define MY_LAYER_MOD   2
#define MY_LAYER_MODSHIFT 3
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
   [0]=KEYMAP_RAPOOV500(   
// Base Layer:─
// ┌───────────┬───────────┬───────────┬───────────┬───────────┬───────────┬───────────┬───────────┬───────────┬───────────┬───────────┬───────────┬───────────┬───────────┬───────────┐  ┌───────────┬───────────┬───────────┐
// │           │           │           │           │           │           │           │           │           │           │           │           │           │           │           │  │           │           │           │18
     KC_ESC    , KC_F1     , KC_F2     , KC_F3     , KC_F4     , KC_F5     , KC_F6     , KC_F7     , KC_F8     , KC_F9     , KC_F10    , KC_F11    , KC_F12    , KC_NO     , KC_NO     ,    KC_NO     , KC_NO     , KC_NO     ,
// │           │           │           │           │           │           │           │           │           │           │           │           │           │           │           │  │           │           │           │
// ├───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┴───────────┤  ├───────────┼───────────┼───────────┤
// │ --------  │           │           │           │           │           │           │           │           │           │           │ --------  │---------  │                       │  │           │           │           │17
     EN_GRAVE  , KC_1      , KC_2      , KC_3      , KC_4      , KC_5      , KC_6      , KC_7      , KC_8      , KC_9      , KC_0      , EN_MINUS  , EN_EQUAL  , KC_BSPACE             ,   KC_PSCREEN , KC_NO     , KC_PAUSE  ,
// │           │           │           │           │           │           │           │           │           │           │           │           │           │                       │  │           │           │           │
// ├───────────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────────────────┤  ├───────────┼───────────┼───────────┤
// │               │           │           │           │           │           │           │           │           │           │           │-----------│-----------│ -------           │  │           │           │           │17
     KC_TAB        , KC_Q      , KC_W      , KC_E      , KC_R      , KC_T      , KC_Z      , KC_U      , KC_I      , KC_O      , KC_P      ,EN_BRC_SQ_L,EN_BRC_SQ_R, EN_BSLS           ,    KC_INSERT , KC_HOME   , KC_PGUP   ,
// │               │           │           │           │           │           │           │           │           │           │           │           │           │                   │  │           │           │           │
// ├───────────────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───────────────────┤  ├───────────┼───────────┼───────────┤
// │ to mod layer      │           │           │           │           │           │           │           │           │           │ -------   │ -------   │                           │  │           │           │           │16
     KC_FN2            , KC_A      , KC_S      , KC_D      , KC_F      , KC_G      , KC_H      , KC_J      , KC_K      , KC_L      , EN_SCLN   , EN_QUOT   , KC_ENT                    ,    KC_DELETE , KC_END    , KC_PGDOWN ,
// │                   │           │           │           │           │           │           │           │           │           │           │           │                           │  │           │           │           │
// ├───────────────────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───┬───────┴───────────────────────────┤  └───────────┼───────────┼───────────┘
// │ to shift layer        │           │           │           │           │           │           │           │           │           │ -------   │ to shift layer                    │              │           │            13
     KC_FN1                , KC_Y      , KC_X      , KC_C      , KC_V      , KC_B      , KC_N      , KC_M      , KC_COMM   , KC_DOT    , EN_SLSH   , KC_FN1                            ,                KC_UP     ,
// │                       │           │           │           │           │           │           │           │           │           │           │                                   │              │           │           
// ├───────────────────────┴───┬───────┴─────┬─────┴───────────┴───────────┴───────────┴───────────┴───────────┴───────────┴───────────┴───────────┴───┬───────────────────────────────┤  ┌───────────┼───────────┼───────────┐
// │             │             │             │                                                                         │               │               │               │               │  │           │           │           │11
     KC_LCTL     , KC_LGUI     , KC_LALT     , KC_SPC                                                                  , KC_RALT       , KC_RGUI       , KC_RALT       , KC_RCTL       ,    KC_LEFT   , KC_DOWN   , KC_RGHT   )
// │             │             │             │                                                                         │               │               │               │               │  │           │           │           │
// └─────────────┴─────────────┴─────────────┴─────────────────────────────────────────────────────────────────────────┴───────────────┴───────────────┴───────────────┴───────────────┘  └───────────┴───────────┴───────────┘

[...]
« Last Edit: Sun, 25 December 2016, 11:23:20 by 0xBeFa »

Offline pabile

  • Posts: 157
  • Location: Southeast Asia
    • pabile online
Re: TMK keyboard firmware
« Reply #1763 on: Tue, 27 December 2016, 01:40:34 »
Right, to use T5 is another solution for this.
New keymap editor should have T5, check first post of Alps64 again.

i just did and find the update so awesome... also used layer tap on caps lock!
thanks, hasu!

Offline splicepoint

  • Posts: 8
Re: TMK keyboard firmware
« Reply #1764 on: Wed, 28 December 2016, 21:49:57 »
Hi all,

Back after a break. Hoping someone can lend me a hand. I recently reworked my Phantom PCB project from a new PCB and started fresh. After getting all the diodes soldered in, I soldered the Teensy, flashed the hex file from tmk to the unit and used AquaKey to test each switch location before actually putting the MX Browns into the PCB.

I cannot get columns 11 and 12 to work correctly after several hours of troubleshooting. I am pretty confident that the board is soldered correctly, I have tested the connection to the Teensy with a multimeter and everything appears to be in order.

Attached is a link to a zip of my tmk build and an image of the layout ( http://imgur.com/oyygnud )  - all keys in yellow are working (it's TKL). https://www.dropbox.com/s/qfx4hbny198umq3/phantom.zip?dl=0 If anyone has any suggestions I am dying to get this thing working this time around. Firmware has really made this mech building experience a frustration and I want to accomplish this first build (second attempt) so that I can stick around and keep this as a hobby. Feeling like I'm in need of a helping hand though.

Just hoping to know whether I'm missing something with the firmware or whether I definitely have a hardware issue on my hands. Just couldn't isolate the issue on my own.

Any help appreciated. Happy to provide more info as well.

Thanks,
Splice

« Last Edit: Wed, 28 December 2016, 22:03:28 by splicepoint »

Offline hasu

  • Thread Starter
  • Posts: 3315
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1765 on: Wed, 28 December 2016, 22:10:08 »
Splice,
Did you confirm that the columns work well with official Phantom firmware, already? I think this is the easiest way to discriminate between hardware problem and firmware one.

Not that I don't believe your mutltimeter job but people including me often miss something when in trouble in particular :D

Offline splicepoint

  • Posts: 8
Re: TMK keyboard firmware
« Reply #1766 on: Wed, 28 December 2016, 22:23:47 »
Hi Hasu,

Thanks for the reply. I used some pre-baked Phantom firmware as well as spent several hours working on various tweaks to the build generating my own hex. Nothing would work for those columns. That's when I went back and resoldered everything on those columns and redid those pins to the teensy. Not saying I don't have a hardware issue - I just feel like I'm out of troubleshooting steps and now I'm unsure how what to try to isolate things down. Pretty new at this whole thing.

Thanks,

Splice

Offline hasu

  • Thread Starter
  • Posts: 3315
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1767 on: Wed, 28 December 2016, 22:39:54 »
I think pre-build firmware is enough to test your hardware, if your keyboard don't work with the pre-build firmware it is likely hardware problem, for example, bad soldering or fault on PCB. Perhaps, you can contact seller/supplier of the PCB to get help/info on building keyboard and flash firmware.

To be honest, I'm not sure TMK still works on Phantom, it has not been updated long time.

Offline splicepoint

  • Posts: 8
Re: TMK keyboard firmware
« Reply #1768 on: Wed, 28 December 2016, 22:52:26 »
Thanks Hasu - I have a feeling it'll work. Maybe it's a hardware issue. I'll investigate further. Any suggestions on alternative form factors which are similar to phantom or on other firmware that would support a phantom? I'm open to buying a new PCB too. Whatever.

Thanks again,
Splice

Offline evangs

  • * Maker
  • Posts: 1048
  • Location: Arizona
  • TheVan
Re: TMK keyboard firmware
« Reply #1769 on: Thu, 29 December 2016, 12:41:29 »
I have a question about ACTION_LAYER_TAP_KEY and ACTION_MODS_TAP_KEY. Is it possible to reference a FN key as the tap key? I have tried this and the firmware builds but when I tap that key nothing happens. When I hold it the proper modifier or layer does happen.

If this is currently not supported, where would the best place be to implement this functionality?

Offline hasu

  • Thread Starter
  • Posts: 3315
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1770 on: Thu, 29 December 2016, 18:03:27 »
I have a question about ACTION_LAYER_TAP_KEY and ACTION_MODS_TAP_KEY. Is it possible to reference a FN key as the tap key? I have tried this and the firmware builds but when I tap that key nothing happens. When I hold it the proper modifier or layer does happen.

If this is currently not supported, where would the best place be to implement this functionality?

Right, unfortunately you can't use FN as TAP_KEY currently at least.

Those TAP_KEYs have 'action_kind' codes 'ACT_LAYER_TAP' and 'ACT_{L|R}MODS_TAP' respectively.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/action_code.h#L272
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/action_code.h#L216

And behaviours of the actions are defined in switch-case clauses of common/action.c, you will be able to place implementation for your need here.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/action.c#L247-L305
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/action.c#L99-L132


Offline splicepoint

  • Posts: 8
Re: TMK keyboard firmware
« Reply #1771 on: Sun, 01 January 2017, 13:41:51 »
I think pre-build firmware is enough to test your hardware, if your keyboard don't work with the pre-build firmware it is likely hardware problem, for example, bad soldering or fault on PCB. Perhaps, you can contact seller/supplier of the PCB to get help/info on building keyboard and flash firmware.

To be honest, I'm not sure TMK still works on Phantom, it has not been updated long time.

Hey Hasu! Just an update. I got my build working. It turns out it was a problem with my poor soldering job on the micro-controller. My Teensy was not making a good connection on a few pins to the PCB.

As far as TMK, it works like a charm on Phantom - no issues there at all.

Thanks again for your help (and the firmware!)

Offline Kaibz

  • Posts: 48
  • Location: AFK but not too much
Re: TMK keyboard firmware
« Reply #1772 on: Mon, 02 January 2017, 05:25:48 »
Can you build tmk firmware on raspbian?
I'm asking as the raspberry pi is ARM based so i don't know if the needed packages (gcc, avr...) will be compatible?
« Last Edit: Mon, 02 January 2017, 05:54:40 by Kaibz »
Sharing the knowledge

Offline a-c

  • Posts: 196
  • Location: USA
Re: TMK keyboard firmware
« Reply #1773 on: Mon, 02 January 2017, 06:06:54 »
Can you build tmk firmware on raspbian?
I'm asking as the raspberry pi is ARM based so i don't know if the needed packages (gcc, avr...) will be compatible?

Works fine. All the required packages are available in the default repositories.

Offline Kaibz

  • Posts: 48
  • Location: AFK but not too much
Re: TMK keyboard firmware
« Reply #1774 on: Mon, 02 January 2017, 07:07:33 »
Thank you a-c.
Sharing the knowledge

Offline henz

  • * Exquisite Elder
  • Posts: 1284
  • What?
Re: TMK keyboard firmware
« Reply #1775 on: Mon, 02 January 2017, 13:58:10 »
id like to explore the possibilty of having a multilanguage keyboard, without having to browse code from the top up, is there such an option to translate to other keycodes?



Edit: Gonna start working on the ALT+numpad code way, let me know if you have a better idea

Offline alh84001

  • Posts: 276
  • Location: EU-HR-ZG
Re: TMK keyboard firmware
« Reply #1776 on: Thu, 05 January 2017, 16:38:43 »
I just wired a Pro Micro with 5-pin mini-DIN port and flashed the NEXT converter. Are shift LEDs supported? README states "Figure out a better use for the lock LEDs.  Right now they just light up when you press shift.", but when I press shift, nothing happens.

Offline hasu

  • Thread Starter
  • Posts: 3315
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1777 on: Thu, 05 January 2017, 16:42:33 »
To be honest ICAN' t remember it . But what happens when pressing caps lock?

Tapatalk を使用して私の Nexus 5X から送信


Offline greenwhite

  • Posts: 15
Re: TMK keyboard firmware
« Reply #1778 on: Thu, 05 January 2017, 17:10:59 »
I apologize if this issue has been resolved somewhere else, but I couldn't find an answer.

I'm using the tmk firmware (which I downloaded 12/16/16).My Caps Lock key toggles on, but when I press it again it stays on instead of turning off.  The only way for me to toggle it off is by pressing the shift key.  Any time I do press the shift key, it toggles Caps off. I would like caps lock to only be toggled by the caps lock key.  Did I miss an option in my configuration?

Thanks for any input.

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

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /*  0 - Default Layer */
    KEYMAP(
             F1,   F2,   F3,   F4,   F5,   F6,   F7,   F8,   F9,  F10,  F11,  F12, \
            ESC, PSCR,  FN0,    C,    V,    W,    F,    K,    J,  INS, HOME, PGUP, \
            FN2,       CAPS,    D,    H,    T,    N,    S,    G,  DEL,  END, PGDN, \
           LGUI,  TAB,          O,    A,    E,    U,    I,    Y,         UP,       \
           LALT,  ENT,  SPC,    R,    L,    B,    M,    P,  FN1, LEFT, DOWN, RGHT, \
           LCTL,             COMM,  DOT,    X,    Q,    Z, RSFT, BSPC, RALT, RCTL ) ,
    /* 1 - Number / Symbol Fn Layer */
    KEYMAP(
           TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,  TRNS, TRNS, \
           TRNS, TRNS, TRNS,  EQL, PSLS, PAST, PMNS,    9,    0,  TRNS, TRNS, TRNS, \
           TRNS,       TRNS, KP_7, KP_8, KP_9, PPLS, LBRC, RBRC,  TRNS, TRNS, TRNS, \
           TRNS, TRNS,       KP_4, KP_5, KP_6,    4, SLSH, SCLN,        TRNS,       \
           TRNS,  ENT,  SPC, KP_1, KP_2, KP_3,    3,    2, TRNS, TRNS,  TRNS, TRNS, \
           TRNS,             KP_0, PDOT, MINS, BSLS,  GRV, TRNS, TRNS,  TRNS, TRNS ) ,
    /* 2 - Miscelaneous Fn */
    KEYMAP(
           TRNS,  FN3,  FN4, MUTE, VOLD, VOLU, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \
            FN5, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \
           NLCK,       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[] = {
    [0] = ACTION_LAYER_TAP_KEY(2, KC_PAUS),  // Misc Fn Layer
    [1] = ACTION_LAYER_MOMENTARY(1),  // temp Num Layer
    [2] = ACTION_LAYER_TOGGLE(1),     // toggle Num Layer
    [3] = ACTION_MODS_KEY(MOD_LALT | MOD_LSFT, KC_TAB),
    [4] = ACTION_MODS_KEY(MOD_LALT, KC_TAB),
    [5] = ACTION_MODS_KEY(MOD_LALT | MOD_LCTL, KC_ESC),
};


Code: [Select]

Offline hasu

  • Thread Starter
  • Posts: 3315
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1779 on: Thu, 05 January 2017, 17:50:49 »
greenwhite,
In TMK capslock shouldn't have issue like that, iirc.
your keymap code seems to be ok. I'd suspect your hardware if your keyboard is DIY in particular. And you should start with simple keymap if you are in trouble.

check first post again, you can give information of your keyboard and make all of your codes available somewhere like github to get right answer quickly and save helpful people's precious time.

Offline alh84001

  • Posts: 276
  • Location: EU-HR-ZG
Re: TMK keyboard firmware
« Reply #1780 on: Thu, 05 January 2017, 18:44:06 »
To be honest ICAN' t remember it . But what happens when pressing caps lock?

There is no CAPS in default keymap, so I tried it with another keyboard. On my Windows machine, pressing CAPS on another keyboard mirrors it to the NEXT, so I guess I just need to adjust the keymap. Thanks!

One thing I noticed on my Mac (Yosemite), which may be a non-issue, is that CAPS state doesn't get mirrored. When I press CAPS on MacBook Pro keyboard, only that one types in caps, and next board remains in normal mode. The same thing is true for my X68k board (I posted about an issue with its LEDs in x68k converter thread) with stock x68k_usb converter. And pressing CAPS on it (it is defined in stock keymap there), causes only X68k board to type in caps, while built-in MBP board remains in normal mode.

Offline hasu

  • Thread Starter
  • Posts: 3315
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1781 on: Thu, 05 January 2017, 19:50:19 »
To be honest ICAN' t remember it . But what happens when pressing caps lock?

There is no CAPS in default keymap, so I tried it with another keyboard. On my Windows machine, pressing CAPS on another keyboard mirrors it to the NEXT, so I guess I just need to adjust the keymap. Thanks!

One thing I noticed on my Mac (Yosemite), which may be a non-issue, is that CAPS state doesn't get mirrored. When I press CAPS on MacBook Pro keyboard, only that one types in caps, and next board remains in normal mode. The same thing is true for my X68k board (I posted about an issue with its LEDs in x68k converter thread) with stock x68k_usb converter. And pressing CAPS on it (it is defined in stock keymap there), causes only X68k board to type in caps, while built-in MBP board remains in normal mode.

Current NeXT converter use LEDs on both shift keys just as Capslock indicator but it seems you can control the two LEDs respectively as you want. See this code if you are interested.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/protocol/next_kbd.c#L86-L109
https://github.com/tmk/tmk_keyboard/blob/master/converter/next_usb/led.c#L53-L60

Yes. How to handle Capslock state depneds on OS,  Windows and Linux(Xorg?) share the state but Mac doesn't, IIRC.

Offline alh84001

  • Posts: 276
  • Location: EU-HR-ZG
Re: TMK keyboard firmware
« Reply #1782 on: Fri, 06 January 2017, 05:45:41 »
Thanks for pointing out relevant bits of code. I think I'll just configure caps lock on tapping SHIFT. But for now, I'm just happy I have NEXTs working :)

Offline greenwhite

  • Posts: 15
Re: TMK keyboard firmware
« Reply #1783 on: Fri, 06 January 2017, 09:36:05 »
greenwhite,
In TMK capslock shouldn't have issue like that, iirc.
your keymap code seems to be ok. I'd suspect your hardware if your keyboard is DIY in particular. And you should start with simple keymap if you are in trouble.

check first post again, you can give information of your keyboard and make all of your codes available somewhere like github to get right answer quickly and save helpful people's precious time.

I will be sure to include all my code next time.  I discovered the issue.  I created a custom keyboard layout using the Keyboard Layout Creator, so that I could reassign punctuation.  In the properties, there is a setting to use the shift key as a toggle.  Changing the setting solved the issue. 

Offline ikno

  • Posts: 8
Re: TMK keyboard firmware
« Reply #1784 on: Sat, 07 January 2017, 18:35:58 »
I'm trying to use the Virtualbox image.
This is my first time making & flashing a keyboard.
I tried doing it under windows but had more trouble installing than anything.
So i was able to 'make' the build but now when i run make dfu it keeps waiting.
and when i run dfu-programmer it says it 'no device present'.

Am i doing somthing wrong that my keyboard is not linked correctly to my virtualbox? i installed the additional extensions and enabled the USB2.0
There is also a filter on 'Atmel bootloader'

Edit: Got it to work today. Had to run Sudo make dfu for it to find the keyboard.
« Last Edit: Sun, 08 January 2017, 02:00:28 by ikno »

Offline hasu

  • Thread Starter
  • Posts: 3315
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1785 on: Mon, 09 January 2017, 17:19:00 »
Edit: Got it to work today. Had to run Sudo make dfu for it to find the keyboard.

What 's your controller actually?
I think I had setup udev rules for most of controllers generally used in community.


Offline ikno

  • Posts: 8
Re: TMK keyboard firmware
« Reply #1786 on: Wed, 11 January 2017, 06:00:15 »
What 's your controller actually?
I think I had setup udev rules for most of controllers generally used in community.

I got the GH60 ver C through falbatech.pl so that would be a ATmega32u4 i think?

I also think that that pcb supports backlight but i don't know how to get it working.
I added a FN1 button to my layout and
[1] = ACTION_BACKLIGHT_TOGGLE(),

I installed sip sockets so i'm trying my LED's in both directions but they won't light up.
Am i missing something?

Offline henz

  • * Exquisite Elder
  • Posts: 1284
  • What?
Re: TMK keyboard firmware
« Reply #1787 on: Thu, 12 January 2017, 05:07:42 »
i thought id give it a go and try to create support for Orion, having a issue as i cant use dfu for some reason, keeps making my life pretty hard switching back and forth from linux to windows.

Anyone tried the v2 versions of the duck PCBs?

Offline comblups

  • Posts: 10
Re: TMK keyboard firmware
« Reply #1788 on: Sat, 14 January 2017, 16:58:00 »
I just bought a Teensy 2.0 for an ADB converter, but then I thought, maybe I can make a converter for both ADB an PS/2 to USB in one. Is that possible? In the git repo there are only projects for either one or the other.

Offline alh84001

  • Posts: 276
  • Location: EU-HR-ZG
Re: TMK keyboard firmware
« Reply #1789 on: Sun, 15 January 2017, 08:38:48 »
You can move ADB pin, solder each connector to relevant pins and then just program the teensy with ADB or PS/2 converter when you need one. Obviously, that's a hassle to do every now and then, and I was actually planning on trying to combine these two and some other into a single hot-swappable converter. It's just at the "dumb idea" stage, though.

Offline henz

  • * Exquisite Elder
  • Posts: 1284
  • What?
Re: TMK keyboard firmware
« Reply #1790 on: Sun, 15 January 2017, 09:13:29 »
I just bought a Teensy 2.0 for an ADB converter, but then I thought, maybe I can make a converter for both ADB an PS/2 to USB in one. Is that possible? In the git repo there are only projects for either one or the other.

Id buy another teensy, doesnt cost that much :)

Offline comblups

  • Posts: 10
Re: TMK keyboard firmware
« Reply #1791 on: Sun, 15 January 2017, 09:25:32 »
Wouldn’t it be possible to merge the firmware codes into one file an flash that onto one Teensy? Then use two pins for ADB and two pins for PS/2 and 5 pin DIN (making it three cables coming out on one side of the case I’m still struggling to come up with, the USB cable as fourth coming out on the other side).

First I thought there were several different key maps in one code file anyway, but I guess, they’re all for the same protocol (e.g. different Apple Keyboards, but all ADB).
« Last Edit: Mon, 16 January 2017, 08:37:24 by comblups »

Offline alh84001

  • Posts: 276
  • Location: EU-HR-ZG
Re: TMK keyboard firmware
« Reply #1792 on: Sun, 15 January 2017, 09:34:35 »
Id buy another teensy, doesnt cost that much :)

For converters, Pro Micro clones are enough, and much cheaper :)

Offline yoobe

  • Posts: 48
  • Location: Rolle, Switzerland
  • Yoobe
Re: TMK keyboard firmware
« Reply #1793 on: Sun, 15 January 2017, 11:36:32 »
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
Yoobe

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

Offline henz

  • * Exquisite Elder
  • Posts: 1284
  • What?
Re: TMK keyboard firmware
« Reply #1794 on: Sun, 15 January 2017, 16:30:38 »
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

Offline comblups

  • Posts: 10
Re: TMK keyboard firmware
« Reply #1795 on: Mon, 16 January 2017, 10:07:49 »
By now I have collected several keyboards I find very cool, so Id go even further and try to use more than one keyboard on one Teensy at the same time. For rexample one for typing and one for programming, or one loud and clicky and one damped and silent.

Offline ikno

  • Posts: 8
Re: TMK keyboard firmware
« Reply #1796 on: Tue, 17 January 2017, 03:48:48 »
Haven't gotten my LEDs to work yet but haven't had much time to investigate. Will be doing this later.

I got a question about ACTION_LAYER_TAP_KEY. I'm using spaceFn and sometimes i want to put a space and directly after that us spaceFn.
The first space is printed correctly but then trying to go to the spaceFn layer isn't executed correctly.
Or a lot of spaces get printed for holding space. Or it starts printing the keys i'm using for example L to go to the right.

A use case is during programming. I open { which automatically places an } as well (in my editor) so i want a space so it looks { } instead of {}.
And directly after that move behind the }.

Is there a config i can change to get this to work?

Offline pabile

  • Posts: 157
  • Location: Southeast Asia
    • pabile online
Re: TMK keyboard firmware
« Reply #1797 on: Tue, 17 January 2017, 04:27:49 »
Haven't gotten my LEDs to work yet but haven't had much time to investigate. Will be doing this later.

I got a question about ACTION_LAYER_TAP_KEY. I'm using spaceFn and sometimes i want to put a space and directly after that us spaceFn.
The first space is printed correctly but then trying to go to the spaceFn layer isn't executed correctly.
Or a lot of spaces get printed for holding space. Or it starts printing the keys i'm using for example L to go to the right.

A use case is during programming. I open { which automatically places an } as well (in my editor) so i want a space so it looks { } instead of {}.
And directly after that move behind the }.

Is there a config i can change to get this to work?

i have read in another thread that they assign " " (space) in "b". the idea is that you will still have a regular space (that repeats while being held) while holding spaceFN. https://geekhack.org/index.php?topic=51069.0

Offline hasu

  • Thread Starter
  • Posts: 3315
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1798 on: Tue, 17 January 2017, 17:50:14 »
Hmm, interesting use case, I filed on github issues.
https://github.com/tmk/tmk_keyboard/issues/428

You are suffering from 'repeat double tap' function. I guess you can tweak this behaviour with editing this part.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/action.c#L288-L307


Haven't gotten my LEDs to work yet but haven't had much time to investigate. Will be doing this later.

I got a question about ACTION_LAYER_TAP_KEY. I'm using spaceFn and sometimes i want to put a space and directly after that us spaceFn.
The first space is printed correctly but then trying to go to the spaceFn layer isn't executed correctly.
Or a lot of spaces get printed for holding space. Or it starts printing the keys i'm using for example L to go to the right.

A use case is during programming. I open { which automatically places an } as well (in my editor) so i want a space so it looks { } instead of {}.
And directly after that move behind the }.

Is there a config i can change to get this to work?


Offline nemo_gh

  • Posts: 14
Re: TMK keyboard firmware
« Reply #1799 on: Tue, 17 January 2017, 20:03:35 »
 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