Author Topic: TMK keyboard firmware  (Read 642664 times)

0 Members and 1 Guest are viewing this topic.

Offline kalmlikabohm

  • Posts: 13
Re: TMK keyboard firmware
« Reply #1700 on: Fri, 25 November 2016, 23:39:30 »
Nice screenshot. What's your editor?
And what's dactyl? Open design keyboard or something?

I can't find anything in the pics unfortunately. Btw, Your Teensy is genuine?



Sent from my Nexus 5X
Thanks! I take pride in my Screenshots.
Yes. It is genuine. I bought directly from PJRC.

The Dactyl is opensourced keyboard. https://github.com/adereth/dactyl-keyboard

Dammit ok. I'll look closer at it then. Thanks for looking, this error is escaping me!

GUI is Atom.io the github people. With uh... Operator Mono as a font... Monospaced cursive for comments is so nice to look at.

Sent from my SAMSUNG-SM-G850A using Tapatalk

« Last Edit: Sat, 26 November 2016, 10:34:55 by kalmlikabohm »

Offline hasu

  • Thread Starter
  • Posts: 3318
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1701 on: Sat, 26 November 2016, 16:46:43 »
Thanks for the info, it is fun to see feature list of modern editor!

hmm, if you use other pin than F0, F1 for the row what's happen?
And make sure F0 and F1 are not used somewhere esle.

Offline kalmlikabohm

  • Posts: 13
Re: TMK keyboard firmware
« Reply #1702 on: Sat, 26 November 2016, 21:07:25 »
Thanks for the info, it is fun to see feature list of modern editor!

hmm, if you use other pin than F0, F1 for the row what's happen?
And make sure F0 and F1 are not used somewhere esle.

When using JUST F4, I can get the F4 row just working fine with "ABCDE" etc.

However, as soon as more than 1 row is connected, only the "lower" F row will be active.
Example: F3 works when both F3 and F4 are connected, but F4 row will NOT work.

When I say "connected" I really mean defined properly in the TMK. They are always soldered in.

F0 will work when both F0 and F3 are connected but then row F3 will NOT work - I REALLY thought the wiring looked OK.
All of the rows work individually, just not more than 1 at a time.


Offline hasu

  • Thread Starter
  • Posts: 3318
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1703 on: Sat, 26 November 2016, 22:33:24 »
Smells to me like your wiring has something wrong, if you cannot find any culprit I'd recommend to solder them all again from scratch.

EDIT: Or you can try other firmware like Easy AVR if you believe your hardware is fine.
« Last Edit: Sat, 26 November 2016, 22:35:15 by hasu »

Offline FSund

  • Posts: 152
  • Location: Norway
Re: TMK keyboard firmware
« Reply #1704 on: Mon, 28 November 2016, 02:27:23 »
This has probably been answered before, but I couldn't seem to find anything when searching.

I have an ISO 60% GH60 "Satan" keyboard, with TMK firmware. Everything is working as expected, except the "<>" key (right if the small left shift, only on ISO boards), which is putting out "'" (apostrophe) and "*" instead of greater than and smaller than.

What legends should I put on the keys in keyboard-layout-editor to get the correct output?

Edit: I fixed it by setting the key to a function key, and manually setting that to "Non-US \ and |":

« Last Edit: Tue, 29 November 2016, 07:41:03 by FSund »
Join the Mechanical Keyboards Norway Discord server

Offline ac2ev

  • Posts: 32
Re: TMK keyboard firmware
« Reply #1705 on: Sat, 03 December 2016, 19:28:36 »
Those are those I was reading. Looks like I might be digging into the code or using something like SharpKeys to re-assign keys. Since I'm a touch typist I may just choose to ignore the legends and program it as a normal layout.

Thank you.

I apologize I'm not quite understanding. Without of the use of secondary "helper" key is there a way in tmk to have a key whose normal operation is

; and 'shifted' operation is +
: and when shift is pressed *

Please reference the keys next to the L key on the attached picture and you'll see they don't match regular keyboards.

For the record I have all the normal keys working with tmk (verified using AquaKeyTest) and these oddball keys are the only ones I need to program.


Offline hasu

  • Thread Starter
  • Posts: 3318
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1706 on: Sat, 03 December 2016, 19:44:07 »
Those are those I was reading. Looks like I might be digging into the code or using something like SharpKeys to re-assign keys. Since I'm a touch typist I may just choose to ignore the legends and program it as a normal layout.

Thank you.

I apologize I'm not quite understanding. Without of the use of secondary "helper" key is there a way in tmk to have a key whose normal operation is

; and 'shifted' operation is +
: and when shift is pressed *

Please reference the keys next to the L key on the attached picture and you'll see they don't match regular keyboards.

For the record I have all the normal keys working with tmk (verified using AquaKeyTest) and these oddball keys are the only ones I need to program.



What layout are you using on your computer now? Note that you have to have plain ANSI keymap on firmware.
The key you are refering is very common here :D
https://en.wikipedia.org/wiki/File:KB_Japanese.svg

EDIT: ah, it was not meaningful. I mean, try JIS layout on your OS and uses KC_SCLN for ';' and  KC_QUOT for ':' on firmware keymap. The keys will spit out as the legend says.
« Last Edit: Sun, 04 December 2016, 06:02:45 by hasu »

Offline ac2ev

  • Posts: 32
Re: TMK keyboard firmware
« Reply #1707 on: Sun, 04 December 2016, 10:17:16 »
Very interesting. I will take a look at that. Thank you.

Offline nonosway

  • Posts: 5
Re: TMK keyboard firmware
« Reply #1708 on: Mon, 05 December 2016, 15:22:27 »
hey,
so I decided to make my first foray into mechanical keyboards! I'm trying to make a numpad using this (https://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177.html) as a firmware guide. It's amazing! And as I flew through it I foolishly thought everything would go really well. I'm working in a Ubuntu VM and when I go to compile the code into .hex it says that I have a fatal error. I used "sudo apt-get install gcc g++" to install both toolchains but I keep getting the same errors. that the dfu is unavailable and stdint.h does not exist. any help would be greatly appreciated!

Offline Tactile

  • Posts: 1370
  • Location: Portland, OR
Re: TMK keyboard firmware
« Reply #1709 on: Mon, 05 December 2016, 15:27:23 »
hey,
so I decided to make my first foray into mechanical keyboards! I'm trying to make a numpad using this (https://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177.html) as a firmware guide. It's amazing! And as I flew through it I foolishly thought everything would go really well. I'm working in a Ubuntu VM and when I go to compile the code into .hex it says that I have a fatal error. I used "sudo apt-get install gcc g++" to install both toolchains but I keep getting the same errors. that the dfu is unavailable and stdint.h does not exist. any help would be greatly appreciated!

Try this:

sudo apt-get install avr-gcc (or maybe gcc-avr)

Offline nonosway

  • Posts: 5
Re: TMK keyboard firmware
« Reply #1710 on: Mon, 05 December 2016, 16:15:43 »
hey,
so I decided to make my first foray into mechanical keyboards! I'm trying to make a numpad using this (https://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177.html) as a firmware guide. It's amazing! And as I flew through it I foolishly thought everything would go really well. I'm working in a Ubuntu VM and when I go to compile the code into .hex it says that I have a fatal error. I used "sudo apt-get install gcc g++" to install both toolchains but I keep getting the same errors. that the dfu is unavailable and stdint.h does not exist. any help would be greatly appreciated!

Try this:

sudo apt-get install avr-gcc (or maybe gcc-avr)

Hey, it is gcc-avr for the record :) I did that but i'm getting this:
sh: 1: dfu-programmer: not found
sh: 1: dfu-programmer: not found


-------- begin --------
avr-gcc (GCC) 4.9.2
Copyright (C) 2014 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.




mkdir -p obj_gh60_lufa
Compiling C: keymap_poker.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DINTERRUPT_CONTROL_ENDPOINT -DBOOTLOADER_SIZE=4096 -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=unknown -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_gh60_lufa/keymap_poker.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_gh60_lufa_keymap_poker.o.d  keymap_poker.c -o obj_gh60_lufa/keymap_poker.o
In file included from keymap_common.h:20:0,
                from keymap_poker.c:2:
/usr/lib/gcc/avr/4.9.2/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory
 # include_next <stdint.h>
                         ^
compilation terminated.
../../tmk_core/rules.mk:557: recipe for target 'obj_gh60_lufa/keymap_poker.o' failed
make: *** [obj_gh60_lufa/keymap_poker.o] Error 1



I'm begining to think it may be a problem with my makefile but i honestly have no idea what i'm doing here hahaha

Offline Tactile

  • Posts: 1370
  • Location: Portland, OR
Re: TMK keyboard firmware
« Reply #1711 on: Mon, 05 December 2016, 16:18:36 »
apt-get install dfu-programmer

Offline nonosway

  • Posts: 5
Re: TMK keyboard firmware
« Reply #1712 on: Mon, 05 December 2016, 16:25:24 »
Reading package lists... Done
Building dependency tree     
Reading state information... Done
E: Unable to locate package dfu
E: Unable to locate package programmer
 
I got this back

Offline a-c

  • Posts: 196
  • Location: USA
Re: TMK keyboard firmware
« Reply #1713 on: Mon, 05 December 2016, 16:27:11 »
apt-get install avr-libc

Offline Tactile

  • Posts: 1370
  • Location: Portland, OR
Re: TMK keyboard firmware
« Reply #1714 on: Mon, 05 December 2016, 16:28:12 »
DFU dash PROGRAMMER

sudo apt-get install dfu-programmer

Offline nonosway

  • Posts: 5
Re: TMK keyboard firmware
« Reply #1715 on: Mon, 05 December 2016, 16:44:38 »
yeah it's installed correctly, but I keep getting the same error.

Offline Tactile

  • Posts: 1370
  • Location: Portland, OR
Re: TMK keyboard firmware
« Reply #1716 on: Mon, 05 December 2016, 16:55:07 »
yeah it's installed correctly, but I keep getting the same error.

It sounds like the hex file was built ok. If you have dfu-programmer installed you can just flash the hex file yourself.  It's been a while since I did that, so I can't walk you through it. Step 1 would to be to find the hex file and copy it somewhere you can find it easily. then you'd type: dfu-programmer [some stuff] your.hex.file   The man page for dfu-programmer will lay it out for you.

No-one will find this in order to help. Start a new thread asking for help with dfu-programmer. You're 99% done, you just need to flash.

Offline nonosway

  • Posts: 5
Re: TMK keyboard firmware
« Reply #1717 on: Mon, 05 December 2016, 17:00:39 »
That's very encouraging to hear!I will redirect my question thank you!

Offline Tactile

  • Posts: 1370
  • Location: Portland, OR
Re: TMK keyboard firmware
« Reply #1718 on: Mon, 05 December 2016, 17:03:50 »
That's very encouraging to hear!I will redirect my question thank you!

And be sure to read a-c comment above about avr-libc

Offline a-c

  • Posts: 196
  • Location: USA
Re: TMK keyboard firmware
« Reply #1719 on: Wed, 07 December 2016, 16:07:17 »
The power of TMK in a tiny board.

http://www.40percent.club/2016/12/nano-tmk.html
« Last Edit: Wed, 07 December 2016, 16:09:02 by a-c »

Offline lemur

  • Posts: 81
  • Location: USA
  • personal text
Re: TMK keyboard firmware
« Reply #1720 on: Thu, 08 December 2016, 23:47:29 »
As Koren said, you cannot send mousekey with register_code(), but it seems like media key and system key can be sent.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/action.c#L419-L424

I think you can fix around here to send mouse keys.(or register_code() should be fixed?)
https://github.com/tmk/tmk_keyboard/blob/33714e55827d1cf52df1d3ff143f03fa34ad1f06/tmk_core/common/action_macro.c#L40-L59

And I originaly designed that macro can send keycodes only of 0x04-0x73 to save memory space. So I didn't think about sending mouse and media key events in macro much.
https://github.com/tmk/tmk_keyboard/blob/33714e55827d1cf52df1d3ff143f03fa34ad1f06/tmk_core/common/action_macro.h#L38-L55

This was filed and will be fixed some later(TM).
https://github.com/tmk/tmk_keyboard/issues/289

Between both of your posts, I was able to fix it, I think.  My testing is far from extensive, but wheel up/down and left click work in a couple different macros for me.

In register_code() I added the following to the end:

    else if IS_MOUSEKEY(code) {
        mousekey_on(code);
        mousekey_send();
    }

And similarly I added the following to unregister_code():

    else if IS_MOUSEKEY(code) {
        mousekey_off(code);
        mousekey_send();
    }

Thanks.

I'd like to bring this post back from the dead just for clarifications sake, maybe it will help those looking, as I did, to make a mouse click work in a macro in TMK.

I don't know what problems this may cause elsewhere..... But after searching around I did as said above, and added the lines in tmk_core/common/action.c, as of my typing this, the first part went on line 431, under the section commented as 'Utilities for actions' in 'void register_code...'  ....and the other block went on line 493 at the end of  'void unregister_code...'

I'm guessing this kind of thing isn't a permanent fix, but it got mouse clicking in a macro working for me.

Clicking a mouse button in a macro is big time super important for the work I do requires lots of clicking on forms to paste stuff in certain places and clicking on words/things of text to copy stuff..  and it seems like this little thing does the trick.... while saving me from doing endless clicks (one button press can now do 3 clicks and ctrl+v!)

below is what the area of the code should look like if your stumbling around, like i was after reading the quoted post, trying to find where to paste the darned stuff.

in my keymap file you just assign the mouse button press in the macro just like you do any other key... in this case I use  T(BTN2)

« Last Edit: Thu, 08 December 2016, 23:49:54 by lemur »
keyboards

Offline fiete

  • Posts: 11
Re: TMK keyboard firmware
« Reply #1721 on: Fri, 09 December 2016, 04:18:44 »
Hi I'm new to selfmade keyboards and their firmware.

Thanks for your great work with tmk.

Just trying to make my own layout based on a german keyboard but there is one key I don't find in the keymap documentation.

So what I want to know is whether there is a way to get the keycode number you referencing in keycode.h
I tried the tool xev under linux but the keycode numbers I'm getting there don't seem to match yours.

Key I'm looking for is on the bottom left of the keyboard and is labeled with the 3 Symbols ><|

Best regards
Fritz

Offline chupanibre

  • Posts: 7
Re: TMK keyboard firmware
« Reply #1722 on: Fri, 09 December 2016, 04:21:53 »
hi hasu and board,

i recently aquired a cherry mx numpad that i wanted to remap. but it's an usb device, and it seems i need a usb shield for my pro micro clone to make it work. is that true? so far i've only encountered ps2-keyboards that were worth converting, i assumed it would work the same with usb. do i really need to order another piece of circuitry or is there a way around (like one of these green usb to ps2 converters)?

thanks (and sorry if that was a stupid question..)

some pics of the numpad itt: https://www.reddit.com/r/MechanicalKeyboards/comments/4ozx84/review_additional_notes_about_the_20_jelly_comb/
and the adapter i mean: https://commons.wikimedia.org/wiki/File:USB_to_PS2_mouse_adapter.jpg

Offline hasu

  • Thread Starter
  • Posts: 3318
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1723 on: Fri, 09 December 2016, 06:13:59 »
Hi I'm new to selfmade keyboards and their firmware.

Thanks for your great work with tmk.

Just trying to make my own layout based on a german keyboard but there is one key I don't find in the keymap documentation.

So what I want to know is whether there is a way to get the keycode number you referencing in keycode.h
I tried the tool xev under linux but the keycode numbers I'm getting there don't seem to match yours.

Key I'm looking for is on the bottom left of the keyboard and is labeled with the 3 Symbols ><|

Best regards
Fritz
Use showkeys to show raw scan code, xev displays codes defined in xorg.
And you can refer HID usage table to know USB keyboard codes.

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


Offline FSund

  • Posts: 152
  • Location: Norway
Re: TMK keyboard firmware
« Reply #1724 on: Fri, 09 December 2016, 07:16:04 »
Hi I'm new to selfmade keyboards and their firmware.

Thanks for your great work with tmk.

Just trying to make my own layout based on a german keyboard but there is one key I don't find in the keymap documentation.

So what I want to know is whether there is a way to get the keycode number you referencing in keycode.h
I tried the tool xev under linux but the keycode numbers I'm getting there don't seem to match yours.

Key I'm looking for is on the bottom left of the keyboard and is labeled with the 3 Symbols ><|

Best regards
Fritz
This seems to be the same problem as I had recently.

My hack-ish fix is below:
Edit: I fixed it by setting the key to a function key, and manually setting that to "Non-US \ and |":

Show Image

There is probably a more proper way to fix this, but this works for now.
Join the Mechanical Keyboards Norway Discord server

Offline hasu

  • Thread Starter
  • Posts: 3318
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1725 on: Fri, 09 December 2016, 11:51:10 »
It seems to be legitimate code for the key. Confirm it by referring HID usage table specification.

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


Offline slowtyping

  • Posts: 6
Re: TMK keyboard firmware
« Reply #1726 on: Sun, 11 December 2016, 07:36:21 »
I am a new user of the (very useful) TMK/QMK. I am wondering whether the firmware will allow key chords like those enabled by the popular emacs "keychord" mode, which allows you to press two keys almost simultaneously to produce a command.

For example, I have 'kl' bound to save, so if I hit those two keys at the same time, my file is saved without having to use any modifiders like Ctrl and Alt. It doesn't mean that I can't or don't use the modifiders, but it significantly increases my options and reduces finger and wrist strain.

It may be that this functionality already exists in TMK, in which I case I would be grateful if somebody could point me in the right direction - as I said, I'm still new to this!

Thanks,
ST

« Last Edit: Sun, 11 December 2016, 08:13:26 by slowtyping »

Offline fiete

  • Posts: 11
Re: TMK keyboard firmware
« Reply #1727 on: Tue, 13 December 2016, 18:21:21 »
Hi thanks for your help with my first problem.

perhaps you got an idea regarding the second one.

How can I use the altgr key in tmk as modifier since I cant type e.g. brackets without it if the system im trying to type on got german layout configured.

Thanks in advance!

Offline hasu

  • Thread Starter
  • Posts: 3318
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1728 on: Tue, 13 December 2016, 18:33:53 »
Hi thanks for your help with my first problem.

perhaps you got an idea regarding the second one.

How can I use the altgr key in tmk as modifier since I cant type e.g. brackets without it if the system im trying to type on got german layout configured.

Thanks in advance!

Post pic or schematic of your keyboard and show your codes, preferable to use github.
Excess information doesn't harm while scarce of info makes ti difficult to resolve. We have to speculate your keyboard layout,  keymap or etc.

Can I assume you checked the 'HID usage table' already?

Offline fiete

  • Posts: 11
Re: TMK keyboard firmware
« Reply #1729 on: Tue, 13 December 2016, 18:44:12 »
wow didnt expect such a fast reply.

My goal is to write my layout in tmk that way that a key press sends the codes that a computer with german layout configured interpretes as expected.
So I can just go to some computer plug in my keyboard and start typing.

German layout looks as you can see here

So I just want to know how I can write an {

I already tried: ACTION_MODS_KEY(MOD_RALT, KC_7) without success and also cant find AltGr in HID codes pdf file.

Regards
Fritz

Offline hasu

  • Thread Starter
  • Posts: 3318
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1730 on: Tue, 13 December 2016, 18:53:47 »
ACTION_MODS_KEY() can't accept right side modifiers, always sends left modifiers unfortunately. This is undocumented and should be mentioned in tmk_core/doc/keymap.md.

EDIT: not ture. it accept both left and right mods. I don't know why ACTION_MODS_KEY(MOD_RALT, KC_7) doesn't work.

You have to use 'KC_RALT' for altgr instead.
« Last Edit: Tue, 13 December 2016, 19:14:51 by hasu »

Offline hasu

  • Thread Starter
  • Posts: 3318
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1731 on: Tue, 13 December 2016, 19:32:48 »
ACTION_MODS_KEY() can't accept right side modifiers, always sends left modifiers unfortunately. This is undocumented and should be mentioned in tmk_core/doc/keymap.md.

EDIT: not ture. it accept both left and right mods. I don't know why ACTION_MODS_KEY(MOD_RALT, KC_7) doesn't work.

You have to use 'KC_RALT' for altgr instead.

Confirmed ACTION_MODS_KEY(MOD_RALT, KC_7) works on my keyboard(HHKB), it yields '{' on German layout on Xorg on Ubuntu16.04.
AltGr key on ISO keyboard is equivalent to Right Alt, use just 'KC_RALT' in TMK.

Offline leizzer

  • Posts: 10
Re: TMK keyboard firmware
« Reply #1732 on: Wed, 14 December 2016, 00:22:44 »
Hello guys,
first of all a big thanks to the people behind this firmware :)

I'm using chibios with my handwired keyboard (teensy 3.2) and I'm trying to add backlight to it. I know that only a few guys are using teensy 3.2 but it will be more than appreciated your help.

I added the backlight.c and backlight.h trying to copy this https://github.com/skullydazed/tmk_keyboard/tree/master/keyboard/cluepad (that somebody answered to a guy that he could follow that as an example).
But, with chibios it seems that I can't use
Code: [Select]
#include <avr/io.h> because I get an error that it is not defined, and when I remove that line I get
Code: [Select]
[...........]
Compiling chprintf.c
Compiling memstreams.c
Compiling nullstreams.c
Compiling usb_main.c
../../tmk_core/protocol/chibios/usb_main.c: In function 'usb_event_cb':
../../tmk_core/protocol/chibios/usb_main.c:787:3: warning: enumeration value 'USB_EVENT_UNCONFIGURED' not handled in switch [-Wswitch]
   switch(event) {
   ^
Compiling main.c
Compiling keymap_plain.c
Compiling matrix.c
Compiling backlight.c
backlight.c: In function 'led_set':
backlight.c:9:22: warning: unused parameter 'usb_led' [-Wunused-parameter]
 void led_set(uint8_t usb_led)
                      ^
backlight.c: In function 'init_backlight_pin':
backlight.c:17:5: error: 'DDRC' undeclared (first use in this function)
     DDRC |= (1<<12);
     ^
backlight.c:17:5: note: each undeclared identifier is reported only once for each function it appears in
backlight.c:20:5: error: 'TC4H' undeclared (first use in this function)
     TC4H = 0x03;
     ^
backlight.c:21:5: error: 'OCR4C' undeclared (first use in this function)
     OCR4C = 0xFF;
     ^
backlight.c:22:5: error: 'TCCR4A' undeclared (first use in this function)
     TCCR4A = 0b10000010;
     ^
backlight.c:23:5: error: 'TCCR4B' undeclared (first use in this function)
     TCCR4B = 0b00000001;
     ^
backlight.c: In function 'backlight_set':
backlight.c:52:5: error: 'TC4H' undeclared (first use in this function)
     TC4H = pwm_level >> 8;
     ^
backlight.c:53:5: error: 'OCR4A' undeclared (first use in this function)
     OCR4A = 0xFF & pwm_level;
     ^
../../tmk_core/tool/chibios/ChibiOS/os/common/startup/ARMCMx/compilers/GCC/rules.mk:217: recipe for target 'build/obj/backlight.o' failed
make: *** [build/obj/backlight.o] Error 1


I'm also thinking that I should be using
Code: [Select]
TEENSY_PIN12 instead of
Code: [Select]
1<<12

This is my repo https://github.com/leizzer/tmk_keyboard/tree/personal/keyboard/totoro_lc

Thanks again for your time!!
PS: I code for living but I'm not a native C speaker, please be kind explaining

Offline fiete

  • Posts: 11
Re: TMK keyboard firmware
« Reply #1733 on: Wed, 14 December 2016, 01:43:38 »
Confirmed ACTION_MODS_KEY(MOD_RALT, KC_7) works on my keyboard(HHKB), it yields '{' on German layout on Xorg on Ubuntu16.04.
AltGr key on ISO keyboard is equivalent to Right Alt, use just 'KC_RALT' in TMK.

Thank you very much for testing and fast response!

Will go and implement and report back if I got some problem :-)

Regards
Fritz

Offline fiete

  • Posts: 11
Re: TMK keyboard firmware
« Reply #1734 on: Wed, 14 December 2016, 09:45:29 »
Hi hasu,

tried that but does not work here on gentoo with german keymap in X.

Can you please tell me what keycode your MOD_RALT sends on your System?
I get with showkey -s the following

Code: [Select]
KC_RALT 0x2a 0x38 0x0c 0x8c 0xaa 0xb8
KC_RCTRL 0x2a 0x08 0x88 0xaa
MOD_RALT 0x2a 0x38 0x08 0xaa 0xb8

And thats what AltGr and right Ctrl send on a normal keyboard

Code: [Select]
AltGr 0xe0 0x38 0xe0 0xb8
RCtrl 0xe0 0x1d 0xe0 0x9d

Do you have an idea where that diffrence comes from? Im nearly sure that I'm doing something wrong.

Is there a way to add those keycodes to kexcodes.h?

Thanks in advance!
Regards
Frity

Offline leizzer

  • Posts: 10
Re: TMK keyboard firmware
« Reply #1735 on: Wed, 14 December 2016, 14:06:36 »
Hi hasu,

tried that but does not work here on gentoo with german keymap in X.

Can you please tell me what keycode your MOD_RALT sends on your System?
I get with showkey -s the following

Code: [Select]
KC_RALT 0x2a 0x38 0x0c 0x8c 0xaa 0xb8
KC_RCTRL 0x2a 0x08 0x88 0xaa
MOD_RALT 0x2a 0x38 0x08 0xaa 0xb8

And thats what AltGr and right Ctrl send on a normal keyboard

Code: [Select]
AltGr 0xe0 0x38 0xe0 0xb8
RCtrl 0xe0 0x1d 0xe0 0x9d

Do you have an idea where that diffrence comes from? Im nearly sure that I'm doing something wrong.

Is there a way to add those keycodes to kexcodes.h?

Thanks in advance!
Regards
Frity

Have you tried other layouts? (German, English International AltGr with dead keys) Because in Ubuntu I can use AltGr as normal
Are the codes for other keys the same between keyboards?

Offline fiete

  • Posts: 11
Re: TMK keyboard firmware
« Reply #1736 on: Wed, 14 December 2016, 15:03:36 »
Have you tried other layouts? (German, English International AltGr with dead keys) Because in Ubuntu I can use AltGr as normal
Are the codes for other keys the same between keyboards?

I want it to work with german keyboard set in Xorg. Other keys like e.g. 'a' or 't' got identical keycodes. Also tried an normal usb keyboard to see whether it produces the same codes than my notebooks keyboard (it does).

Any other suggestions what I can do?

Thanks
Fritz

Offline fiete

  • Posts: 11
Re: TMK keyboard firmware
« Reply #1737 on: Wed, 14 December 2016, 15:54:56 »
Please forget what I wrote about the scancodes. Got a fault in my code. The scancode of KC_RALT and AltGr are the same now. But ACTION_MODS_KEY does not work as expected with KC_RALT and the numbers at the moment. Will go on searching my error.

Regards Fritz

Offline hasu

  • Thread Starter
  • Posts: 3318
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1738 on: Wed, 14 December 2016, 17:05:50 »
Hello guys,
first of all a big thanks to the people behind this firmware :)

I'm using chibios with my handwired keyboard (teensy 3.2) and I'm trying to add backlight to it. I know that only a few guys are using teensy 3.2 but it will be more than appreciated your help.

I added the backlight.c and backlight.h trying to copy this https://github.com/skullydazed/tmk_keyboard/tree/master/keyboard/cluepad (that somebody answered to a guy that he could follow that as an example).
But, with chibios it seems that I can't use
Code: [Select]
#include <avr/io.h> because I get an error that it is not defined, and when I remove that line I get
Code: [Select]
[...........]
Compiling chprintf.c
Compiling memstreams.c
Compiling nullstreams.c
Compiling usb_main.c
../../tmk_core/protocol/chibios/usb_main.c: In function 'usb_event_cb':
../../tmk_core/protocol/chibios/usb_main.c:787:3: warning: enumeration value 'USB_EVENT_UNCONFIGURED' not handled in switch [-Wswitch]
   switch(event) {
   ^
Compiling main.c
Compiling keymap_plain.c
Compiling matrix.c
Compiling backlight.c
backlight.c: In function 'led_set':
backlight.c:9:22: warning: unused parameter 'usb_led' [-Wunused-parameter]
 void led_set(uint8_t usb_led)
                      ^
backlight.c: In function 'init_backlight_pin':
backlight.c:17:5: error: 'DDRC' undeclared (first use in this function)
     DDRC |= (1<<12);
     ^
backlight.c:17:5: note: each undeclared identifier is reported only once for each function it appears in
backlight.c:20:5: error: 'TC4H' undeclared (first use in this function)
     TC4H = 0x03;
     ^
backlight.c:21:5: error: 'OCR4C' undeclared (first use in this function)
     OCR4C = 0xFF;
     ^
backlight.c:22:5: error: 'TCCR4A' undeclared (first use in this function)
     TCCR4A = 0b10000010;
     ^
backlight.c:23:5: error: 'TCCR4B' undeclared (first use in this function)
     TCCR4B = 0b00000001;
     ^
backlight.c: In function 'backlight_set':
backlight.c:52:5: error: 'TC4H' undeclared (first use in this function)
     TC4H = pwm_level >> 8;
     ^
backlight.c:53:5: error: 'OCR4A' undeclared (first use in this function)
     OCR4A = 0xFF & pwm_level;
     ^
../../tmk_core/tool/chibios/ChibiOS/os/common/startup/ARMCMx/compilers/GCC/rules.mk:217: recipe for target 'build/obj/backlight.o' failed
make: *** [build/obj/backlight.o] Error 1


I'm also thinking that I should be using
Code: [Select]
TEENSY_PIN12 instead of
Code: [Select]
1<<12

This is my repo https://github.com/leizzer/tmk_keyboard/tree/personal/keyboard/totoro_lc

Thanks again for your time!!
PS: I code for living but I'm not a native C speaker, please be kind explaining


The code is for AVR and Teensy3.2 you are using has Kinetis, not AVR.
Use Teensy2.0 or write backlight code for Kinetsis yourself.

Offline fiete

  • Posts: 11
Re: TMK keyboard firmware
« Reply #1739 on: Thu, 15 December 2016, 00:56:20 »
Hi, just a small update from my side. I am able to write { if i bind KC_RALT to a key and press the correspondong number 7. But it does not work if I use it with ACTION_MODS_KEY. Any idea what I might do wrong? Or where i should have a look inside the code?
Regards Fritz

Gesendet von meinem STV100-4 mit Tapatalk


Offline DstroyGH

  • Posts: 1
Re: TMK keyboard firmware
« Reply #1740 on: Fri, 16 December 2016, 08:16:46 »
Hi There,
I'm trying to compile the firmware , but i keep getting this error

obj_gh60_lufa/common/keymap.o: In function `keymap_fn_to_action':
/mnt/c/Users/Dstroy/Desktop/tmk_keyboard-master/keyboard/gh60/../../tmk_core/common/keymap.c:246: undefined reference to `fn_actions'
/mnt/c/Users/Dstroy/Desktop/tmk_keyboard-master/keyboard/gh60/../../tmk_core/common/keymap.c:246: undefined reference to `fn_actions'

I have removed the word static from keymap.c in the core/common folder and I still get the same error.
Any help would be appreciated.

Offline tjweir

  • * Exquisite Elder
  • Posts: 1039
  • Location: Toronto
Re: TMK keyboard firmware
« Reply #1741 on: Fri, 16 December 2016, 09:08:39 »
Hi There,
I'm trying to compile the firmware , but i keep getting this error

obj_gh60_lufa/common/keymap.o: In function `keymap_fn_to_action':
/mnt/c/Users/Dstroy/Desktop/tmk_keyboard-master/keyboard/gh60/../../tmk_core/common/keymap.c:246: undefined reference to `fn_actions'
/mnt/c/Users/Dstroy/Desktop/tmk_keyboard-master/keyboard/gh60/../../tmk_core/common/keymap.c:246: undefined reference to `fn_actions'

I have removed the word static from keymap.c in the core/common folder and I still get the same error.
Any help would be appreciated.

Paste your keymap file, probably missing:
Code: [Select]
const uint16_t PROGMEM fn_actions[] = {};

Offline Kaibz

  • Posts: 48
  • Location: AFK but not too much
Re: TMK keyboard firmware
« Reply #1742 on: Fri, 16 December 2016, 16:59:36 »
Ok so i yesterday my keyboard stops working, i spend the night trying to figure it out, i even switch from a teensy 2.00 ++ to a teensy 2.0 as i thought may be my teensy is damaged, but then again it still didn't work. I was literally going crazy, there was just nothing coming out of my keyboard but the make process was fine. Finally i just plugged it to m yportable computer, and it did work....I really don't understand what is goind on, my 2 computers are running windows 7 (one 32bits the other 64bits) and i am still totally unable to make the keyboard work on my windows 64bits, coud a windows update be responsible? what could i do honestly i m going crazy i can only type/work on my custom keyboard help please
Sharing the knowledge

Offline hasu

  • Thread Starter
  • Posts: 3318
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1743 on: Fri, 16 December 2016, 17:23:03 »
Scaned your old posts and I foud you had problem with your keyboard and computer.
https://geekhack.org/index.php?topic=41989.msg2194775#msg2194775
https://geekhack.org/index.php?topic=41989.msg2198920#msg2198920

 I guess your keyboard hardware is iffy.

Offline Kaibz

  • Posts: 48
  • Location: AFK but not too much
Re: TMK keyboard firmware
« Reply #1744 on: Fri, 16 December 2016, 18:29:46 »
:( I see, gonna order another teensy then....

Thanks for answering Hasu !
Sharing the knowledge

Offline hasu

  • Thread Starter
  • Posts: 3318
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1745 on: Fri, 16 December 2016, 18:37:55 »
:( I see, gonna order another teensy then....

Thanks for answering Hasu !

what's your keyboard actually? If it is a hand-wired keyboard you would have to check your soldering and wriring with good multimeter before replacing Teensy.

Offline Kaibz

  • Posts: 48
  • Location: AFK but not too much
Re: TMK keyboard firmware
« Reply #1746 on: Sat, 17 December 2016, 11:43:52 »
It is a hand wired keyboard. I did actually i rechecked EVERYTHING and i made tests, this is where i am right now (using windows 7 ultimate 64) If keyboard is plugged before i launch windows, i will be able to use it normally (i am typing this message with it)  if i unplugged it even once, and then plug it back the keyboard won't work and i tried this with the old AND the new install of windows. I am desperate.

EDIT: Fixed the issue just switching to windows 10.

Thanks again to Hasu for creating this firmware. Cheers.
« Last Edit: Sun, 18 December 2016, 11:20:52 by Kaibz »
Sharing the knowledge

Offline MandrewDavis

  • Posts: 460
  • Location: Fl
  • Chasin' That Neon Rainbow
Re: TMK keyboard firmware
« Reply #1747 on: Mon, 19 December 2016, 21:13:17 »
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?
I've come to view humanity as predominantly monkey business.

My Classifieds Thread

Offline Tactile

  • Posts: 1370
  • Location: Portland, OR
Re: TMK keyboard firmware
« Reply #1748 on: Mon, 19 December 2016, 21:33:46 »
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?

Step 1 would be to install the Windows Linux subsystem. This will install an Ubuntu command line environment within which you can compile the firmware.  There are other ways to do it but IMO the easiest way to build the firmware within Windows is just build it in Linux.

https://msdn.microsoft.com/en-us/commandline/wsl/install_guide

Then sudo apt-get install gcc-avr avr-libc to get the main tools installed.

I'm throwing this together hurriedly - I'm supposed to be hosting a party right now. Anyway, even though I've probably left something out this should get you started in the right direction.

Offline pabile

  • Posts: 157
  • Location: Southeast Asia
    • pabile online
Re: TMK keyboard firmware
« Reply #1749 on: Thu, 22 December 2016, 01:34:31 »
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).
155886-0

- Layer 4 has my F rows et al
155888-1

- Layer 1 uses a regular space and uses CapsLock to switch to Layer 4
155890-2


Now for my question...
In Layer 4, do i need to define CapsLock as L4? How about spacebar as SpaceFN(L4)?